🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Jesper Dangaard Brouer Tue, 10 Nov 2026 13:10
Re: [PATCH bpf-next 01/15] xdp: reserve an skb core extension area after the xdp_frame
#14001
Author: Jesper Dangaard Brouer
Date: Tue, 10 Nov 2026 13:10
47 lines
11140 bytes

On 11/10/26 04:56, Tianyi Gao wrote:
> Reserve the skb core extension area in the headroom, right after the
> xdp_frame. An XDP program stores RX metadata there for the skb that is
> built later.
> 
> The area begins with a header, struct xdp_skb_ext. It records the offset
> of each entry and the end of the last entry, in 4-byte units.
> bpf_xdp_adjust_head(), bpf_xdp_adjust_meta() and bpf_xdp_pull_data() use
> xdp_skb_ext_end() as their lower bound, so packet data and metadata
> cannot overwrite the entries.
> 
> The XDP_FLAGS_HAS_SKB_EXT flag indicates that the header is valid. Most
> drivers reuse the xdp_buff between packets, so xdp_prepare_buff() clears
> it. With BPF_F_TEST_XDP_LIVE_FRAMES, reset_ctx() restores the flags
> before each run, and ctx_was_changed() compares them.
> 
> Suggested-by: Jesper Dangaard Brouer <hawk@kernel.org>
> Link: https://lore.kernel.org/all/1d5521eb-84fc-4417-a3f5-6366694d160a@kernel.org/
> Signed-off-by: Tianyi Gao <tianyi@cloudflare.com>
> ---
>   include/net/xdp.h  | 45 +++++++++++++++++++++++++++++++++++++++++++++
>   net/bpf/test_run.c |  4 +++-
>   net/core/filter.c  |  8 +++-----
>   3 files changed, 51 insertions(+), 6 deletions(-)
> 
> diff --git a/include/net/xdp.h b/include/net/xdp.h
> index 07231adfb5f8..c888353425d4 100644
> --- a/include/net/xdp.h
> +++ b/include/net/xdp.h
> @@ -81,6 +81,9 @@ enum xdp_buff_flags {
>   	 * XDP program is not attached.
>   	 */
>   	XDP_FLAGS_FRAGS_UNREADABLE	= BIT(2),
> +	XDP_FLAGS_HAS_SKB_EXT		= BIT(3), /* skb core extension header
> +						   * is valid
> +						   */

This can be on 1-line (80 chars) of you change the comment to be:
  /* skb core ext hdr valid */

>   };
The rest looks good to me.

Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
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