Skip to content

RFC nmdesc cleanups and optimisations

Pavel Begunkov netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6net: move pp_page_to_nmdesc()include/net/netmem.h+17 -171 reply
2/6net: replace __netmem_clear_lsb() with netmem_to_nmdesc()include/net/netmem.h net/core/netmem_priv.h+27 -260 replies
3/6net: page_pool: remove page_pool_set_dma_addr()net/core/page_pool_priv.h+0 -51 reply
4/6net: convert page pool dma helpers to netmem_descinclude/net/netmem.h include/net/page_pool/helpers.h net/core/netmem_priv.h +1 more+15 -172 replies
5/6net: page_pool: convert refcounting helpers to nmdescinclude/net/netmem.h include/net/page_pool/helpers.h net/core/devmem.c+22 -174 replies
6/6io_uring/zcrx: avoid netmem casts with nmdescio_uring/zcrx.c+5 -71 reply

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchMina Almasry
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC net-next v1 0/6] nmdesc cleanups and optimisations

This series uses newly introduced struct netmem_desc, which represents common fields b/w netmem types, for optimisations and to start addressing some of the netmem technical debt.

First, replace __netmem_clear_lsb with netmem_to_nmdesc(). The helper optimises pp fields accesses, but now we can do the same but cleaner.

The second problem is abundance of places where the user has struct page / net_iov but still needs to cast it to netmem back and forth just to be able to use generic helpers. It's not the prettiest pattern and often can't be optimised. Start introducing netmem_desc based helpers and using them instead.

There is more work we can do, but these are the patches I want to pull into zcrx. It's an RFC for now, I'll send it as a pull request without zcrx bits.

Byungchul Park (1):
net: replace __netmem_clear_lsb() with netmem_to_nmdesc()

Pavel Begunkov (5):
net: move pp_page_to_nmdesc()
net: page_pool: remove page_pool_set_dma_addr()
net: convert page pool dma helpers to netmem_desc
net: page_pool: convert refcounting helpers to nmdesc io_uring/zcrx: avoid netmem casts with nmdesc

 include/net/netmem.h            | 75 +++++++++++++++------------------
 include/net/page_pool/helpers.h | 41 ++++++++++++++----
 io_uring/zcrx.c                 | 12 +++---
 net/core/devmem.c               |  5 ---
 net/core/netmem_priv.h          | 20 +++------
 net/core/page_pool_priv.h       | 14 +++---
 6 files changed, 82 insertions(+), 85 deletions(-)
Signature · 1 line
2.49.0