All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v8 0/5] page_pool: recycle buffers
@ 2021-06-07 19:02 Matteo Croce
  2021-06-07 19:02 ` [PATCH net-next v8 1/5] mm: add a signature in struct page Matteo Croce
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Matteo Croce @ 2021-06-07 19:02 UTC (permalink / raw)
  To: netdev, linux-mm
  Cc: Ayush Sawal, Vinay Kumar Yadav, Rohit Maheshwari,
	David S. Miller, Jakub Kicinski, Thomas Petazzoni, Marcin Wojtas,
	Russell King, Mirko Lindner, Stephen Hemminger, Tariq Toukan,
	Jesper Dangaard Brouer, Ilias Apalodimas, Alexei Starovoitov,
	Daniel Borkmann, John Fastabend, Boris Pismenny, Arnd Bergmann,
	Andrew Morton, Peter Zijlstra (Intel),
	Vlastimil Babka, Yu Zhao, Will Deacon, Fenghua Yu,
	Roman Gushchin, Hugh Dickins, Peter Xu, Jason Gunthorpe,
	Jonathan Lemon, Alexander Lobakin, Cong Wang, wenxu, Kevin Hao,
	Jakub Sitnicki, Marco Elver, Willem de Bruijn, Miaohe Lin,
	Yunsheng Lin, Guillaume Nault, linux-kernel, linux-rdma, bpf,
	Matthew Wilcox, Eric Dumazet, David Ahern, Lorenzo Bianconi,
	Saeed Mahameed, Andrew Lunn, Paolo Abeni, Sven Auhagen,
	Yonghong Song, Michel Lespinasse, KP Singh, Andrii Nakryiko,
	Martin KaFai Lau, David Hildenbrand, Song Liu

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.

v7 -> v8:
- use page->lru.next instead of page->index for pfmemalloc
- remove conditional include
- rework page_pool_return_skb_page() so to have less conversions
  between page and addresses, and call compound_head() only once
- move some code from skb_free_head() to a new helper skb_pp_recycle()
- misc fixes

v6 -> v7:
- refresh patches against net-next
- remove a redundant call to virt_to_head_page()
- update mvneta benchmarks

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/

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                            | 11 +++---
 include/linux/mm_types.h                      |  7 ++++
 include/linux/poison.h                        |  3 ++
 include/linux/skbuff.h                        | 39 ++++++++++++++++---
 include/net/page_pool.h                       |  9 +++++
 net/core/page_pool.c                          | 28 +++++++++++++
 net/core/skbuff.c                             | 20 ++++++++--
 net/tls/tls_device.c                          |  2 +-
 12 files changed, 114 insertions(+), 22 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH net-next v8 3/5] page_pool: Allow drivers to hint on SKB recycling
@ 2021-06-08  2:12 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-06-08  2:12 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3987 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210607190240.36900-4-mcroce@linux.microsoft.com>
References: <20210607190240.36900-4-mcroce@linux.microsoft.com>
TO: Matteo Croce <mcroce@linux.microsoft.com>
TO: netdev(a)vger.kernel.org
TO: linux-mm(a)kvack.org
CC: Ayush Sawal <ayush.sawal@chelsio.com>
CC: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
CC: Rohit Maheshwari <rohitm@chelsio.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
CC: Marcin Wojtas <mw@semihalf.com>
CC: Russell King <linux@armlinux.org.uk>
CC: Mirko Lindner <mlindner@marvell.com>

Hi Matteo,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Matteo-Croce/page_pool-recycle-buffers/20210608-030512
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 1a42624aecba438f1d114430a14b640cdfa51c87
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: x86_64-randconfig-b001-20210607 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project ae973380c5f6be77ce395022be40350942260be9)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # apt-get install iwyu # include-what-you-use
        # https://github.com/0day-ci/linux/commit/95da7ab53bd3ac29bee6be7c89fda1f7c506a182
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Matteo-Croce/page_pool-recycle-buffers/20210608-030512
        git checkout 95da7ab53bd3ac29bee6be7c89fda1f7c506a182
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross C=1 CHECK=iwyu ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


iwyu warnings: (new ones prefixed by >>)
   net/core/skbuff.c:77:1: iwyu: warning: superfluous #include <linux/highmem.h>
   net/core/skbuff.c:43:1: iwyu: warning: superfluous #include <linux/inet.h>
   net/core/skbuff.c:41:1: iwyu: warning: superfluous #include <linux/interrupt.h>
   net/core/skbuff.c:37:1: iwyu: warning: superfluous #include <linux/module.h>
   net/core/skbuff.c:60:1: iwyu: warning: superfluous #include <linux/prefetch.h>
   net/core/skbuff.c:56:1: iwyu: warning: superfluous #include <linux/rtnetlink.h>
   net/core/skbuff.c:52:1: iwyu: warning: superfluous #include <linux/string.h>
   net/core/skbuff.c:75:1: iwyu: warning: superfluous #include <linux/uaccess.h>
   net/core/skbuff.c:69:1: iwyu: warning: superfluous #include <net/ip6_checksum.h>
>> net/core/skbuff.c:73:1: iwyu: warning: superfluous #include <net/page_pool.h>
   net/core/skbuff.c:65:1: iwyu: warning: superfluous #include <net/protocol.h>

vim +73 net/core/skbuff.c

^1da177e4c3f41 Linus Torvalds   2005-04-16  64  
^1da177e4c3f41 Linus Torvalds   2005-04-16  65  #include <net/protocol.h>
^1da177e4c3f41 Linus Torvalds   2005-04-16  66  #include <net/dst.h>
^1da177e4c3f41 Linus Torvalds   2005-04-16  67  #include <net/sock.h>
^1da177e4c3f41 Linus Torvalds   2005-04-16  68  #include <net/checksum.h>
ed1f50c3a7c1ad Paul Durrant     2014-01-09  69  #include <net/ip6_checksum.h>
^1da177e4c3f41 Linus Torvalds   2005-04-16  70  #include <net/xfrm.h>
8822e270d69701 John Hurley      2019-07-07  71  #include <net/mpls.h>
3ee17bc78e0f3f Mat Martineau    2020-01-09  72  #include <net/mptcp.h>
95da7ab53bd3ac Ilias Apalodimas 2021-06-07 @73  #include <net/page_pool.h>
^1da177e4c3f41 Linus Torvalds   2005-04-16  74  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33029 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-06-08  3:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 19:02 [PATCH net-next v8 0/5] page_pool: recycle buffers Matteo Croce
2021-06-07 19:02 ` [PATCH net-next v8 1/5] mm: add a signature in struct page Matteo Croce
2021-06-07 19:02 ` [PATCH net-next v8 2/5] skbuff: add a parameter to __skb_frag_unref Matteo Croce
2021-06-07 19:02 ` [PATCH net-next v8 3/5] page_pool: Allow drivers to hint on SKB recycling Matteo Croce
2021-06-08  3:19   ` kernel test robot
2021-06-08  3:19     ` kernel test robot
2021-06-07 19:02 ` [PATCH net-next v8 4/5] mvpp2: recycle buffers Matteo Croce
2021-06-07 19:02 ` [PATCH net-next v8 5/5] mvneta: " Matteo Croce
2021-06-07 21:40 ` [PATCH net-next v8 0/5] page_pool: " patchwork-bot+netdevbpf
2021-06-08  2:12 [PATCH net-next v8 3/5] page_pool: Allow drivers to hint on SKB recycling kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.