]> 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)
commit679527fbe790f2a6c8a409422cd47d3a93276d3d
tree0062600f6f6f0343186b9297c0402e5cf4501c96
parent7263d95065714edff272875f19e64c3aa04c14b3
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