]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, sockmap: Allow skipping sk_skb parser program
authorJohn Fastabend <john.fastabend@gmail.com>
Sun, 11 Oct 2020 05:09:38 +0000 (22:09 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 12 Oct 2020 01:09:44 +0000 (18:09 -0700)
commit0d01bf94def163e454e890f4d248ca45bad01cd6
tree66aeba7eca1e5f3098ad3c907565c11bdd88e5a7
parent46bc7fe44ffef50cb0d7d38008b2044b7fdf18d8
bpf, sockmap: Allow skipping sk_skb parser program

Currently, we often run with a nop parser namely one that just does
this, 'return skb->len'. This happens when either our verdict program
can handle streaming data or it is only looking at socket data such
as IP addresses and other metadata associated with the flow. The second
case is common for a L3/L4 proxy for instance.

So lets allow loading programs without the parser then we can skip
the stream parser logic and avoid having to add a BPF program that
is effectively a nop.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/160239297866.8495.13345662302749219672.stgit@john-Precision-5820-Tower
include/linux/skmsg.h
net/core/skmsg.c
net/core/sock_map.c