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)
commitef5659280eb13e8ac31c296f58cfdfa1684ac06b
tree66aeba7eca1e5f3098ad3c907565c11bdd88e5a7
parent743df8b7749fb5a289fc0c7ac94ec15533596839
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