]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: add bpf_skb_adjust_room flag BPF_F_ADJ_ROOM_FIXED_GSO
authorWillem de Bruijn <willemb@google.com>
Fri, 22 Mar 2019 18:32:55 +0000 (14:32 -0400)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 22 Mar 2019 20:52:45 +0000 (13:52 -0700)
commitf79098164b12097974da59ddb4b66645119626e0
tree0062600f6f6f0343186b9297c0402e5cf4501c96
parent4fa5e6c09952a5381b0316880112c4bb31350220
bpf: add bpf_skb_adjust_room flag BPF_F_ADJ_ROOM_FIXED_GSO

bpf_skb_adjust_room adjusts gso_size of gso packets to account for the
pushed or popped header room.

This is not allowed with UDP, where gso_size delineates datagrams. Add
an option to avoid these updates and allow this call for datagrams.

It can also be used with TCP, when MSS is known to allow headroom,
e.g., through MSS clamping or route MTU.

Changes v1->v2:
  - document flag BPF_F_ADJ_ROOM_FIXED_GSO
  - do not expose BPF_F_ADJ_ROOM_MASK through uapi, as it may change.

Link: https://patchwork.ozlabs.org/patch/1052497/
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/uapi/linux/bpf.h
net/core/filter.c