bpf: add bpf_skb_adjust_room encap flags
authorWillem de Bruijn <willemb@google.com>
Fri, 22 Mar 2019 18:32:56 +0000 (14:32 -0400)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 22 Mar 2019 20:52:45 +0000 (13:52 -0700)
commit868d523535c2d00b696753ece606e641a816e91e
tree15da75a49cc199d51682617dc9974239c7933c76
parent2278f6cc151a8bef6ba0b3fe3009d14dc3c51c4a
bpf: add bpf_skb_adjust_room encap flags

When pushing tunnel headers, annotate skbs in the same way as tunnel
devices.

For GSO packets, the network stack requires certain fields set to
segment packets with tunnel headers. gro_gse_segment depends on
transport and inner mac header, for instance.

Add an option to pass this information.

Remove the restriction on len_diff to network header length, which
is too short, e.g., for GRE protocols.

Changes
  v1->v2:
  - document new flags
  - BPF_F_ADJ_ROOM_MASK moved
  v2->v3:
  - BPF_F_ADJ_ROOM_ENCAP_L3_MASK moved

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