Re: [PATCH v5 5/6] bpf: clear decap tunnel GSO state in skb_adjust_room

From: Willem de Bruijn

Date: Mon Apr 20 2026 - 15:46:34 EST


Nick Hudson wrote:
> On shrink in bpf_skb_adjust_room(), clear tunnel-specific GSO flags
> according to the decapsulation flags:
>
> - BPF_F_ADJ_ROOM_DECAP_L4_UDP clears SKB_GSO_UDP_TUNNEL{,_CSUM}
> - BPF_F_ADJ_ROOM_DECAP_L4_GRE clears SKB_GSO_GRE{,_CSUM}
> - BPF_F_ADJ_ROOM_DECAP_IPXIP4 clears SKB_GSO_IPXIP4
> - BPF_F_ADJ_ROOM_DECAP_IPXIP6 clears SKB_GSO_IPXIP6
>
> When all tunnel-related GSO bits are cleared, also clear
> skb->encapsulation.
>
> Handle the ESP inside a UDP tunnel case where encapsulation should remain
> set.
>
> Co-developed-by: Max Tottenham <mtottenh@xxxxxxxxxx>
> Signed-off-by: Max Tottenham <mtottenh@xxxxxxxxxx>
> Co-developed-by: Anna Glasgall <aglasgal@xxxxxxxxxx>
> Signed-off-by: Anna Glasgall <aglasgal@xxxxxxxxxx>
> Signed-off-by: Nick Hudson <nhudson@xxxxxxxxxx>

Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>