]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add gso_size to __sk_buff
authorWillem de Bruijn <willemb@google.com>
Tue, 3 Mar 2020 20:05:01 +0000 (15:05 -0500)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 4 Mar 2020 00:23:59 +0000 (16:23 -0800)
commitc98b3fc104f06b890f1d3e3587d409998fd61789
tree9daf8bfb7c74ff98ca4c507f8d5bf8184c4d7bec
parent579aa03b7e1010ce5a3ba29e161649f9b49cb4a8
bpf: Add gso_size to __sk_buff

BPF programs may want to know whether an skb is gso. The canonical
answer is skb_is_gso(skb), which tests that gso_size != 0.

Expose this field in the same manner as gso_segs. That field itself
is not a sufficient signal, as the comment in skb_shared_info makes
clear: gso_segs may be zero, e.g., from dodgy sources.

Also prepare net/bpf/test_run for upcoming BPF_PROG_TEST_RUN tests
of the feature.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200303200503.226217-2-willemdebruijn.kernel@gmail.com
include/uapi/linux/bpf.h
net/bpf/test_run.c
net/core/filter.c