From patchwork Mon Nov 13 13:00:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunsheng Lin X-Patchwork-Id: 16509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1182894vqg; Mon, 13 Nov 2023 05:01:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvRN3I0IQOkzD5ZSqF2XTuiE4FaAJp9un/9xGjgA38Cszxc+0vfkJhd+oD5x9DET30UBSU X-Received: by 2002:a17:90b:33cc:b0:280:23e1:e4dd with SMTP id lk12-20020a17090b33cc00b0028023e1e4ddmr10072191pjb.17.1699880514186; Mon, 13 Nov 2023 05:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699880514; cv=none; d=google.com; s=arc-20160816; b=wQqUTUiJ+d3CdMvwkVW2x2q64w9ZlxTjK5NUbvf44KUHkLqzjYRvljBzdN8AQasmaH Id5LhQPM2RCA/fACJqeus0vF23O1BOKL/9oOfHx8xv+45laRo6g25ZH/C0guOVBm8p04 1oBw4yTcDE40zduwxKhVtjqmQH4SpePpinoQbxuhsu3wzn5RZYOwfmlRJmQ8TMQCNP4p gcPULWZKxkgJ99p2JMiH3eHl72Ow9P/E6zS6wLujnbsTFi3TZxRnQU2Hm7KW9PQKD8oE wjkgCTiZFl1l6qULRhQWTqsmfiZAoYoHVCQG+IzaFUs41jgCzrU0tID5uMXGqCBd++ue lAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WkIYikg8QjxH7viJFCIvezhNpPUEoQE4RkgCXJL9Xss=; fh=rpgd+rBTFhv/UVUrKvI/g1qH621dbxAWhcUv71ig/BU=; b=cto9rxAIE3yKgEN/YWhOOn1wQHAT9kXUuevMgnQ+NwtS1W4wynPavRTLiyjIOjiW8u ZyikVR78R+F/9jVTSJayl4WaklocvJaCJXOpU+x8biwr0Z446BqjJA0moisopuzTJjoG GZ0v4QITt7pSBmw4nHvowMj1J1IXyge1LOq5/QMc9qsLfw4d8pPMQFGYzX/UTllLNsXa pwWVe7wotZYWuFkyMBo9WY0SqfQT2FXDOyP2rPNA1BtcEEeWe1+DiGLGdyeMmJ4UK2y2 Y1fVcRXcJibd6aaqzdWGqHWnBejXlmPbvH9o40w0wrJd3d93Yc80MKz58/E/QzNdennK D57g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id c18-20020a17090a8d1200b00262ff3a4545si10126733pjo.169.2023.11.13.05.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 05:01:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id BCEB58080EE7; Mon, 13 Nov 2023 05:01:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230478AbjKMNAu (ORCPT + 29 others); Mon, 13 Nov 2023 08:00:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230441AbjKMNAl (ORCPT ); Mon, 13 Nov 2023 08:00:41 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C515719B1; Mon, 13 Nov 2023 05:00:32 -0800 (PST) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4STTvQ5hHZzPnmK; Mon, 13 Nov 2023 20:56:18 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 13 Nov 2023 21:00:30 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin Subject: [PATCH RFC 0/8] A possible proposal for intergating dmabuf to page pool Date: Mon, 13 Nov 2023 21:00:32 +0800 Message-ID: <20231113130041.58124-1-linyunsheng@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 13 Nov 2023 05:01:37 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782453910414914931 X-GMAIL-MSGID: 1782453910414914931 This patchset is based on the [1] and [2], it is similar to what patch [2] is doing in essence, the main differences is: 1. It reuses the 'struct page' to have more unified handling between normal page and devmem page for net stack. 2. It relies on the page->pp_frag_count to do reference counting instead of page->_refcount, in order to decouple the devmem page from mm subsystem. As this patch is using normal memory page as devmem page as prototyping, it is tested using simple iperf with some hack in hns3 driver and in __skb_datagram_iter(). 1. https://lkml.kernel.org/netdev/20230105214631.3939268-2-willy@infradead.org/ 2. https://lore.kernel.org/all/20231106024413.2801438-1-almasrymina@google.com/ Jakub Kicinski (2): net: page_pool: factor out releasing DMA from releasing the page net: page_pool: create hooks for custom page providers Mina Almasry (1): memory-provider: dmabuf devmem memory provider Yunsheng Lin (5): skbuff: explicitize the semantics of skb_frag_fill_page_desc() skbuff: remove compound_head() related function calling skbuff: always try to do page pool frag reference counting net: hns3: temp hack for hns3 to use dmabuf memory provider net: temp hack for dmabuf page in __skb_datagram_iter() .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 2 +- .../net/ethernet/hisilicon/hns3/hns3_enet.c | 9 +- drivers/net/ethernet/sun/cassini.c | 4 +- drivers/net/veth.c | 2 +- include/linux/skbuff.h | 26 ++- include/net/page_pool/types.h | 60 ++++++ net/core/datagram.c | 10 +- net/core/page_pool.c | 197 ++++++++++++++++-- net/core/skbuff.c | 10 +- net/tls/tls_device_fallback.c | 2 +- 10 files changed, 282 insertions(+), 40 deletions(-)