Thread View: linux.kernel.netdev
80 messages
80 total messages
Page 2 of 2
Started by Björn Töpel
Tue, 10 Nov 2026 10:20
Page 2 of 2 • 80 total messages
Re: [PATCH net-next v1 07/11] xsk: Deliver provider chunks without copying
Author: Björn Töpel
Date: Thu, 12 Nov 2026 19:57
Date: Thu, 12 Nov 2026 19:57
82 lines
12575 bytes
12575 bytes
Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
> On Tue, Nov 10, 2026 at 11:20:28AM +0100, Björn Töpel wrote:
>> A provider socket still receives through the copy path, which takes
>> FILL entries without the provider's ownership checks: a chunk that a
>> page pool holds could be handed out twice. No driver opts in yet.
>>
>> Put packets whose buffers all belong to the socket's provider on the
>> RX ring as they are, and copy others into chunks the provider claims.
>> Only the queue NAPI may produce to such a socket, so generic XDP and
>> CPUMAP redirects to it are dropped.
>>
>> A device may place payload at chunk offset 0, as fbnic does, so only
>> the first buffer of a packet keeps the UMEM headroom. Such buffers may
>> be sent back as they are, so only descriptors with XDP_TX_METADATA
>> need room for TX metadata in front.
>>
>> Signed-off-by: Björn Töpel <bjorn@kernel.org>
>> ---
>> Documentation/networking/af_xdp.rst | 6 +-
>> Documentation/networking/xsk-tx-metadata.rst | 3 +-
>> include/net/page_pool/memory_provider.h | 2 +
>> net/core/page_pool.c | 34 +++-
>> net/xdp/xsk.c | 82 ++++++++-
>> net/xdp/xsk.h | 5 +
>> net/xdp/xsk_pp.c | 165 +++++++++++++++++++
>> net/xdp/xsk_queue.h | 18 +-
>> 8 files changed, 304 insertions(+), 11 deletions(-)
>>
>
> (...)
>
>> +
>> static int xsk_pp_nl_fill(void *mp_priv, struct sk_buff *rsp,
>> struct netdev_rx_queue *rxq)
>> {
>> diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
>> index 1bc42c8902f4..b9464b917a88 100644
>> --- a/net/xdp/xsk_queue.h
>> +++ b/net/xdp/xsk_queue.h
>> @@ -156,17 +156,24 @@ static inline bool xp_unused_options_set(u32 options)
>> return options & ~(XDP_PKT_CONTD | XDP_TX_METADATA);
>> }
>>
>> +static inline u32 xp_desc_meta_len(struct xsk_buff_pool *pool,
>> + struct xdp_desc *desc)
>> +{
>> + return desc->options & XDP_TX_METADATA ? pool->tx_metadata_len : 0;
>
> How is it related to this patch? I know I trimmed, but I didn't see any
> references above to tx_metadata_len, only some documentation bump.
Provider frags start at chunk offset 0, and an application may send them
back as they are. TX validation wants tx_metadata_len in front of every
descriptor once the UMEM has it, so such a descriptor fails, though only
XDP_TX_METADATA descriptors use that room. Driver ZC never puts RX data
below offset 256, so it never came up. It stands on its own; I'll make
it a separate patch.
> Besides, the amount of branches introduced to existing hot path is
> worrying. On next revision, could you provide numbers from xdpsock before
> and after this set run on existing zc driver?
(FWIW, I've left a all my performance patches out, to keep the size of
set down.)
Will do, but the only one I got is mlx5. Would be awesome if you or
Magnus could take it for a spin on Intel NICs.
Single-buffer RX on driver ZC gets no new per-packet branch: xsk_rcv()
leaves through xsk_rcv_zc() first. The rest is one test per flush, one
XDP_TX_METADATA test per TX descriptor, and a flag test in the
multi-buffer and XDP_PASS/redirect helpers. v2 also moves pool->pp next
to fq, which the flush reads anyway, and drops the frag walk in
xdp_buff_needs_copy(), as agreed with Stan.
Anything specific, or just in general?
Björn
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Björn Töpel
Date: Thu, 12 Nov 2026 20:03
Date: Thu, 12 Nov 2026 20:03
51 lines
11349 bytes
11349 bytes
Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
> On Tue, Nov 10, 2026 at 11:20:32AM +0100, Björn Töpel wrote:
>> @@ -538,6 +547,13 @@ static int fbnic_bpf(struct net_device *netdev, struct netdev_bpf *bpf)
>> {
>> struct bpf_prog *prog = bpf->prog, *prev_prog;
>> struct fbnic_net *fbn = netdev_priv(netdev);
>> + const struct xsk_rx_check *check;
>> +
>> + if (bpf->command == XDP_VALIDATE_XSK_POOL) {
>
> do you really need a separate command here? why not rely on existing
> XDP_SETUP_XSK_POOL ?
>
> here it doesn't look like things being validated are something unique that
> you could not check during XDP_SETUP_XSK_POOL and XDP_SETUP_PROG.
I'd like to keep it. XDP_SETUP_XSK_POOL means "set up driver ZC for this
pool": the driver maps the UMEM and restarts its queue, and the core
WARNs if it didn't map. A provider driver does neither; it only says yes
or no, before the core maps and installs anything. The same question
comes up on MTU and program changes of a bound device, with the new MTU
or program, which XDP_SETUP_XSK_POOL can't carry. One command keeps that
in one place, and v2 runs it from the core MTU path too, so a driver
can't forget that case. This is only a burden for the core.
> Overall, +400 lines for zc pp-based support...not sure what I was
> expecting and I know we need Tx side implementation.
fbnic had no AF_XDP at all. Of patch 11, about 120 lines are TX and 58
are docs; the rest is RX setup, refill and the checks. 08-10 add XDP
redirect, netmem heads and whole buffers to fbnic, which aren't
ZC-specific.
> However, I am wondering if better example for this change set would be the
> driver that already supports pp *and* carries the separate ZC data path
> (ekhm, see ice?). Then you could show case at least in diffstat how much
> less work is needed for AF_XDP support.
ice RX is on page pool through libeth, but ice has no queue API, and
libeth can't select a provider yet; that's also why ice can't do devmem
or io_uring zcrx. The provider has no unaligned mode either, which ice
supports. mlx5 or gve already have page pool RX, the queue API and their
own ZC path, so one of those would show the deletion with less
groundwork. I can do that as a follow-up.
Björn
Re: [PATCH net-next v1 02/11] net: Add memory provider capabilities
Author: Stanislav Fomichev
Date: Fri, 13 Nov 2026 00:21
Date: Fri, 13 Nov 2026 00:21
47 lines
14582 bytes
14582 bytes
On 11/12, Björn Töpel wrote: > Stanislav Fomichev <sdf.kernel@gmail.com> writes: > > > On 11/11, Björn Töpel wrote: > >> Stanislav Fomichev <sdf.kernel@gmail.com> writes: > >> > On 11/10, Björn Töpel wrote: > > >> >> + if (static_branch_unlikely(&page_pool_mem_providers) && > >> >> + WARN_ON_ONCE(!page_pool_supports_frag(pool))) > >> >> + return 0; > >> >> if (WARN_ON(size > max_size)) > >> >> return 0; > >> >> > >> > > >> > What's the deal with that? How do we get here? > >> > >> Hey! Thanks for taking a look at the series! > >> > >> An explicit frag call on a whole-buffer provider is a driver bug: UMEM > >> chunks can be smaller than a page, and RX gives the whole chunk to > >> userspace. > >> > >> But page_pool_alloc_netmem() also picks frags for small requests, so a > >> valid call can warn. > >> > >> I think it would be better to make it return a whole buffer and its > >> actual size. The WARN stays in the frag API, before taking a new buffer? > >> Wdyt? > > > > I see.. Idk, I'd still return 0 here, but without a warn. Not sure > > we want a warn for any api misuse? Returning no netmem is gonna be enough > > to debug things? As for the calls from page_pool_alloc_netmem, I'd also > > handle it explicitly? if (size > max_size || !page_pool_supports_frag) ? > > But no strong preference, up to you, was mostly trying to understand > > what we are warning against here :-) > > Yes, page_pool_alloc_netmem() gets the explicit check. Thanks! > > For the frag API I'd keep a WARN_ON_ONCE, like the size check right > below it. A silent 0 looks like an empty provider: the queue just > stalls, and nothing points at the driver. With the helper fixed, only an > explicit frag call on such a pool gets there... Wdyt? I'll probably take > that route for v2. I guess, yeah, makes sense, let's return full size and warn. Maybe also a short comment will help to explain why?
Re: [PATCH net-next v1 01/11] net: Get skb fragment addresses through netmem
Author: Björn Töpel
Date: Fri, 13 Nov 2026 09:08
Date: Fri, 13 Nov 2026 09:08
30 lines
10292 bytes
10292 bytes
Mina Almasry <almasrymina@google.com> writes: > On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote: >> >> skb_frag_address() goes through struct page, so a net_iov never has an >> address. Only unreadable memory should lack one: XDP and BPF read >> fragments through this helper, and AF_XDP UMEM will back readable >> net_iovs. netmem_address() also returns NULL, not a bogus pointer, for >> an unmapped highmem page. >> >> Generic code needs the size of a net_iov to find its address, so keep >> it in struct net_iov_area instead of the devmem binding. >> >> Suggested-by: Mina Almasry <almasrymina@google.com> >> Suggested-by: Stanislav Fomichev <sdf@fomichev.me> >> Signed-off-by: Björn Töpel <bjorn@kernel.org> > > Are the changes for niov_shift some kind of rebase error? I don't see > how they're related. Otherwise changes LGTM. Not a rebase error, but it's early. Nothing here reads it. The generic code that needs it is net_iov_address() in patch 4; in this patch netmem_address() still returns NULL for every net_iov. I'll move it to patch 4. Björn
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Björn Töpel
Date: Fri, 13 Nov 2026 11:40
Date: Fri, 13 Nov 2026 11:40
51 lines
11385 bytes
11385 bytes
Björn Töpel <bjorn@kernel.org> writes:
> Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
>
>> On Tue, Nov 10, 2026 at 11:20:32AM +0100, Björn Töpel wrote:
>
>>> @@ -538,6 +547,13 @@ static int fbnic_bpf(struct net_device *netdev, struct netdev_bpf *bpf)
>>> {
>>> struct bpf_prog *prog = bpf->prog, *prev_prog;
>>> struct fbnic_net *fbn = netdev_priv(netdev);
>>> + const struct xsk_rx_check *check;
>>> +
>>> + if (bpf->command == XDP_VALIDATE_XSK_POOL) {
>>
>> do you really need a separate command here? why not rely on existing
>> XDP_SETUP_XSK_POOL ?
>>
>> here it doesn't look like things being validated are something unique that
>> you could not check during XDP_SETUP_XSK_POOL and XDP_SETUP_PROG.
>
> I'd like to keep it. XDP_SETUP_XSK_POOL means "set up driver ZC for this
> pool": the driver maps the UMEM and restarts its queue, and the core
> WARNs if it didn't map. A provider driver does neither; it only says yes
> or no, before the core maps and installs anything. The same question
> comes up on MTU and program changes of a bound device, with the new MTU
> or program, which XDP_SETUP_XSK_POOL can't carry. One command keeps that
> in one place, and v2 runs it from the core MTU path too, so a driver
> can't forget that case. This is only a burden for the core.
Thinking more about it, maybe I can drop the callback altogether, by
doing what devmem, io_uring zcrx and tcp-data-split already do: the core
refuses a setup that can't work, instead of asking the driver.
The driver only judges the chunk size and headroom, in
ndo_validate_qcfg, which the queue API already calls when it installs
the provider, with a new bit saying the buffers can't be split. A frame
of up to the chunk size (minus headroom), then lands in one buffer, so
the core checks the MTU itself, at bind and on MTU changes. And like
tcp-data-split, a socket bound with XDP_USE_SG needs a frags XDP
program: attaching a single-buffer program fails while one is bound, and
the bind fails while one is attached.
That drops XDP_VALIDATE_XSK_POOL and struct xsk_rx_check, and fbnic's
MTU and program hooks with them. Not fully cooked in my head, but maybe?
Wdyt?
Björn
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Maciej Fijalkowski
Date: Fri, 13 Nov 2026 16:28
Date: Fri, 13 Nov 2026 16:28
56 lines
21400 bytes
21400 bytes
On Fri, Nov 13, 2026 at 12:40:09PM +0100, Björn Töpel wrote:
> Björn Töpel <bjorn@kernel.org> writes:
>
> > Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
> >
> >> On Tue, Nov 10, 2026 at 11:20:32AM +0100, Björn Töpel wrote:
> >
> >>> @@ -538,6 +547,13 @@ static int fbnic_bpf(struct net_device *netdev, struct netdev_bpf *bpf)
> >>> {
> >>> struct bpf_prog *prog = bpf->prog, *prev_prog;
> >>> struct fbnic_net *fbn = netdev_priv(netdev);
> >>> + const struct xsk_rx_check *check;
> >>> +
> >>> + if (bpf->command == XDP_VALIDATE_XSK_POOL) {
> >>
> >> do you really need a separate command here? why not rely on existing
> >> XDP_SETUP_XSK_POOL ?
> >>
> >> here it doesn't look like things being validated are something unique that
> >> you could not check during XDP_SETUP_XSK_POOL and XDP_SETUP_PROG.
> >
> > I'd like to keep it. XDP_SETUP_XSK_POOL means "set up driver ZC for this
> > pool": the driver maps the UMEM and restarts its queue, and the core
> > WARNs if it didn't map. A provider driver does neither; it only says yes
> > or no, before the core maps and installs anything. The same question
> > comes up on MTU and program changes of a bound device, with the new MTU
> > or program, which XDP_SETUP_XSK_POOL can't carry. One command keeps that
> > in one place, and v2 runs it from the core MTU path too, so a driver
> > can't forget that case. This is only a burden for the core.
>
> Thinking more about it, maybe I can drop the callback altogether, by
> doing what devmem, io_uring zcrx and tcp-data-split already do: the core
> refuses a setup that can't work, instead of asking the driver.
>
> The driver only judges the chunk size and headroom, in
> ndo_validate_qcfg, which the queue API already calls when it installs
> the provider, with a new bit saying the buffers can't be split. A frame
> of up to the chunk size (minus headroom), then lands in one buffer, so
> the core checks the MTU itself, at bind and on MTU changes. And like
> tcp-data-split, a socket bound with XDP_USE_SG needs a frags XDP
> program: attaching a single-buffer program fails while one is bound, and
> the bind fails while one is attached.
>
> That drops XDP_VALIDATE_XSK_POOL and struct xsk_rx_check, and fbnic's
> MTU and program hooks with them. Not fully cooked in my head, but maybe?
> Wdyt?
Would be nice, what I meant mostly was that a single driver can't do both
'legacy' ZC and new-age provider based xsk at the same time, so let us
have a single vehicle down to drivers, adjusted to both needs?
>
>
> Björn
>
Re: [PATCH net-next v1 02/11] net: Add memory provider capabilities
Author: Björn Töpel
Date: Sun, 15 Nov 2026 18:46
Date: Sun, 15 Nov 2026 18:46
62 lines
11893 bytes
11893 bytes
Mina Almasry <almasrymina@google.com> writes: > On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote: >> >> The core treats every memory provider as unreadable: installing one >> needs header split and no XDP program, and any page pool that allows >> unreadable netmem takes it. An AF_XDP UMEM provider is readable, needs >> XDP, and hands out whole buffers. >> >> Describe providers by MP_CAP_READABLE and MP_CAP_FRAG; devmem and >> io_uring keep their behavior with MP_CAP_FRAG. A page pool takes a >> readable provider only with the new PP_FLAG_MEM_PROVIDER: > > Why do we need this? I thought whatever creates the pool actually > shouldn't get to pick whether the pool picks up the memory provider. I > thought if core has configured the rxq for a memory provider then the > pool is forced to take it. Thanks for looking at series, Mina. ...this needed some thinking. It isn't forced today either: only pools with PP_FLAG_ALLOW_UNREADABLE_NETMEM take the queue's provider. Drivers set it on the pool that holds payloads, and keep headers in host memory: in a separate pool (fbnic, bnxt), or outside the page pool (gve, mlx5). That works because every provider so far backs payloads only. UMEM doesn't. The socket gets whole packets, so UMEM has to back the header buffers, and with multi-buffer the payloads too. The flag was my way to get it there, but you're right that it's the wrong knob: it lets the driver opt in, where it should only say what each pool holds. How about this instead. Both sides use the rx_roles bits from patch 5, HEAD and PAYLOAD: - The provider says which buffers it backs, next to rx_page_size in pp_memory_provider_params: devmem and io_uring zcrx PAYLOAD, AF_XDP HEAD, or HEAD|PAYLOAD with multi-buffer. - The driver says what each pool holds, in rx_roles. A pool without roles but with PP_FLAG_ALLOW_UNREADABLE_NETMEM holds PAYLOAD, so existing drivers don't change. - page_pool_create() gives the provider to a pool whose roles are all backed; the others get host pages. No opt-in. - After ndo_queue_mem_alloc(), the core checks that the new pools that took the provider cover everything it backs, or fails the restart. With fbnic's header and payload pools: devmem: header pool host, payload pool devmem AF_XDP single-buffer: header pool UMEM, payload pool host AF_XDP multi-buffer: one shared pool, UMEM A shared pool on a devmem queue doesn't take devmem, since devmem doesn't back HEAD, so the check fails and the driver has to split. That's the "headers in host memory" rule, without the driver asking which provider it is. Wdyt? Björn
Re: [PATCH net-next v1 02/11] net: Add memory provider capabilities
Author: Björn Töpel
Date: Sun, 15 Nov 2026 18:47
Date: Sun, 15 Nov 2026 18:47
57 lines
11472 bytes
11472 bytes
Stanislav Fomichev <sdf.kernel@gmail.com> writes: > On 11/12, Björn Töpel wrote: >> Stanislav Fomichev <sdf.kernel@gmail.com> writes: >> >> > On 11/11, Björn Töpel wrote: >> >> Stanislav Fomichev <sdf.kernel@gmail.com> writes: >> >> > On 11/10, Björn Töpel wrote: >> >> >> >> + if (static_branch_unlikely(&page_pool_mem_providers) && >> >> >> + WARN_ON_ONCE(!page_pool_supports_frag(pool))) >> >> >> + return 0; >> >> >> if (WARN_ON(size > max_size)) >> >> >> return 0; >> >> >> >> >> > >> >> > What's the deal with that? How do we get here? >> >> >> >> Hey! Thanks for taking a look at the series! >> >> >> >> An explicit frag call on a whole-buffer provider is a driver bug: UMEM >> >> chunks can be smaller than a page, and RX gives the whole chunk to >> >> userspace. >> >> >> >> But page_pool_alloc_netmem() also picks frags for small requests, so a >> >> valid call can warn. >> >> >> >> I think it would be better to make it return a whole buffer and its >> >> actual size. The WARN stays in the frag API, before taking a new buffer? >> >> Wdyt? >> > >> > I see.. Idk, I'd still return 0 here, but without a warn. Not sure >> > we want a warn for any api misuse? Returning no netmem is gonna be enough >> > to debug things? As for the calls from page_pool_alloc_netmem, I'd also >> > handle it explicitly? if (size > max_size || !page_pool_supports_frag) ? >> > But no strong preference, up to you, was mostly trying to understand >> > what we are warning against here :-) >> >> Yes, page_pool_alloc_netmem() gets the explicit check. Thanks! >> >> For the frag API I'd keep a WARN_ON_ONCE, like the size check right >> below it. A silent 0 looks like an empty provider: the queue just >> stalls, and nothing points at the driver. With the helper fixed, only an >> explicit frag call on such a pool gets there... Wdyt? I'll probably take >> that route for v2. > > I guess, yeah, makes sense, let's return full size and warn. Maybe also > a short comment will help to explain why? Will do, with a comment! Björn
Re: [PATCH net-next v1 03/11] xdp: Copy buffers with restricted lifetime
Author: Björn Töpel
Date: Sun, 15 Nov 2026 18:52
Date: Sun, 15 Nov 2026 18:52
49 lines
11208 bytes
11208 bytes
Mina Almasry <almasrymina@google.com> writes: > On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote: >> >> UMEM stays mapped writable in userspace, and it has a fixed number of >> chunks. The stack must not keep its chunks in an skb or an xdp_frame. >> Mark the providers whose buffers the stack may keep with >> MP_CAP_RETAIN, and copy packets of the others on XDP_PASS, on >> conversion to a frame, and on redirects other than XSKMAP. >> > > I'm not understanding why that needs special handling. Devmem stays > mapped and writeable and did not need MP_CAP_RETAIN. Also, today the > stack can keep any pp page in the socket's receive queue for arbitrary > time without _RETAIN. I'm espcially confused you're not adding _RETAIN > as a cap to existing providers, but their netmems can be retained. This patch does give devmem and io_uring zcrx MP_CAP_RETAIN, and pages need nothing... a pool without a provider is retainable. Only UMEM isn't. The stack never reads devmem or io_uring zcrx payloads, so it doesn't matter that userspace can write them. UMEM is readable, and the stack would parse headers and payload that the application can change under it. An AF_XDP socket also has a fixed set of chunks, and chunks held in skbs elsewhere starve it. Driver zero copy copies on XDP_PASS for the same reasons, in xdp_build_skb_from_zc(); this does the same for provider buffers. >> The head chunk is writable by userspace, so it cannot hold >> skb_shared_info, and virt_to_netmem() cannot find a net_iov head. >> Drivers pass kernel memory for both to xdp_init_buff_netmem(). >> >> A static key keeps the check off while no such page pool exists. A >> frame copy is linear, so a multi-buffer packet of such a provider >> cannot go to a device or CPU map. >> > > Did this actually improve perf? I recall that when I benchmarked the > performance improvement, it was questionable. I have no numbers for it, and it goes in v2. With the frag walk gone, as agreed with Stan, the only check left under the key is for page heads, and no provider hands out pages. Björn
Re: [PATCH net-next v1 04/11] xsk: Allocate UMEM chunks through page_pool
Author: Björn Töpel
Date: Sun, 15 Nov 2026 18:55
Date: Sun, 15 Nov 2026 18:55
84 lines
11981 bytes
11981 bytes
Mina Almasry <almasrymina@google.com> writes:
> On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote:
>> diff --git a/include/net/xdp.h b/include/net/xdp.h
>> index 1105bb9e3292..5ab7802ac4e1 100644
>> --- a/include/net/xdp.h
>> +++ b/include/net/xdp.h
>> @@ -368,7 +368,7 @@ static inline bool xdp_buff_add_frag(struct xdp_buff *xdp, netmem_ref netmem,
>>
>> if (unlikely(netmem_is_pfmemalloc(netmem)))
>> xdp_buff_set_frag_pfmemalloc(xdp);
>> - if (unlikely(netmem_is_net_iov(netmem)))
>> + if (unlikely(netmem_is_net_iov(netmem) && !netmem_address(netmem)))
>> xdp_buff_set_frag_unreadable(xdp);
>>
>
>
> netmem_is_net_iov() check became redundant.
Hmm, not quite... netmem_address() is also NULL for a highmem page
without a mapping, and the stack reads those through kmap, so they
aren't unreadable. The net_iov test keeps them out. I'll add a comment.
>> diff --git a/net/xdp/xsk_pp.c b/net/xdp/xsk_pp.c
>> new file mode 100644
>> index 000000000000..fdd55265a6cd
>> --- /dev/null
>> +++ b/net/xdp/xsk_pp.c
>> @@ -0,0 +1,246 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/* AF_XDP UMEM as a page pool memory provider
>> + *
>> + * Each aligned UMEM chunk is a readable net_iov with one owner at a time:
>> + *
>> + * userspace --FILL--> page pool --release--> reuse --alloc--> page pool
>> + * ^ |
>> + * +-----RX ring-------+
>> + */
>> +
>> +#include <net/page_pool/helpers.h>
>> +#include <net/page_pool/memory_provider.h>
>> +#include <net/xdp_sock_drv.h>
>> +
>> +#include "xsk.h"
>> +#include "xsk_queue.h"
>> +
>> +enum xsk_pp_chunk {
>> + XSK_PP_USER, /* owned by userspace */
>> + XSK_PP_POOL, /* owned by a page pool */
>> + XSK_PP_REUSE, /* on the reuse stack */
>> +};
>
> maybe should be xsk_mp_chunk.
>
> But also, why is this 3? Usually the mp's track allocated and free. I
> assume PP_REUSE is actually free, but I'm curious why it matters to
> your mp whether the pool or the userspace holds the memory (or whether
> the net stack holds it. Can't it hold it?)
REUSE is free, yes. USER and POOL are both allocated, but userspace
gives chunks back by writing addresses to FILL, and it can write any
address, also one of a chunk the kernel still owns. Taking that entry
would hand the device the same chunk twice. So the provider only takes
FILL entries for chunks in USER, and drops the rest. io_uring zcrx
checks the same with user_refs, and devmem with the socket's token
xarray.
The stack can't hold a chunk, see my reply on patch 3.
>> +
>> +struct xsk_pp {
>
> maybe xsk_mp? this is a memory provider right?
Yes, I'll rename it to xsk_mp, the enum too.
Björn
Re: [PATCH net-next v1 05/11] xsk: Install UMEM page pool providers in the core
Author: Björn Töpel
Date: Sun, 15 Nov 2026 18:58
Date: Sun, 15 Nov 2026 18:58
39 lines
10442 bytes
10442 bytes
Mina Almasry <almasrymina@google.com> writes:
> On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote:
>> diff --git a/net/xdp/xsk_pp.c b/net/xdp/xsk_pp.c
>> index fdd55265a6cd..c2214e718cdb 100644
>> --- a/net/xdp/xsk_pp.c
>> +++ b/net/xdp/xsk_pp.c
[...]
>> +/* Called with RTNL and the instance lock of the device */
>> +void xsk_pp_unbind(struct xsk_buff_pool *pool)
>> +{
>> + struct xsk_pp *pp = pool->pp;
>> + struct pp_memory_provider_params mp = {
>> + .mp_ops = &xsk_pp_ops,
>> + .mp_priv = pp,
>> + };
>> +
>> + /* Unregister removed the provider already */
>> + if (!pp->rxq)
>> + return;
>> +
>> + netif_mp_close_rxq(pool->netdev, pool->queue_id, &mp);
>> + xsk_pp_detach(pp);
>
> Need to handle netif_mp_close_rxq() failing here maybe?
Ya, Sashiko found that too... a failed restart leaves the old queue
running on the provider, and this unmaps the UMEM under it. I have a net
fix that keeps the provider on such a queue and retries the removal; it
covers io_uring zcrx too, which drops the error the same way. The fix
then releases the UMEM only once the queue DMA has stopped.
Björn
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Björn Töpel
Date: Sun, 15 Nov 2026 18:59
Date: Sun, 15 Nov 2026 18:59
70 lines
12449 bytes
12449 bytes
Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
> On Fri, Nov 13, 2026 at 12:40:09PM +0100, Björn Töpel wrote:
>> Björn Töpel <bjorn@kernel.org> writes:
>>
>> > Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:
>> >
>> >> On Tue, Nov 10, 2026 at 11:20:32AM +0100, Björn Töpel wrote:
>> >
>> >>> @@ -538,6 +547,13 @@ static int fbnic_bpf(struct net_device *netdev, struct netdev_bpf *bpf)
>> >>> {
>> >>> struct bpf_prog *prog = bpf->prog, *prev_prog;
>> >>> struct fbnic_net *fbn = netdev_priv(netdev);
>> >>> + const struct xsk_rx_check *check;
>> >>> +
>> >>> + if (bpf->command == XDP_VALIDATE_XSK_POOL) {
>> >>
>> >> do you really need a separate command here? why not rely on existing
>> >> XDP_SETUP_XSK_POOL ?
>> >>
>> >> here it doesn't look like things being validated are something unique that
>> >> you could not check during XDP_SETUP_XSK_POOL and XDP_SETUP_PROG.
>> >
>> > I'd like to keep it. XDP_SETUP_XSK_POOL means "set up driver ZC for this
>> > pool": the driver maps the UMEM and restarts its queue, and the core
>> > WARNs if it didn't map. A provider driver does neither; it only says yes
>> > or no, before the core maps and installs anything. The same question
>> > comes up on MTU and program changes of a bound device, with the new MTU
>> > or program, which XDP_SETUP_XSK_POOL can't carry. One command keeps that
>> > in one place, and v2 runs it from the core MTU path too, so a driver
>> > can't forget that case. This is only a burden for the core.
>>
>> Thinking more about it, maybe I can drop the callback altogether, by
>> doing what devmem, io_uring zcrx and tcp-data-split already do: the core
>> refuses a setup that can't work, instead of asking the driver.
>>
>> The driver only judges the chunk size and headroom, in
>> ndo_validate_qcfg, which the queue API already calls when it installs
>> the provider, with a new bit saying the buffers can't be split. A frame
>> of up to the chunk size (minus headroom), then lands in one buffer, so
>> the core checks the MTU itself, at bind and on MTU changes. And like
>> tcp-data-split, a socket bound with XDP_USE_SG needs a frags XDP
>> program: attaching a single-buffer program fails while one is bound, and
>> the bind fails while one is attached.
>>
>> That drops XDP_VALIDATE_XSK_POOL and struct xsk_rx_check, and fbnic's
>> MTU and program hooks with them. Not fully cooked in my head, but maybe?
>> Wdyt?
>
> Would be nice, what I meant mostly was that a single driver can't do both
> 'legacy' ZC and new-age provider based xsk at the same time, so let us
> have a single vehicle down to drivers, adjusted to both needs?
With the callback gone, a provider driver doesn't get an XSK command at
all. It sees a queue restart with the provider's parameters, the vehicle
devmem and io_uring zcrx already use, and opts in with xsk_page_pool in
its queue ops. Driver ZC keeps XDP_SETUP_XSK_POOL. So each driver has
one vehicle, and the provider's isn't XSK-specific. What's left of XSK
in a provider driver is TX, which finds the pool with xsk_rxq_pool().
Does that cover it? I'll try to get that working in v2.
Björn
Re: [PATCH net-next v1 03/11] xdp: Copy buffers with restricted lifetime
Author: Björn Töpel
Date: Sun, 15 Nov 2026 19:02
Date: Sun, 15 Nov 2026 19:02
39 lines
9765 bytes
9765 bytes
netdev-bot+sashiko@kernel.org writes: [...] > With XDP_FLAGS_EXT the head chunk no longer holds the shared info at > all. Does anything still keep data_end below xdp_data_hard_end() for > these buffers? If not, len alone can run past skb->end, since > __skb_put() does not check. Yes. fbnic's MAX_HDR leaves the same tailroom, and bpf_xdp_adjust_tail() stops at xdp_data_hard_end(). > Should the destination size be derived from the copy instead of > xdp->frame_sz? For example: headroom + LARGEST_ALIGN(len) + > SKB_DATA_ALIGN(sizeof(struct skb_shared_info)). Or should this path > copy exactly len bytes? Yes, but that's pre-existing. XSK buffers without XDP_USE_SG have no tailroom at all, so it's worse there. It's the head sizing from Clement's thread [1]. A fix that sizes the head by its contents and copies exact lengths goes to net, and v2 sits on top of it. [...] > Could xdp_build_skb_from_zc() compute the metadata size the way > xdp_copy_buff_to_frame() does? That means treating unsupported > metadata as zero length and copying from xdp->data. Yes. Nothing hits it today, as fbnic marks the metadata valid, but this patch makes it a generic path. Will fix. pw-bot: cr Björn [1] https://lore.kernel.org/bpf/20260629072300.1664622-1-clecigne@google.com/
Re: [PATCH net-next v1 05/11] xsk: Install UMEM page pool providers in the core
Author: Björn Töpel
Date: Sun, 15 Nov 2026 19:05
Date: Sun, 15 Nov 2026 19:05
27 lines
9451 bytes
9451 bytes
netdev-bot+sashiko@kernel.org writes: [...] > Should xsk_pp_detach() be skipped, or the DMA unmap and UMEM release be > deferred until pp->nr_pools drops to zero, when the close fails? Deferred. A failed restart leaves the old queue running on the provider. I have a net fix that keeps the provider on such a queue and retries the removal, which also covers netif_rxq_cleanup_unlease(); I might add a fix in v2 that unmaps and releases the UMEM only once the queue DMA has stopped. [...] > Should the xsk_pp pin the buffer pool and the UMEM, and do the DMA > unmap in xsk_pp_free(), so they outlive the last page pool? Or should > xsk_bind() defer releasing the pool in this case? This case can't happen. The page pools of a failed open never hold a chunk. fbnic fills its rings only in ndo_queue_start(), which can't fail, so a failed open frees empty pools, and they're destroyed at once. pool->pp protects nothing there, so v2 drops that branch for a WARN. Björn
Re: [PATCH net-next v1 10/11] eth: fbnic: Support RX buffers it cannot split
Author: Björn Töpel
Date: Sun, 15 Nov 2026 19:12
Date: Sun, 15 Nov 2026 19:12
25 lines
9340 bytes
9340 bytes
netdev-bot+sashiko@kernel.org writes: [...] > Wouldn't the restarted queue keep the old EN_HDR_SPLIT, which no longer > matches the MAX_HDR, PAYLD_OFF and PAYLD_PG_CL values in CTL1? Nothing > corrects it until the next restart of that queue. Pre-existing for the drop mode, and the per-queue bits make it worse. I have a net fix that serializes link up and queue start with a lock. [...] > Should both callers require that the completion starts the buffer and > also closes it, i.e. a zero offset and PAGE_FIN set? Passing the rcd > into fbnic_bd_one_desc() and doing both checks there might keep the > header and payload paths from drifting apart again. v2 drops these checks instead. With MAX_HDR, PAYLD_OFF and PAYLD_PG_CL as programmed, the device closes a whole buffer after one descriptor, and fbnic trusts its completion ring everywhere else. Björn
Re: [PATCH net-next v1 06/11] page_pool: Coordinate refill with memory providers
Author: Björn Töpel
Date: Sun, 15 Nov 2026 19:17
Date: Sun, 15 Nov 2026 19:17
40 lines
9949 bytes
9949 bytes
netdev-bot+sashiko@kernel.org writes: [...] > Should netif_mp_napi_del() also clear rxq->napi when it matches, or > should netif_mp_update_napi() only publish a NAPI that is still > listed? If drivers are expected to clear the association themselves, > could netmem.rst item 8 say so? The first. v2 drops mp_napi, so wakeups use rxq->napi itself, under RCU, and the core clears it when the NAPI is deleted. [...] > Should the documented contract require that, or should the core handle > the disabled-NAPI case itself? The contract. fbnic polls the vector right after napi_enable() (FBNIC_INTR_SET), so the queue refills once, from the reuse stack or FILL, and refill_done marks it starved again if both are empty. A wakeup lost on a stopped queue doesn't matter then. v2 documents that a driver polls the queue once after enabling its NAPI. > Could uses_need_wakeup be cached in struct xsk_pp when it is created, or > read only after pp->fq is confirmed under pp->lock? Same root cause as the failed removal in 05, and the same fix. The pool then stays until the queue DMA has stopped, and no refill runs after that. > Should the error path arm from the configuration that is running > again, or should __netif_mp_open_rxq() and __netif_mp_close_rxq() call > netif_mp_update_napi() once they have settled rxq->mp_params? Neither is needed -- with mp_napi and mp_armed gone in v2, there is no wakeup target to arm from the wrong configuration. Björn
Re: [PATCH net-next v1 07/11] xsk: Deliver provider chunks without copying
Author: Björn Töpel
Date: Sun, 15 Nov 2026 19:23
Date: Sun, 15 Nov 2026 19:23
20 lines
9312 bytes
9312 bytes
netdev-bot+sashiko@kernel.org writes: > Should this be gated by a flag? Or should the commit message describe it > as a UAPI change rather than as a device property? Neither, it isn't a UAPI change. The headroom text predates multi-buffer, when a buffer held a whole packet: "the packet will start N bytes into the buffer". A continuation buffer doesn't start a packet, and the room in front of the packet, for headers or metadata, is still there in its first buffer. Userspace reads each buffer at the address in its descriptor anyway; XDP can already move the start with bpf_xdp_adjust_head(). The doc change only spells out a valid multi-buffer variant, and I'll say so in the commit message. I'll also fix the commit message on the old copy path, and give net_mp_release_page_pool_bulk() its own page_pool patch. Björn
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Björn Töpel
Date: Sun, 15 Nov 2026 19:25
Date: Sun, 15 Nov 2026 19:25
27 lines
9456 bytes
9456 bytes
netdev-bot+sashiko@kernel.org writes: [...] > Won't an idle xsk queue then report a fast-growing alloc_fail count that > has nothing to do with memory pressure? With need_wakeup, each wakeup > that finds the FILL ring empty would also be counted. mlx5 counts it the same way, ice doesn't. It's already in fill_ring_empty_descs, so v2 doesn't count it on rings the provider feeds. [...] > The xsk_rxq_pool() comment says "The pool stays valid while the queue > that the caller allocates runs", but that does not seem to hold on this > failure path. Part of the cause is the core error handling. Still, the > fbnic TX code added here is what keeps using the raw pointer. Same root cause as the failed removal in 05, and the same fix. The provider then keeps the pool, its rings and the UMEM until the queue DMA has stopped, so the comment holds. The socket is off the pool's TX list by then, so TX finds nothing, and completions go to a live ring. Björn
Re: [PATCH net-next v1 01/11] net: Get skb fragment addresses through netmem
Author: Jakub Kicinski
Date: Sun, 15 Nov 2026 21:13
Date: Sun, 15 Nov 2026 21:13
15 lines
9791 bytes
9791 bytes
On Tue, 10 Nov 2026 11:20:22 +0100 Björn Töpel wrote: > skb_frag_address() goes through struct page, so a net_iov never has an > address. Only unreadable memory should lack one: XDP and BPF read > fragments through this helper, and AF_XDP UMEM will back readable > net_iovs. netmem_address() also returns NULL, not a bogus pointer, for > an unmapped highmem page. > > Generic code needs the size of a net_iov to find its address, so keep > it in struct net_iov_area instead of the devmem binding. IIRC netmem is supposed to be used for frags and memory CPU never needs to access. This patch looks odd. I haven't read the rest of the series yet but at the very least commit message should explain why this aberration is needed / correct.
Re: [PATCH net-next v1 02/11] net: Add memory provider capabilities
Author: Jakub Kicinski
Date: Sun, 15 Nov 2026 21:18
Date: Sun, 15 Nov 2026 21:18
38 lines
10406 bytes
10406 bytes
On Tue, 10 Nov 2026 11:20:23 +0100 Björn Töpel wrote: > diff --git a/include/net/page_pool/memory_provider.h b/include/net/page_pool/memory_provider.h > index bceb5f7740e2..4417e54a0f81 100644 > --- a/include/net/page_pool/memory_provider.h > +++ b/include/net/page_pool/memory_provider.h > @@ -19,6 +19,18 @@ struct sk_buff; > * Per-provider custom logic must be delegated to memory_provider_ops rather > * than handled directly in page_pool core code. > */ > + > +/** > + * enum mp_caps - memory provider capabilities > + * @MP_CAP_READABLE: The CPU can access provider memory. It may back header > + * page pools, and XDP programs may run on it. Being readable is the normal state for memory. We should be marking mps as unreadable, not as readable? > @@ -1070,6 +1095,9 @@ netmem_ref page_pool_alloc_frag_netmem(struct page_pool *pool, > unsigned int max_size = PAGE_SIZE << pool->p.order; > netmem_ref netmem = pool->frag_page; > > + if (static_branch_unlikely(&page_pool_mem_providers) && > + WARN_ON_ONCE(!page_pool_supports_frag(pool))) > + return 0; Shouldn't we return a full page if we can't frag? Fragmentation breaks up a page into smaller units, it should be legal to simply return a full page if fragmentation is not supported for the provider. > if (WARN_ON(size > max_size)) > return 0;
Re: [PATCH net-next v1 02/11] net: Add memory provider capabilities
Author: Björn Töpel
Date: Mon, 16 Nov 2026 14:20
Date: Mon, 16 Nov 2026 14:20
48 lines
10908 bytes
10908 bytes
Jakub Kicinski <kuba@kernel.org> writes: > On Tue, 10 Nov 2026 11:20:23 +0100 Björn Töpel wrote: >> diff --git a/include/net/page_pool/memory_provider.h b/include/net/page_pool/memory_provider.h >> index bceb5f7740e2..4417e54a0f81 100644 >> --- a/include/net/page_pool/memory_provider.h >> +++ b/include/net/page_pool/memory_provider.h >> @@ -19,6 +19,18 @@ struct sk_buff; >> * Per-provider custom logic must be delegated to memory_provider_ops rather >> * than handled directly in page_pool core code. >> */ >> + >> +/** >> + * enum mp_caps - memory provider capabilities >> + * @MP_CAP_READABLE: The CPU can access provider memory. It may back header >> + * page pools, and XDP programs may run on it. > > Being readable is the normal state for memory. > We should be marking mps as unreadable, not as readable? Fair, I'll flip it. devmem and io_uring zcrx mark themselves unreadable. The same goes for the other two caps; page memory can be split and kept, so AF_XDP marks that its buffers can't be. >> @@ -1070,6 +1095,9 @@ netmem_ref page_pool_alloc_frag_netmem(struct page_pool *pool, >> unsigned int max_size = PAGE_SIZE << pool->p.order; >> netmem_ref netmem = pool->frag_page; >> >> + if (static_branch_unlikely(&page_pool_mem_providers) && >> + WARN_ON_ONCE(!page_pool_supports_frag(pool))) >> + return 0; > > Shouldn't we return a full page if we can't frag? > Fragmentation breaks up a page into smaller units, > it should be legal to simply return a full page if > fragmentation is not supported for the provider. Yeah, make sense. I'll return the whole buffer at offset 0, instead of the WARN Stan and I settled on, and page_pool_alloc_netmem() reports the chunk size for callers that need it for truesize. Björn
Re: [PATCH net-next v1 01/11] net: Get skb fragment addresses through netmem
Author: Björn Töpel
Date: Mon, 16 Nov 2026 14:31
Date: Mon, 16 Nov 2026 14:31
25 lines
10121 bytes
10121 bytes
Jakub Kicinski <kuba@kernel.org> writes:
> On Tue, 10 Nov 2026 11:20:22 +0100 Björn Töpel wrote:
>> skb_frag_address() goes through struct page, so a net_iov never has an
>> address. Only unreadable memory should lack one: XDP and BPF read
>> fragments through this helper, and AF_XDP UMEM will back readable
>> net_iovs. netmem_address() also returns NULL, not a bogus pointer, for
>> an unmapped highmem page.
>>
>> Generic code needs the size of a net_iov to find its address, so keep
>> it in struct net_iov_area instead of the devmem binding.
>
> IIRC netmem is supposed to be used for frags and memory CPU never needs
> to access.
netmem covers pages too, and netmem.rst already allows readable net_iovs
("Decouple net_iov from unreadability"); the in-tree ones just happen to
be unreadable.
> This patch looks odd. I haven't read the rest of the series yet but at
> the very least commit message should explain why this aberration is
> needed / correct.
I'll expand the wording in the commit message.
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Dimitri Daskalakis
Date: Mon, 16 Nov 2026 18:48
Date: Mon, 16 Nov 2026 18:48
288 lines
22486 bytes
22486 bytes
On 11/10/26 2:20 AM, Björn Töpel wrote:
> Header and payload rings share one provider page pool, so refills even
> them out, and a short pool does not starve one of them. Payload
> buffers start at chunk offset 0, and the UMEM headroom rules require
> headroom only in the first buffer. A chunk is one 4 KiB device page,
> also with larger kernel pages, so rings fed by the provider post one
> descriptor per chunk.
>
[...]
> qt->sub0.page_pool = pp;
> + fbnic_bdq_set_page_size(&qt->sub0, xsk ? rx_page_size : PAGE_SIZE);
> qt->hdr_max = 0;
> if (!page_pool_supports_frag(pp))
> - qt->hdr_max = fbnic_whole_hdr_max(FBNIC_RX_HROOM);
> + qt->hdr_max = fbnic_whole_hdr_max(qt->rx_hroom);
> if (netif_rxq_has_unreadable_mp(fbn->netdev, rxq_idx)) {
> pp_params.order = get_order(rx_page_size);
> pp_params.max_len = rx_page_size;
> pp_params.flags |= PP_FLAG_ALLOW_UNREADABLE_NETMEM;
> pp_params.dma_dir = DMA_FROM_DEVICE;
>
> + pp = page_pool_create(&pp_params);
> + if (IS_ERR(pp))
> + goto err_destroy_sub0;
> + } else if (xsk && !xsk_pool_uses_sg(xsk)) {
> + pp_params.flags &= ~PP_FLAG_MEM_PROVIDER;
> + pp_params.rx_roles = 0;
> + pp_params.max_len = PAGE_SIZE;
> + rx_page_size = PAGE_SIZE;
> +
> pp = page_pool_create(&pp_params);
> if (IS_ERR(pp))
> goto err_destroy_sub0;
Maybe I'm misunderstanding, but why is it necessary to create a new page pool for
sub1 if !sg? All frames should be sent to sub0, and the buffers in sub1 should sit idle.
> @@ -1709,6 +1967,7 @@ fbnic_alloc_qt_page_pools(struct fbnic_net *fbn, struct fbnic_q_triad *qt,
> page_pool_get(pp);
> }
> qt->sub1.page_pool = pp;
> + fbnic_bdq_set_page_size(&qt->sub1, rx_page_size);
>
> return 0;
>
> @@ -1717,16 +1976,6 @@ fbnic_alloc_qt_page_pools(struct fbnic_net *fbn, struct fbnic_q_triad *qt,
> return PTR_ERR(pp);
> }
>
> -static u8 fbnic_bdq_page_shift(u32 page_size)
> -{
> - return ilog2(page_size / FBNIC_BD_PAGE_SIZE);
> -}
> -
> -static void fbnic_bdq_set_page_size(struct fbnic_ring *bdq, u32 page_size)
> -{
> - bdq->bd_page_shift = fbnic_bdq_page_shift(page_size);
> -}
> -
> static void fbnic_ring_init(struct fbnic_ring *ring, u32 __iomem *doorbell,
> int q_idx, u8 flags)
> {
> @@ -1830,7 +2079,8 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn,
> if (xdp_count > 0) {
> unsigned int xdp_idx = FBNIC_MAX_TXQS + rxq_idx;
>
> - fbnic_ring_init(&qt->sub1, db, xdp_idx, flags);
> + fbnic_ring_init(&qt->sub1, db, xdp_idx,
> + flags | FBNIC_RING_F_XDP);
> fbn->tx[xdp_idx] = &qt->sub1;
> xdp_count--;
> } else {
> @@ -1977,6 +2227,9 @@ static int fbnic_alloc_tx_ring_buffer(struct fbnic_ring *txr)
> {
> size_t size = array_size(sizeof(*txr->tx_buf), txr->size_mask + 1);
>
> + if (txr->flags & FBNIC_RING_F_XDP)
> + size = array_size(sizeof(*txr->xdp_buf), txr->size_mask + 1);
> +
> txr->tx_buf = kvzalloc(size, GFP_KERNEL | __GFP_NOWARN);
>
> return txr->tx_buf ? 0 : -ENOMEM;
> @@ -2126,20 +2379,19 @@ static int fbnic_alloc_tx_qt_resources(struct fbnic_net *fbn,
> return err;
> }
>
> -static int fbnic_alloc_rx_qt_resources(struct fbnic_net *fbn,
> - struct fbnic_napi_vector *nv,
> - struct fbnic_q_triad *qt,
> - u32 rx_page_size)
> +static int
> +fbnic_alloc_rx_qt_resources(struct fbnic_net *fbn,
> + struct fbnic_napi_vector *nv,
> + struct fbnic_q_triad *qt,
> + const struct netdev_queue_config *qcfg)
> {
> struct device *dev = fbn->netdev->dev.parent;
> int err;
>
> - err = fbnic_alloc_qt_page_pools(fbn, qt, qt->cmpl.q_idx, rx_page_size);
> + err = fbnic_alloc_qt_page_pools(fbn, qt, qt->cmpl.q_idx, qcfg);
> if (err)
> return err;
>
> - fbnic_bdq_set_page_size(&qt->sub1, rx_page_size);
> -
> err = xdp_rxq_info_reg(&qt->xdp_rxq, fbn->netdev, qt->cmpl.q_idx,
> nv->napi.napi_id);
> if (err)
> @@ -2203,8 +2455,7 @@ static int fbnic_alloc_nv_resources(struct fbnic_net *fbn,
> struct netdev_queue_config qcfg;
>
> netdev_queue_config(fbn->netdev, nv->qt[i].cmpl.q_idx, &qcfg);
> - err = fbnic_alloc_rx_qt_resources(fbn, nv, &nv->qt[i],
> - qcfg.rx_page_size);
> + err = fbnic_alloc_rx_qt_resources(fbn, nv, &nv->qt[i], &qcfg);
> if (err)
> goto free_qt_resources;
> }
> @@ -2598,9 +2849,8 @@ static void fbnic_nv_fill(struct fbnic_napi_vector *nv)
> for (j = 0, t = nv->txt_count; j < nv->rxt_count; j++, t++) {
> struct fbnic_q_triad *qt = &nv->qt[t];
>
> - /* Populate the header and payload BDQs */
> - fbnic_fill_bdq(&qt->sub0);
> - fbnic_fill_bdq(&qt->sub1);
> + /* Populate the header and payload BDQs; NAPI retries */
> + fbnic_fill_bdqs(qt);
> }
> }
>
> @@ -2736,14 +2986,20 @@ static void fbnic_config_drop_mode_rcq(struct fbnic_napi_vector *nv,
> struct fbnic_ring *rcq, bool tx_pause,
> bool hdr_split)
> {
> + struct fbnic_q_triad *qt = container_of_const(rcq, struct fbnic_q_triad,
> + cmpl);
> struct fbnic_net *fbn = netdev_priv(nv->napi.dev);
> - u32 drop_mode, rcq_ctl;
> + u32 drop_mode, hroom, rcq_ctl;
> +
> + /* The device aligns the maximum value up to FBNIC_RX_HROOM_MAX. */
> + hroom = min_t(u32, qt->rx_hroom,
> + FIELD_MAX(FBNIC_QUEUE_RDE_CTL0_MIN_HROOM_MASK));
>
> drop_mode = fbnic_drop_mode(fbn, tx_pause);
>
> /* Specify packet layout */
> rcq_ctl = FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_DROP_MODE_MASK, drop_mode) |
> - FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_MIN_HROOM_MASK, FBNIC_RX_HROOM) |
> + FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_MIN_HROOM_MASK, hroom) |
> FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_MIN_TROOM_MASK, FBNIC_RX_TROOM) |
> FIELD_PREP(FBNIC_QUEUE_RDE_CTL0_EN_HDR_SPLIT, hdr_split);
>
> @@ -3028,8 +3284,7 @@ static int fbnic_queue_mem_alloc(struct net_device *dev,
> struct fbnic_napi_vector *nv;
>
> if (!netif_running(dev))
> - return fbnic_alloc_qt_page_pools(fbn, qt, idx,
> - qcfg->rx_page_size);
> + return fbnic_alloc_qt_page_pools(fbn, qt, idx, qcfg);
>
> /* A failed PCIe recovery or resume can leave the datapath torn down
> * while netif_running() is still true. This ndo runs before
> @@ -3049,7 +3304,7 @@ static int fbnic_queue_mem_alloc(struct net_device *dev,
> fbnic_ring_init(&qt->cmpl, real->cmpl.doorbell, real->cmpl.q_idx,
> real->cmpl.flags);
>
> - return fbnic_alloc_rx_qt_resources(fbn, nv, qt, qcfg->rx_page_size);
> + return fbnic_alloc_rx_qt_resources(fbn, nv, qt, qcfg);
> }
>
> static void fbnic_default_qcfg(struct net_device *dev,
> @@ -3086,6 +3341,14 @@ static int fbnic_validate_qcfg(struct net_device *dev,
> return -EINVAL;
> }
>
> + if (qcfg->rx_headroom &&
> + (qcfg->rx_headroom < XDP_PACKET_HEADROOM ||
> + qcfg->rx_headroom > FBNIC_RX_HROOM_MAX ||
> + !IS_ALIGNED(qcfg->rx_headroom, FBNIC_RX_HDR_ALIGN))) {
> + NL_SET_ERR_MSG_MOD(extack, "rx_headroom is not supported");
> + return -EINVAL;
> + }
> +
> /* Payload fragments occupy multiples of FBNIC_RX_PAYLD_ALIGN bytes.
> * Keep at least one reference in the bias until fbnic_clean_bdq()
> * observes a completion from a subsequent allocation.
> @@ -3216,5 +3479,6 @@ const struct netdev_queue_mgmt_ops fbnic_queue_mgmt_ops = {
> .ndo_queue_stop = fbnic_queue_stop,
> .ndo_default_qcfg = fbnic_default_qcfg,
> .ndo_validate_qcfg = fbnic_validate_qcfg,
> - .supported_params = QCFG_RX_PAGE_SIZE,
> + .supported_params = QCFG_RX_PAGE_SIZE | QCFG_RX_HEADROOM,
> + .xsk_page_pool = true,
> };
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h
> index 3077d9bbd587..b4baaa914585 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.h
> @@ -14,7 +14,11 @@
>
> #include "fbnic_csr.h"
>
> +struct bpf_prog;
> struct fbnic_net;
> +struct netlink_ext_ack;
> +struct xsk_buff_pool;
> +struct xsk_rx_check;
>
> /* Guarantee we have space needed for storing the buffer
> * To store the buffer we need:
> @@ -36,6 +40,8 @@ struct fbnic_net;
> */
> #define FBNIC_MAX_RX_PKT_DESC 7
> #define FBNIC_RX_DESC_MIN roundup_pow_of_two(FBNIC_MAX_RX_PKT_DESC * 2)
> +/* All descriptors of a packet but the two metadata ones */
> +#define FBNIC_MAX_RX_BUFS (FBNIC_MAX_RX_PKT_DESC - 2)
>
> #define FBNIC_MAX_TXQS 128u
> #define FBNIC_MAX_RXQS 128u
> @@ -66,6 +72,9 @@ struct fbnic_net;
> (ALIGN(FBNIC_RX_TROOM + FBNIC_RX_HROOM_PAD, 128) - FBNIC_RX_TROOM)
> #define FBNIC_RX_PAD 0
> #define FBNIC_RX_HDR_ALIGN 128
> +#define FBNIC_RX_HROOM_MAX \
> + ALIGN(FIELD_MAX(FBNIC_QUEUE_RDE_CTL0_MIN_HROOM_MASK), \
> + FBNIC_RX_HDR_ALIGN)
> #define FBNIC_RX_PAYLD_ALIGN 128
> #define FBNIC_RX_PAYLD_OFFSET 0
> #define FBNIC_RX_PAYLD_PG_CL 0
> @@ -73,6 +82,7 @@ struct fbnic_net;
> #define FBNIC_RING_F_DISABLED BIT(0)
> #define FBNIC_RING_F_CTX BIT(1)
> #define FBNIC_RING_F_STATS BIT(2) /* Ring's stats may be used */
> +#define FBNIC_RING_F_XDP BIT(3) /* XDP TX ring */
>
> #define FBNIC_HDS_THRESH_MAX \
> (4096 - FBNIC_RX_HROOM - FBNIC_RX_TROOM - FBNIC_RX_PAD)
> @@ -121,12 +131,18 @@ struct fbnic_rx_buf {
> long pagecnt_bias;
> };
>
> +/* XDP TX ring entry: an XDP_TX buffer, or an AF_XDP TX descriptor */
> +struct fbnic_xdp_tx_buf {
> + netmem_ref netmem;
> + struct xsk_buff_pool *xsk;
> +};
> +
> struct fbnic_ring {
> /* Pointer to buffer specific info */
> union {
> struct fbnic_pkt_buff *pkt; /* RCQ */
> struct fbnic_rx_buf *rx_buf; /* BDQ */
> - netmem_ref *tx_netmem; /* TWQ1 */
> + struct fbnic_xdp_tx_buf *xdp_buf; /* TWQ1 */
> void **tx_buf; /* TWQ */
> void *buffer; /* Generic pointer */
> };
> @@ -167,6 +183,10 @@ struct fbnic_q_triad {
> struct fbnic_ring sub0, sub1, cmpl;
> struct xdp_rxq_info xdp_rxq;
> u16 hdr_max; /* Header bytes for whole header buffers, or 0 */
> + u16 rx_hroom; /* Headroom before a header */
> + u16 rx_hdr_first; /* Offset of the first header in a buffer */
> + u16 rx_frame_off; /* Offset of the frame in a header buffer */
> + struct xsk_buff_pool *xsk_pool; /* AF_XDP pool of an RX queue */
> };
>
> struct fbnic_napi_vector {
> @@ -178,6 +198,7 @@ struct fbnic_napi_vector {
> u16 v_idx;
> u8 txt_count;
> u8 rxt_count;
> + u8 xsk_tx_next; /* RX queue that sends socket TX first */
>
> struct fbnic_q_triad qt[];
> };
> @@ -203,6 +224,8 @@ void fbnic_aggregate_ring_tx_counters(struct fbnic_net *fbn,
> void fbnic_aggregate_ring_xdp_counters(struct fbnic_net *fbn,
> struct fbnic_ring *xdpr);
>
> +int fbnic_xsk_validate(const struct xsk_rx_check *check,
> + struct bpf_prog *prog, struct netlink_ext_ack *extack);
> int fbnic_alloc_napi_vectors(struct fbnic_net *fbn);
> void fbnic_free_napi_vectors(struct fbnic_net *fbn);
> int fbnic_alloc_resources(struct fbnic_net *fbn);
Re: [PATCH net-next v1 02/11] net: Add memory provider capabilities
Author: Björn Töpel
Date: Tue, 17 Nov 2026 17:06
Date: Tue, 17 Nov 2026 17:06
97 lines
13646 bytes
13646 bytes
Mina Almasry <almasrymina@google.com> writes: > On Sun, Nov 15, 2026 at 10:47 AM Björn Töpel <bjorn@kernel.org> wrote: >> >> Mina Almasry <almasrymina@google.com> writes: >> >> > On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote: >> >> >> >> The core treats every memory provider as unreadable: installing one >> >> needs header split and no XDP program, and any page pool that allows >> >> unreadable netmem takes it. An AF_XDP UMEM provider is readable, needs >> >> XDP, and hands out whole buffers. >> >> >> >> Describe providers by MP_CAP_READABLE and MP_CAP_FRAG; devmem and >> >> io_uring keep their behavior with MP_CAP_FRAG. A page pool takes a >> >> readable provider only with the new PP_FLAG_MEM_PROVIDER: >> > >> > Why do we need this? I thought whatever creates the pool actually >> > shouldn't get to pick whether the pool picks up the memory provider. I >> > thought if core has configured the rxq for a memory provider then the >> > pool is forced to take it. >> >> Thanks for looking at series, Mina. ...this needed some thinking. >> >> It isn't forced today either: only pools with >> PP_FLAG_ALLOW_UNREADABLE_NETMEM take the queue's provider. Drivers set >> it on the pool that holds payloads, and keep headers in host memory: in >> a separate pool (fbnic, bnxt), or outside the page pool (gve, mlx5). >> That works because every provider so far backs payloads only. >> >> UMEM doesn't. The socket gets whole packets, so UMEM has to back the >> header buffers, and with multi-buffer the payloads too. The flag was my >> way to get it there, but you're right that it's the wrong knob: it lets >> the driver opt in, where it should only say what each pool holds. >> >> How about this instead. Both sides use the rx_roles bits from patch 5, >> HEAD and PAYLOAD: >> >> - The provider says which buffers it backs, next to rx_page_size in >> pp_memory_provider_params: devmem and io_uring zcrx PAYLOAD, AF_XDP >> HEAD, or HEAD|PAYLOAD with multi-buffer. >> - The driver says what each pool holds, in rx_roles. A pool without >> roles but with PP_FLAG_ALLOW_UNREADABLE_NETMEM holds PAYLOAD, so >> existing drivers don't change. >> - page_pool_create() gives the provider to a pool whose roles are all >> backed; the others get host pages. No opt-in. >> - After ndo_queue_mem_alloc(), the core checks that the new pools that >> took the provider cover everything it backs, or fails the restart. >> >> With fbnic's header and payload pools: >> >> devmem: header pool host, payload pool devmem >> AF_XDP single-buffer: header pool UMEM, payload pool host >> AF_XDP multi-buffer: one shared pool, UMEM >> >> A shared pool on a devmem queue doesn't take devmem, since devmem >> doesn't back HEAD, so the check fails and the driver has to split. >> That's the "headers in host memory" rule, without the driver asking >> which provider it is. >> >> Wdyt? >> > > Hmm, I think maybe the exsiting knobs PP_FLAG_ALLOW_UNREADABLE + > CAP_READABLE covers your needs. > > The pp says whether the memory it provides is readable or not via > CAP_READABLE (or !CAP_UNREADABLE). > > The driver says whether it will allow unreadable memory for this pool. > For header pools, it doesn't specfiy PP_FLAG_ALLOW_UNREADABLE and for > paylaod pools it specifies ALLOW_UNREADABLE. > > The change I think you need to make is: today we disallow any > providers if the caller did not specify ALLOW_UNREADABLE (because we > assume mp's are unreadable). After your series we only need to > disallow memory providers if the mp is unreadable and the caller said > it's not fine with unreadable. I'm all in on making v1 simpler -- I'll try this path! So, an unreadable provider still goes only to pools that set ALLOW_UNREADABLE. A readable provider goes to all RX pools of the queue. The roles and PP_FLAG_MEM_PROVIDER are gone. One addition: a driver must opt in with a readable_mp flag in its queue ops. Without it, its pools don't look for a provider. The reason is that today only ALLOW_UNREADABLE pools must set queue_idx and be created under the instance lock. Other pools may not, so they could pick up the wrong queue's provider. Maybe there's a better way? Thanks! Björn
Re: [PATCH net-next v1 11/11] eth: fbnic: Support AF_XDP page pool zero copy
Author: Björn Töpel
Date: Tue, 17 Nov 2026 17:14
Date: Tue, 17 Nov 2026 17:14
54 lines
9959 bytes
9959 bytes
Dimitri Daskalakis <dimitri.daskalakis1@gmail.com> writes:
> On 11/10/26 2:20 AM, Björn Töpel wrote:
>> Header and payload rings share one provider page pool, so refills even
>> them out, and a short pool does not starve one of them. Payload
>> buffers start at chunk offset 0, and the UMEM headroom rules require
>> headroom only in the first buffer. A chunk is one 4 KiB device page,
>> also with larger kernel pages, so rings fed by the provider post one
>> descriptor per chunk.
>>
> [...]
>> qt->sub0.page_pool = pp;
>> + fbnic_bdq_set_page_size(&qt->sub0, xsk ? rx_page_size : PAGE_SIZE);
>> qt->hdr_max = 0;
>> if (!page_pool_supports_frag(pp))
>> - qt->hdr_max = fbnic_whole_hdr_max(FBNIC_RX_HROOM);
>> + qt->hdr_max = fbnic_whole_hdr_max(qt->rx_hroom);
>> if (netif_rxq_has_unreadable_mp(fbn->netdev, rxq_idx)) {
>> pp_params.order = get_order(rx_page_size);
>> pp_params.max_len = rx_page_size;
>> pp_params.flags |= PP_FLAG_ALLOW_UNREADABLE_NETMEM;
>> pp_params.dma_dir = DMA_FROM_DEVICE;
>>
>> + pp = page_pool_create(&pp_params);
>> + if (IS_ERR(pp))
>> + goto err_destroy_sub0;
>> + } else if (xsk && !xsk_pool_uses_sg(xsk)) {
>> + pp_params.flags &= ~PP_FLAG_MEM_PROVIDER;
>> + pp_params.rx_roles = 0;
>> + pp_params.max_len = PAGE_SIZE;
>> + rx_page_size = PAGE_SIZE;
>> +
>> pp = page_pool_create(&pp_params);
>> if (IS_ERR(pp))
>> goto err_destroy_sub0;
>
> Maybe I'm misunderstanding, but why is it necessary to create a new page pool for
> sub1 if !sg? All frames should be sent to sub0, and the buffers in sub1 should sit idle.
(BTW, the reply to your other mail didn't show up on lore for some
reason, but I hope you got it! If not, holler!)
You're right, it is not needed. I'll fix this in the next version. Every
frame fits in one chunk on the header ring, and the device drops bigger
frames. With SG, both rings share one pool.
I first tried sharing the pool for non-SG too. But then up to 255 chunks
sit unused in the payload ring :P
Björn
Re: [PATCH net-next v1 04/11] xsk: Allocate UMEM chunks through page_pool
Author: Björn Töpel
Date: Tue, 17 Nov 2026 17:15
Date: Tue, 17 Nov 2026 17:15
109 lines
13684 bytes
13684 bytes
Mina Almasry <almasrymina@google.com> writes:
> On Sun, Nov 15, 2026 at 10:55 AM Björn Töpel <bjorn@kernel.org> wrote:
>>
>> Mina Almasry <almasrymina@google.com> writes:
>>
>> > On Tue, Nov 10, 2026 at 2:21 AM Björn Töpel <bjorn@kernel.org> wrote:
>>
>> >> diff --git a/include/net/xdp.h b/include/net/xdp.h
>> >> index 1105bb9e3292..5ab7802ac4e1 100644
>> >> --- a/include/net/xdp.h
>> >> +++ b/include/net/xdp.h
>> >> @@ -368,7 +368,7 @@ static inline bool xdp_buff_add_frag(struct xdp_buff *xdp, netmem_ref netmem,
>> >>
>> >> if (unlikely(netmem_is_pfmemalloc(netmem)))
>> >> xdp_buff_set_frag_pfmemalloc(xdp);
>> >> - if (unlikely(netmem_is_net_iov(netmem)))
>> >> + if (unlikely(netmem_is_net_iov(netmem) && !netmem_address(netmem)))
>> >> xdp_buff_set_frag_unreadable(xdp);
>> >>
>> >
>> >
>> > netmem_is_net_iov() check became redundant.
>>
>> Hmm, not quite... netmem_address() is also NULL for a highmem page
>> without a mapping, and the stack reads those through kmap, so they
>> aren't unreadable. The net_iov test keeps them out. I'll add a comment.
>>
>
>
> Oh. I missed that. There are a bunch of docs actually that explicitly
> wrongly say to use netmem_address to tell if the memory si readable.
>
> Can you, in a separate patch, add a netmem_readable() helper and
> update the docs (and if possible code places) that checked net-iov
> when they were really checks for readability? Now that you're adding
> readable net-iovs, all that assumption break right?
Uhm, yes. I'll cook a separate patch that adds netmem_readable().
>> >> diff --git a/net/xdp/xsk_pp.c b/net/xdp/xsk_pp.c
>> >> new file mode 100644
>> >> index 000000000000..fdd55265a6cd
>> >> --- /dev/null
>> >> +++ b/net/xdp/xsk_pp.c
>> >> @@ -0,0 +1,246 @@
>> >> +// SPDX-License-Identifier: GPL-2.0
>> >> +/* AF_XDP UMEM as a page pool memory provider
>> >> + *
>> >> + * Each aligned UMEM chunk is a readable net_iov with one owner at a time:
>> >> + *
>> >> + * userspace --FILL--> page pool --release--> reuse --alloc--> page pool
>> >> + * ^ |
>> >> + * +-----RX ring-------+
>> >> + */
>> >> +
>> >> +#include <net/page_pool/helpers.h>
>> >> +#include <net/page_pool/memory_provider.h>
>> >> +#include <net/xdp_sock_drv.h>
>> >> +
>> >> +#include "xsk.h"
>> >> +#include "xsk_queue.h"
>> >> +
>> >> +enum xsk_pp_chunk {
>> >> + XSK_PP_USER, /* owned by userspace */
>> >> + XSK_PP_POOL, /* owned by a page pool */
>> >> + XSK_PP_REUSE, /* on the reuse stack */
>> >> +};
>> >
>> > maybe should be xsk_mp_chunk.
>> >
>> > But also, why is this 3? Usually the mp's track allocated and free. I
>> > assume PP_REUSE is actually free, but I'm curious why it matters to
>> > your mp whether the pool or the userspace holds the memory (or whether
>> > the net stack holds it. Can't it hold it?)
>>
>> REUSE is free, yes. USER and POOL are both allocated, but userspace
>> gives chunks back by writing addresses to FILL, and it can write any
>> address, also one of a chunk the kernel still owns. Taking that entry
>> would hand the device the same chunk twice. So the provider only takes
>> FILL entries for chunks in USER, and drops the rest. io_uring zcrx
>> checks the same with user_refs, and devmem with the socket's token
>> xarray.
>>
>
> Sounds like devmem choose to do extra-pp-refs on netmems given to
> userspace, io-uring choose to give extra user_refs for netmems given
> to userspace, and you have choosen to do something new? I need to read
> the patches more thoroughly to understand.
It is close to io_uring's scheme, but simpler. io_uring counts user refs
per buffer, because one buffer can reach userspace in several pieces,
each returned on its own, and it keeps a page pool ref while userspace
holds it. A UMEM chunk is never split, so userspace holds it at most
once, and one state per chunk replaces the counter: USER means userspace
has it, REUSE is the free list. The chunk also leaves its page pool
before userspace gets it, so no page pool ref is held meanwhile. When
userspace returns a chunk on the FILL ring, we take it only if it is in
USER state, so userspace cannot return a chunk the kernel still uses.
Björn
Re: [PATCH net-next v1 01/11] net: Get skb fragment addresses through netmem
Author: Jakub Kicinski
Date: Wed, 18 Nov 2026 00:32
Date: Wed, 18 Nov 2026 00:32
11 lines
9600 bytes
9600 bytes
On Mon, 16 Nov 2026 15:31:27 +0100 Björn Töpel wrote:
> > IIRC netmem is supposed to be used for frags and memory CPU never needs
> > to access.
>
> netmem covers pages too, and netmem.rst already allows readable net_iovs
> ("Decouple net_iov from unreadability"); the in-tree ones just happen to
> be unreadable.
Ugh, slop got in :/ I really don't think "the in-tree ones just happen
to be unreadable." I seem to recall being involved in that design.
Re: [PATCH net-next v1 00/11] xsk: Zero copy through page-pool memory providers
Author: Jakub Kicinski
Date: Wed, 18 Nov 2026 00:35
Date: Wed, 18 Nov 2026 00:35
8 lines
9321 bytes
9321 bytes
On Tue, 10 Nov 2026 11:20:21 +0100 Björn Töpel wrote: > 38 files changed, 2159 insertions(+), 225 deletions(-) > create mode 100644 net/xdp/xsk_pp.c This is much larger than I expected, and doesn't seem to be a natural extension of memory providers. For reference - did you vibe code fbnic AF_XDP support without this set? What's the LoC?
Re: [PATCH net-next v1 00/11] xsk: Zero copy through page-pool memory providers
Author: Björn Töpel
Date: Sun, 22 Nov 2026 18:12
Date: Sun, 22 Nov 2026 18:12
35 lines
9042 bytes
9042 bytes
Björn Töpel <bjorn@kernel.org> writes: > Hi! > > AF_XDP zero copy needs a second RX allocator in every driver. This > series makes UMEM a page-pool memory provider instead: a page_pool > driver opts in, and keeps its refill, recycling and DMA sync code. > fbnic is the first user. Patches 1-7 are core, 8-11 fbnic. > > Since the RFC [RFC], net_iov is a first class netmem, the core owns > AF_XDP setup, and a refill contract replaces the NAPI kicks. The fixes > are out. Hey, Thanks for all the input! TL;DR for new readers: Too much churn, especially on the driver side. net_iov was not intended to be readable from the core side of things. The net_iov part needs some deeper thinking. UMEM memory is readable (the kernel can read the memory), but needs a non-page refcounting, and benefits from the rx_buf_len (larger chunks). iouring TCP ZC frags are also readable, and the kernel does read from it from time to time, but it still unreadable. I have some ideas how to fit UMEM to the puzzle. :-) I'm working on a v2, but it'll have a different take than this version, to try to reduce the amount of driver churn. It'll probably be an RFC or a brand new v1. I'll try to address all input from this design. Cheers, and thanks all! Björn
Page 2 of 2 • 80 total messages
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads