Re: [PATCH net-next v1 1/2] net: netmem: document netmem and memory provider design in comments
From: Jesper Dangaard Brouer
Date: Wed Oct 07 2026 - 03:48:20 EST
On 10/5/26 02:49, Mina Almasry wrote:
Clarify the netmem, memory provider, page_pool, and skb fragment design
principles in header and code comments:
- Memory providers allocate struct net_iov or struct page, cast them to
netmem_ref, and pass them to page_pool; page_pool, drivers, and the
core stack operate on netmem_ref and must not downcast to page or
net_iov outside dedicated netmem helpers.
- Memory providers are not restricted to net_iov and may supply
page-backed netmems.
- net_iov is not inherently unreadable; future readable net_iov types
are allowed.
- Per-provider logic belongs in memory_provider_ops, and per-netmem-type
logic belongs in netmem helpers.
- All frags in an skb must share the same backing netmem memory type,
and skbs with different frag memory types must not be coalesced.
Cc: Luigi Rizzo <lrizzo@xxxxxxxxxx>
Cc: Björn Töpel <bjorn@xxxxxxxxxx>
Cc: Stanislav Fomichev <sdf@xxxxxxxxxxx>
Cc: Pavel Begunkov <asml.silence@xxxxxxxxx>
Signed-off-by: Mina Almasry <almasrymina@xxxxxxxxxx>
---
include/linux/skbuff.h | 4 ++++
include/net/netmem.h | 29 ++++++++++++++++---------
./scripts/get_maintainer.pl --file include/net/netmem.h
Returns "maintainer:NETWORKING [GENERAL]"
include/net/page_pool/helpers.h | 18 ++++++++++-----
include/net/page_pool/memory_provider.h | 8 +++++++
include/net/page_pool/types.h | 6 ++---
net/core/skbuff.c | 3 +++
6 files changed, 50 insertions(+), 18 deletions(-)
Changes LGTM.
I suggest that you Mina is added the MAINTAINERS for PAGE POOL.
And do we want a new section for NETMEM ?
Acked-by: Jesper Dangaard Brouer <hawk@xxxxxxxxxx>