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@xxxxxxxxxxxxxx/#r
[bnxt] https://lore.kernel.org/all/
f804c22ca168ec3aedb0ee754bfbee71764eb894.1718919473.git.yan@xxxxxxxxxxxxxx/
[mlx5] https://lore.kernel.org/
all/17595a278ee72964b83c0bd0b502152aa025f600.1718919473.git.yan@xxxxxxxxxxxxxx/
[ice] https://lore.kernel.org/all/
a9eba425bfd3bfac7e7be38fe86ad5dbff3ae01f.1718919473.git.yan@xxxxxxxxxxxxxx/
[veth] https://lore.kernel.org/all/
b7c75daecca9c4e36ef79af683d288653a9b5b82.1718919473.git.yan@xxxxxxxxxxxxxx/
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.