Message ID | 20210521161527.34607-1-mcroce@linux.microsoft.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <SRS0=us07=KQ=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8FE4C47078 for <linux-mm@archiver.kernel.org>; Fri, 21 May 2021 16:15:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 738A2613E2 for <linux-mm@archiver.kernel.org>; Fri, 21 May 2021 16:15:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 738A2613E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D34308E0022; Fri, 21 May 2021 12:15:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBDAF6B0141; Fri, 21 May 2021 12:15:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE8F18E0022; Fri, 21 May 2021 12:15:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0231.hostedemail.com [216.40.44.231]) by kanga.kvack.org (Postfix) with ESMTP id 73BE76B0140 for <linux-mm@kvack.org>; Fri, 21 May 2021 12:15:37 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E8584182056E0 for <linux-mm@kvack.org>; Fri, 21 May 2021 16:15:36 +0000 (UTC) X-FDA: 78165738672.25.A677CD7 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by imf15.hostedemail.com (Postfix) with ESMTP id 8463FA0001D6 for <linux-mm@kvack.org>; Fri, 21 May 2021 16:15:34 +0000 (UTC) Received: by mail-ed1-f46.google.com with SMTP id b17so23954544ede.0 for <linux-mm@kvack.org>; Fri, 21 May 2021 09:15:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kXlRaBMJoWOhAWHALOYN55NWGuEBwklQq4V7CKcJSkA=; b=WjYDm9/euX9qtYyf7LneY2dGfzRS1EFXeoWNWy1N0gJ/IgSx7sf8BGH9DkaiO7hPyR c1Rsksd+fwP/89gr9Rzb/BBfb6wSPxDxOU+PJolEapmjH2MhVvsVk4iBMw2uODNfewFo vatO6dWA1g7Ssvqp1E0S3e76JAXpqv4GP8/cmswm+pL3rRguzvLzrKOdpMq+MBH6K4IB B31l0xFtUDxwNDu1Xgfwxnuo6OiPgl5ZPVZamMLtjpuVEwOF5K/W0hbDBylR9JCeSKXR TqbammONUPBxjROjbpYP1Jh2IgHM0qjEOm7aJM1GgV4WtgIiDCT7TaLmGnEYZ/R3hUvJ +cYg== X-Gm-Message-State: AOAM530GCvg8zjlz8zWRGMOYedrUNy5EUfFxStv5nF6L6DOL/RB4tQTP Go60nu4T1BLNSlF6Mz8ESd8= X-Google-Smtp-Source: ABdhPJwj4cSc9QZl/beB2hgQ9AcqcPq/X5efuEiyVneN+LuPycp9x16/jNvla0FZjjMcKfQZWZYRSw== X-Received: by 2002:aa7:cd6b:: with SMTP id ca11mr12064239edb.115.1621613735185; Fri, 21 May 2021 09:15:35 -0700 (PDT) Received: from msft-t490s.teknoraver.net (net-5-94-253-60.cust.vodafonedsl.it. [5.94.253.60]) by smtp.gmail.com with ESMTPSA id f7sm3871644ejz.95.2021.05.21.09.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 09:15:34 -0700 (PDT) From: Matteo Croce <mcroce@linux.microsoft.com> To: netdev@vger.kernel.org, linux-mm@kvack.org Cc: Ayush Sawal <ayush.sawal@chelsio.com>, Vinay Kumar Yadav <vinay.yadav@chelsio.com>, Rohit Maheshwari <rohitm@chelsio.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Marcin Wojtas <mw@semihalf.com>, Russell King <linux@armlinux.org.uk>, Mirko Lindner <mlindner@marvell.com>, Stephen Hemminger <stephen@networkplumber.org>, Tariq Toukan <tariqt@nvidia.com>, Jesper Dangaard Brouer <hawk@kernel.org>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, John Fastabend <john.fastabend@gmail.com>, Boris Pismenny <borisp@nvidia.com>, Arnd Bergmann <arnd@arndb.de>, Andrew Morton <akpm@linux-foundation.org>, "Peter Zijlstra (Intel)" <peterz@infradead.org>, Vlastimil Babka <vbabka@suse.cz>, Yu Zhao <yuzhao@google.com>, Will Deacon <will@kernel.org>, Fenghua Yu <fenghua.yu@intel.com>, Roman Gushchin <guro@fb.com>, Hugh Dickins <hughd@google.com>, Peter Xu <peterx@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>, Jonathan Lemon <jonathan.lemon@gmail.com>, Alexander Lobakin <alobakin@pm.me>, Cong Wang <cong.wang@bytedance.com>, wenxu <wenxu@ucloud.cn>, Kevin Hao <haokexin@gmail.com>, Jakub Sitnicki <jakub@cloudflare.com>, Marco Elver <elver@google.com>, Willem de Bruijn <willemb@google.com>, Miaohe Lin <linmiaohe@huawei.com>, Yunsheng Lin <linyunsheng@huawei.com>, Guillaume Nault <gnault@redhat.com>, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, bpf@vger.kernel.org, Matthew Wilcox <willy@infradead.org>, Eric Dumazet <edumazet@google.com>, David Ahern <dsahern@gmail.com>, Lorenzo Bianconi <lorenzo@kernel.org>, Saeed Mahameed <saeedm@nvidia.com>, Andrew Lunn <andrew@lunn.ch>, Paolo Abeni <pabeni@redhat.com>, Sven Auhagen <sven.auhagen@voleatech.de> Subject: [PATCH net-next v6 0/5] page_pool: recycle buffers Date: Fri, 21 May 2021 18:15:22 +0200 Message-Id: <20210521161527.34607-1-mcroce@linux.microsoft.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=linux.microsoft.com (policy=none); spf=pass (imf15.hostedemail.com: domain of technoboy85@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=technoboy85@gmail.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 8463FA0001D6 X-Stat-Signature: h9b9dtzjzwrqpsefrxwwjgxzcoji5wa1 X-HE-Tag: 1621613734-414408 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
page_pool: recycle buffers
|
expand
|
On Fri, May 21, 2021 at 6:15 PM Matteo Croce <mcroce@linux.microsoft.com> wrote: > Note that this series depends on the change "mm: fix struct page layout > on 32-bit systems"[2] which is not yet in master. > I see that it just entered net-next: commit 9ddb3c14afba8bc5950ed297f02d4ae05ff35cd1 Author: Matthew Wilcox (Oracle) <willy@infradead.org> Date: Fri May 14 17:27:24 2021 -0700 mm: fix struct page layout on 32-bit systems Regards,
From: Matteo Croce <mcroce@microsoft.com> This is a respin of [1] This patchset shows the plans for allowing page_pool to handle and maintain DMA map/unmap of the pages it serves to the driver. For this to work a return hook in the network core is introduced. The overall purpose is to simplify drivers, by providing a page allocation API that does recycling, such that each driver doesn't have to reinvent its own recycling scheme. Using page_pool in a driver does not require implementing XDP support, but it makes it trivially easy to do so. Instead of allocating buffers specifically for SKBs we now allocate a generic buffer and either wrap it on an SKB (via build_skb) or create an XDP frame. The recycling code leverages the XDP recycle APIs. The Marvell mvpp2 and mvneta drivers are used in this patchset to demonstrate how to use the API, and tested on a MacchiatoBIN and EspressoBIN boards respectively. Please let this going in on a future -rc1 so to allow enough time to have wider tests. Note that this series depends on the change "mm: fix struct page layout on 32-bit systems"[2] which is not yet in master. v5 -> v6 - preserve pfmemalloc bit when setting signature - fix typo in mvneta - rebase on next-next with the new cache - don't clear the skb->pp_recycle in pskb_expand_head() v4 -> v5: - move the signature so it doesn't alias with page->mapping - use an invalid pointer as magic - incorporate Matthew Wilcox's changes for pfmemalloc pages - move the __skb_frag_unref() changes to a preliminary patch - refactor some cpp directives - only attempt recycling if skb->head_frag - clear skb->pp_recycle in pskb_expand_head() v3 -> v4: - store a pointer to page_pool instead of xdp_mem_info - drop a patch which reduces xdp_mem_info size - do the recycling in the page_pool code instead of xdp_return - remove some unused headers include - remove some useless forward declaration v2 -> v3: - added missing SOBs - CCed the MM people v1 -> v2: - fix a commit message - avoid setting pp_recycle multiple times on mvneta - squash two patches to avoid breaking bisect [1] https://lore.kernel.org/netdev/154413868810.21735.572808840657728172.stgit@firesoul/ [2] https://lore.kernel.org/linux-mm/20210510153211.1504886-1-willy@infradead.org/ Ilias Apalodimas (1): page_pool: Allow drivers to hint on SKB recycling Matteo Croce (4): mm: add a signature in struct page skbuff: add a parameter to __skb_frag_unref mvpp2: recycle buffers mvneta: recycle buffers drivers/net/ethernet/marvell/mvneta.c | 11 +++--- .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 +- drivers/net/ethernet/marvell/sky2.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 2 +- include/linux/mm.h | 12 ++++--- include/linux/mm_types.h | 12 ++++++- include/linux/poison.h | 3 ++ include/linux/skbuff.h | 34 ++++++++++++++++--- include/net/page_pool.h | 9 +++++ net/core/page_pool.c | 29 ++++++++++++++++ net/core/skbuff.c | 24 ++++++++++--- net/tls/tls_device.c | 2 +- 12 files changed, 119 insertions(+), 23 deletions(-)