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

From: Martin KaFai Lau <[email-masked]>
Date: Tue, 12 Aug 2025 19:59:49 -0700

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/[email-masked]/#r
> 
> [bnxt] https://lore.kernel.org/all/ 
> [email-masked]/
> 
> [mlx5] https://lore.kernel.org/ 
> all/[email-masked]/
> 
> [ice] https://lore.kernel.org/all/ 
> [email-masked]/
> 
> [veth] https://lore.kernel.org/all/ 
> [email-masked]/

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.