]> 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)
commit9d554c58bc5d9da3cc24115b1f5172cbcd5d50d3
tree66aeba7eca1e5f3098ad3c907565c11bdd88e5a7
parent689f66799e0708609659af7eebaf6f156ae61d81
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