From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EAEFC7EE23 for ; Mon, 12 Jun 2023 13:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235861AbjFLNFS (ORCPT ); Mon, 12 Jun 2023 09:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbjFLNFP (ORCPT ); Mon, 12 Jun 2023 09:05:15 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CF81A1; Mon, 12 Jun 2023 06:05:13 -0700 (PDT) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QfsK92KdFzLqhJ; Mon, 12 Jun 2023 21:02:05 +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.23; Mon, 12 Jun 2023 21:05:05 +0800 From: Yunsheng Lin To: , , CC: , , Yunsheng Lin , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Matthias Brugger , AngeloGioacchino Del Regno , , , Subject: [PATCH net-next v4 0/5] introduce page_pool_alloc() API Date: Mon, 12 Jun 2023 21:02:51 +0800 Message-ID: <20230612130256.4572-1-linyunsheng@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In [1] & [2], there are usecases for veth and virtio_net to use frag support in page pool to reduce memory usage, and it may request different frag size depending on the head/tail room space for xdp_frame/shinfo and mtu/packet size. When the requested frag size is large enough that a single page can not be split into more than one frag, using frag support only have performance penalty because of the extra frag count handling for frag support. So this patchset provides a page pool API for the driver to allocate memory with least memory utilization and performance penalty when it doesn't know the size of memory it need beforehand. 1. https://patchwork.kernel.org/project/netdevbpf/patch/d3ae6bd3537fbce379382ac6a42f67e22f27ece2.1683896626.git.lorenzo@kernel.org/ 2. https://patchwork.kernel.org/project/netdevbpf/patch/20230526054621.18371-3-liangchen.linux@gmail.com/ V4. Fix a typo and add a patch to update document about frag API, PAGE_POOL_DMA_USE_PP_FRAG_COUNT is not renamed yet as we may need a different thread to discuss that. V3: Incorporate changes from the disscusion with Alexander, mostly the inline wraper, PAGE_POOL_DMA_USE_PP_FRAG_COUNT change split to separate patch and comment change. V2: Add patch to remove PP_FLAG_PAGE_FRAG flags and mention virtio_net usecase in the cover letter. V1: Drop RFC tag and page_pool_frag patch. Yunsheng Lin (5): page_pool: frag API support for 32-bit arch with 64-bit DMA page_pool: unify frag_count handling in page_pool_is_last_frag() page_pool: introduce page_pool_alloc() API page_pool: remove PP_FLAG_PAGE_FRAG flag page_pool: update document about frag API Documentation/networking/page_pool.rst | 34 +++- .../net/ethernet/hisilicon/hns3/hns3_enet.c | 3 +- .../marvell/octeontx2/nic/otx2_common.c | 2 +- .../net/ethernet/mellanox/mlx5/core/en_main.c | 12 +- drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +- include/net/page_pool.h | 153 +++++++++++++----- net/core/page_pool.c | 26 ++- net/core/skbuff.c | 2 +- 8 files changed, 168 insertions(+), 66 deletions(-) -- 2.33.0