From: netdev-bot+sashiko@kernel.org
To: bjorn@kernel.org
Cc: magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
sdf@fomichev.me, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org,
alexanderduyck@fb.com, kernel-team@meta.com,
andrew+netdev@lunn.ch, hawk@kernel.org,
ilias.apalodimas@linaro.org, ast@kernel.org,
daniel@iogearbox.net, john.fastabend@gmail.com,
asml.silence@gmail.com, axboe@kernel.dk, andrii@kernel.org,
eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev,
song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org,
emil@etsalapatis.com, ihor.solodrai@linux.dev,
netdev@vger.kernel.org, bpf@vger.kernel.org,
io-uring@vger.kernel.org, almasrymina@google.com,
mike.marciniszyn@gmail.com, bestswngs@gmail.com,
razor@blackwall.org, dw@davidwei.uk,
aleksander.lobakin@intel.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, stuclar@meta.com
Subject: Re: [PATCH net-next v1 04/11] xsk: Allocate UMEM chunks through page_pool
Date: Wed, 11 Nov 2026 22:41:27 +0000 [thread overview]
Message-ID: <179443688740.2199510.18354202331310807632@kernel.org> (raw)
In-Reply-To: <20261110102039.1002605-5-bjorn@kernel.org>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The patch adds NET_IOV_XSK, a net_iov type the CPU can read:
net_iov_address() returns area->vaddr + (idx << niov_shift), and…
- [Low] The kernel-doc of __netmem_address() (include/net/netmem.h) still
describes header buffers as the standard case of always-page-backed…
--
xsk: Allocate UMEM chunks through page_pool
This patch adds an AF_XDP memory provider for page_pool. Each aligned
UMEM chunk becomes a CPU-readable net_iov of the new type NET_IOV_XSK,
and netmem_address() can now return an address for it. The provider
tracks which owner holds each chunk, and keeps chunks released by a page
pool on an internal reuse stack.
> diff --git a/include/net/netmem.h b/include/net/netmem.h
> index b986ad616334b..a3b67ef32b218 100644
> --- a/include/net/netmem.h
> +++ b/include/net/netmem.h
> @@ -69,6 +69,7 @@ DECLARE_STATIC_KEY_FALSE(page_pool_restricted);
> enum net_iov_type {
> NET_IOV_DMABUF,
> NET_IOV_IOURING,
> + NET_IOV_XSK,
> };
>
> /* A memory descriptor representing abstract networking I/O vectors.
[Severity: Low]
The struct net_iov kernel-doc just below this enum still says:
* Examples include imported dmabuf memory and imported io_uring memory. See
* net_iov_type for all the supported types. While current net_iov types are
* unreadable by the CPU, net_iov has no inherent restrictions and may be
NET_IOV_XSK is readable by the CPU. xsk_pp_create() sets
pp->area.vaddr = pool->addrs, so net_iov_address() returns
area->vaddr + (idx << niov_shift), and netmem_address() is no longer
NULL for every in-tree net_iov.
Documentation/networking/netmem.rst has the same problem. Its "Decouple
net_iov from unreadability" section still says that in-tree net_iov
implementations are unreadable by the CPU and that netmem_address()
returns NULL for them.
Should both texts be updated to list XSK UMEM as a readable net_iov
type? Neither has changed by the last commit of the series, "eth: fbnic:
Support AF_XDP page pool zero copy".
[ ... ]
> @@ -345,10 +362,16 @@ static inline void *__netmem_address(netmem_ref netmem)
> return page_address(__netmem_to_page(netmem));
> }
>
[Severity: Low]
The kernel-doc for __netmem_address() above still uses a header buffer
as its example of netmem that is always page-backed:
* Unsafe version of netmem_address(). When @netmem is always page-backed,
* e.g. when it's a header buffer, performs faster and generates smaller
* object code (no check for the LSB). When @netmem points to IOV, provokes
* undefined behaviour.
memory_provider.h says MP_CAP_READABLE providers "may back header page
pools". xsk_pp is the first provider that is both net_iov based and
MP_CAP_READABLE.
xsk_pp_init() does not reject header pools, and xsk_pp_alloc_netmems()
only hands out NET_IOV_XSK net_iovs. Later in the series, "xsk: Install
UMEM page pool providers in the core" requires the readable provider to
back the header pool.
A driver that follows this doc could call __netmem_address() on a header
buffer of an xsk_pp backed queue. Would it get a garbage pointer back?
No in-tree caller does this today; fbnic uses netmem_address(). Should
the "e.g. when it's a header buffer" wording be updated, though?
> +/**
> + * netmem_address - get the CPU address of the memory behind @netmem
> + * @netmem: netmem to get the address of
> + *
> + * Return: the address, or NULL if the CPU cannot read @netmem.
> + */
> static inline void *netmem_address(netmem_ref netmem)
> {
> if (netmem_is_net_iov(netmem))
> - return NULL;
> + return net_iov_address(netmem_to_net_iov(netmem));
>
> return __netmem_address(netmem);
> }
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261110102039.1002605-1-bjorn%40kernel.org
next prev parent reply other threads:[~2026-11-11 22:41 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 10:20 [PATCH net-next v1 00/11] xsk: Zero copy through page-pool memory providers Björn Töpel
2026-11-10 10:20 ` [PATCH net-next v1 01/11] net: Get skb fragment addresses through netmem Björn Töpel
2026-11-10 10:20 ` [PATCH net-next v1 02/11] net: Add memory provider capabilities Björn Töpel
2026-11-10 22:19 ` Stanislav Fomichev
2026-11-11 12:41 ` Björn Töpel
2026-11-11 23:01 ` Stanislav Fomichev
2026-11-11 22:41 ` netdev-bot+sashiko
2026-11-10 10:20 ` [PATCH net-next v1 03/11] xdp: Copy buffers with restricted lifetime Björn Töpel
2026-11-10 22:32 ` Stanislav Fomichev
2026-11-11 13:27 ` Björn Töpel
2026-11-11 23:05 ` Stanislav Fomichev
2026-11-11 22:41 ` netdev-bot+sashiko
2026-11-10 10:20 ` [PATCH net-next v1 04/11] xsk: Allocate UMEM chunks through page_pool Björn Töpel
2026-11-10 15:08 ` Magnus Karlsson
2026-11-11 13:51 ` Björn Töpel
2026-11-10 23:02 ` Stanislav Fomichev
2026-11-11 13:59 ` Björn Töpel
2026-11-11 23:09 ` Stanislav Fomichev
2026-11-11 22:41 ` netdev-bot+sashiko [this message]
2026-11-10 10:20 ` [PATCH net-next v1 05/11] xsk: Install UMEM page pool providers in the core Björn Töpel
2026-11-10 23:50 ` Stanislav Fomichev
2026-11-11 14:01 ` Björn Töpel
2026-11-11 8:59 ` Magnus Karlsson
2026-11-11 19:26 ` Björn Töpel
2026-11-11 22:41 ` netdev-bot+sashiko
2026-11-10 10:20 ` [PATCH net-next v1 06/11] page_pool: Coordinate refill with memory providers Björn Töpel
2026-11-10 23:51 ` Stanislav Fomichev
2026-11-11 19:37 ` Björn Töpel
2026-11-11 23:13 ` Stanislav Fomichev
2026-11-11 22:41 ` netdev-bot+sashiko
2026-11-10 10:20 ` [PATCH net-next v1 07/11] xsk: Deliver provider chunks without copying Björn Töpel
2026-11-11 22:41 ` netdev-bot+sashiko
2026-11-11 23:20 ` Stanislav Fomichev
2026-11-10 10:20 ` [PATCH net-next v1 08/11] eth: fbnic: Support XDP redirect Björn Töpel
2026-11-10 10:20 ` [PATCH net-next v1 09/11] eth: fbnic: Use netmem for RX headers and XDP_TX Björn Töpel
2026-11-10 10:20 ` [PATCH net-next v1 10/11] eth: fbnic: Support RX buffers it cannot split Björn Töpel
2026-11-11 21:45 ` Dimitri Daskalakis
2026-11-11 22:41 ` netdev-bot+sashiko
2026-11-10 10:20 ` [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy Björn Töpel
2026-11-11 22:41 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179443688740.2199510.18354202331310807632@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=alexanderduyck@fb.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrii@kernel.org \
--cc=asml.silence@gmail.com \
--cc=ast@kernel.org \
--cc=axboe@kernel.dk \
--cc=bestswngs@gmail.com \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=eddyz87@gmail.com \
--cc=edumazet@kernel.org \
--cc=emil@etsalapatis.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=ihor.solodrai@linux.dev \
--cc=ilias.apalodimas@linaro.org \
--cc=io-uring@vger.kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=mike.marciniszyn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=rdunlap@infradead.org \
--cc=sdf@fomichev.me \
--cc=skhan@linuxfoundation.org \
--cc=song@kernel.org \
--cc=stuclar@meta.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®