Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Jesper Dangaard Brouer
Tue, 10 Nov 2026 14:20
Re: [PATCH bpf-next 04/15] xdp: add a kfunc to delete skb core extension entries
Author: Jesper Dangaard Brouer
Date: Tue, 10 Nov 2026 14:20
Date: Tue, 10 Nov 2026 14:20
34 lines
10620 bytes
10620 bytes
On 11/10/26 04:57, Tianyi Gao wrote: > bpf_xdp_skb_ext_del() deletes the stored entry for an id. A program on > cpumap or veth can use it to drop RX metadata that an earlier program > stored. > > Without the XDP_FLAGS_HAS_SKB_EXT flag, the kfunc does nothing, because > the header bytes may then belong to the packet. > > The kfunc only clears XDP_SKB_EXT_ENTRY_ACTIVE, so a later store of the > same id reuses its offset. The flag and the size of the area stay the > same, also after the last delete. To give the bytes back, the kfunc > would have to move the entries after the deleted one. The cost is > headroom that bpf_xdp_adjust_head() and bpf_xdp_adjust_meta() cannot > use. > > Signed-off-by: Tianyi Gao <tianyi@cloudflare.com> > --- > __skb_ext_del() frees struct skb_ext after the last delete, because it > comes from a slab cache. The skb core extension area uses existing > headroom, so it is not freed. > --- > include/net/xdp.h | 8 ++++++++ > net/core/xdp.c | 26 ++++++++++++++++++++++++++ > 2 files changed, 34 insertions(+) I think this approach of simply disabling the entry is okay. This is trading off performance vs small area memory usage. Acked-by: Jesper Dangaard Brouer <hawk@kernel.org> --Jesper
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