[PATCH/v2] bpf: add bpf_skb_adjust_room flag BPF_F_ADJ_ROOM_ENCAP_L2_ETH

2021-02-09 Thread huangxuesen
From: huangxuesen bpf_skb_adjust_room sets the inner_protocol as skb->protocol for packets encapsulation. But that is not appropriate when pushing Ethernet header. Add an option to further specify encap L2 type and set the inner_protocol as ETH_P_TEB. Suggested-by: Willem de Bruijn Signed-

[PATCH] bpf: in bpf_skb_adjust_room correct inner protocol for vxlan

2021-02-08 Thread huangxuesen
From: huangxuesen When pushing vxlan tunnel header, set inner protocol as ETH_P_TEB in skb to avoid HW device disabling udp tunnel segmentation offload, just like vxlan_build_skb does. Drivers for NIC may invoke vxlan_features_check to check the inner_protocol in skb for vxlan packets to decide