Thread View: linux.kernel.netdev
4 messages
4 total messages
Started by Jakub Kicinski
Sun, 15 Nov 2026 19:39
Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation
Author: Jakub Kicinski
Date: Sun, 15 Nov 2026 19:39
Date: Sun, 15 Nov 2026 19:39
11 lines
9978 bytes
9978 bytes
On Wed, 11 Nov 2026 01:07:46 +0000 Tianyi Gao wrote: > - On veth, an XDP program removes software GSO from the peer, limits > its MTU, and can copy skbs from the peer. Could you remind us why you XDP_REDIRECT xdp_frames to the veth if you end up allocating the skb on the veth, anyway? I thought that was to let veth run its own prog before skb is allocated but you're saying that you want to avoid veth having a prog, so clearly it's not that.
Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation
Author: Jakub Kicinski
Date: Mon, 16 Nov 2026 22:27
Date: Mon, 16 Nov 2026 22:27
39 lines
11466 bytes
11466 bytes
On Sun, 15 Nov 2026 23:36:34 +0000 Tianyi Gao wrote:
> On Sun, 15 Nov 2026 11:39:02 -0800 Jakub Kicinski wrote:
> > On Wed, 11 Nov 2026 01:07:46 +0000 Tianyi Gao wrote:
> > > - On veth, an XDP program removes software GSO from the peer, limits
> > > its MTU, and can copy skbs from the peer.
> >
> > Could you remind us why you XDP_REDIRECT xdp_frames to the veth
> > if you end up allocating the skb on the veth, anyway?
> >
> > I thought that was to let veth run its own prog before skb is allocated
> > but you're saying that you want to avoid veth having a prog, so clearly
> > it's not that.
>
> Thank you for your comment!
>
> XDP_REDIRECT into a veth without a program on it has been supported
> since commit 0e672f306a28 ("veth: check for NAPI instead of xdp_prog
> before xmit of XDP frame"). There is demand for it [1].
>
> With or without a program on the veth, and on cpumap, this series
> keeps the RX metadata from the NIC until the skb is built.
>
> [1] https://lore.kernel.org/all/20210416175929.35c3c389@carbon/
Perhaps I'm slow but I don't see how this answers my question.
I read your reply as "the config is supported and my team uses it".
The question is _why_ you use it. Let's leave the cpumap case aside,
you provided no legitimate reason why having an XDP prog in that case
is a problem. With veth - you are right that attaching XDP causes
problems for pure skb traffic. For veth cases, however, there's no
strong reason to delay the skb allocation. Hence my question.
Why not let the driver allocate the skb if we know that the
redirect target will need to allocate one, anyway.
Since your patches are not a natural / clean extension of the existing
infrastructure - we should step back and make sure the use case is
practically justified.
Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation
Author: Jakub Kicinski
Date: Wed, 18 Nov 2026 00:18
Date: Wed, 18 Nov 2026 00:18
57 lines
12513 bytes
12513 bytes
On Mon, 16 Nov 2026 23:55:42 +0000 Tianyi Gao wrote: > On Mon, 16 Nov 2026 14:27:10 -0800 Jakub Kicinski wrote: > > The question is _why_ you use it. Let's leave the cpumap case aside, > > you provided no legitimate reason why having an XDP prog in that case > > is a problem. With veth - you are right that attaching XDP causes > > problems for pure skb traffic. For veth cases, however, there's no > > strong reason to delay the skb allocation. Hence my question. > > Why not let the driver allocate the skb if we know that the > > redirect target will need to allocate one, anyway. > > Sorry for not being clear enough. > > On the setup we want to build: an XDP program on the NIC does the > decap for all traffic. The services run in namespaces, so the packets > must be delivered into them. Some services attach their own XDP > program to the veth, and some do not. The host does not control the > service's program. The host doesn't have to control the program, just know whether the program will be attached, and therefore whether to use TC or XDP. > For a veth with a program, the skb path has the problems you mention, > so the host uses XDP_REDIRECT. For a veth without a program, we want > to use XDP_REDIRECT too, so that the host delivers to every namespace > in the same way. > > In a minimal benchmark, pktgen sends UDP, and perf stat counts the > cycles on the RX CPU. bpf_redirect_peer() from tc costs 3% more > cycles per packet than XDP_REDIRECT with the checksum status kept > (mlx5, one extra __netif_receive_skb_core()). So one XDP_REDIRECT path > for all namespaces is both simpler and cheaper. That's noise. > > Since your patches are not a natural / clean extension of the existing > > infrastructure - we should step back and make sure the use case is > > practically justified. > > Maybe I am missing something here. XDP_REDIRECT into a veth works > without an XDP program on the veth. To me, it is natural that the RX > metadata also reaches the skb on that path, without attaching an extra > XDP program. Sure, nobody is arguing whether in an ideal world the metadata would be magically available everywhere. Inventing a new way of storing metadata (either in this set or Alexei's simpler proposal) doesn't integrate naturally with HW drivers. And duplicates the information. Fast packet processing at HW drivers is the primary use case for XDP, we should keep that front of mind when designing. You want to cross from XDP realm to skb realm, after frame left the scope of the original driver, and with no BPF involvement. These constraints are unreasonable, and leave only clumsy and inflexible solution on the table.
Re: [PATCH bpf-next 00/15] xdp: add SKB core extensions to keep RX metadata until skb creation
Author: Jakub Kicinski
Date: Wed, 18 Nov 2026 23:35
Date: Wed, 18 Nov 2026 23:35
14 lines
10430 bytes
10430 bytes
On Wed, 18 Nov 2026 00:42:55 +0000 Tianyi Gao wrote: > But I see a fundamental mismatch between reading and writing the RX > metadata: > > - To read it, we must go through the driver callbacks, because each > driver keeps it in its own descriptor format. > > - To write it, the target is always the xdp_frame or the skb, and > both are the same for every driver. Sorry to labor the point but the assertion that the write API has to be operating on a completely separate copy of the information, via a completely separate API is unproven IMO.
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