Thread (39 messages) 39 messages, 6 authors, 2025-08-13

Re: [PATCH bpf-next V2 0/7] xdp: Allow BPF to set RX hints for XDP_REDIRECTed packets

From: Martin KaFai Lau <martin.lau@linux.dev>
Date: 2025-08-13 03:00:10
Also in: bpf

On 8/7/25 12:07 PM, Jesper Dangaard Brouer wrote:
Yan and I have previously[1] (Oct 2024) explored adding a common
callback to XDP drivers, which have access to both the xdp_buff and SKB
in the function call. (Ignore the GRO disable bit, focus on callback)

We named the functions: xdp_buff_fixup_skb_offloading() and
  xdp_frame_fixup_skb_offloading()
We implemented the driver changes for [bnxt], [mlx5], [ice] and [veth].

What do you think of the idea of adding a BPF-hook, at this callback,
which have access to both the XDP and SKB pointer.
That would allow us to implement your idea, right?

[1] https://lore.kernel.org/all/cover.1718919473.git.yan@cloudflare.com/#r (local)

[bnxt] https://lore.kernel.org/all/ 
f804c22ca168ec3aedb0ee754bfbee71764eb894.1718919473.git.yan@cloudflare.com/

[mlx5] https://lore.kernel.org/ 
all/17595a278ee72964b83c0bd0b502152aa025f600.1718919473.git.yan@cloudflare.com/

[ice] https://lore.kernel.org/all/ 
a9eba425bfd3bfac7e7be38fe86ad5dbff3ae01f.1718919473.git.yan@cloudflare.com/

[veth] https://lore.kernel.org/all/ 
b7c75daecca9c4e36ef79af683d288653a9b5b82.1718919473.git.yan@cloudflare.com/
It should not need a new BPF-hook to consume info produced by an earlier xdp 
prog. Instead, the same and existing xdp prog can call a kfunc to directly 
create the skb and update the skb fields. The kfunc could be driver specific, 
like the current .xmo_rx_xxx.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help