diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-01-27 17:09:13 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-01-27 21:15:00 +0300 |
commit | 46531a30364bd483bfa1b041c15d42a196e77e93 (patch) | |
tree | 058f81a4a545928c2238696266f2620284982708 /include/linux/btf.h | |
parent | cdb5ed9796e70ca666863eff65cf4907da5fe13c (diff) | |
download | linux-46531a30364bd483bfa1b041c15d42a196e77e93.tar.xz |
cgroup/bpf: fast path skb BPF filtering
Even though there is a static key protecting from overhead from
cgroup-bpf skb filtering when there is nothing attached, in many cases
it's not enough as registering a filter for one type will ruin the fast
path for all others. It's observed in production servers I've looked
at but also in laptops, where registration is done during init by
systemd or something else.
Add a per-socket fast path check guarding from such overhead. This
affects both receive and transmit paths of TCP, UDP and other
protocols. It showed ~1% tx/s improvement in small payload UDP
send benchmarks using a real NIC and in a server environment and the
number jumps to 2-3% for preemtible kernels.
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/r/d8c58857113185a764927a46f4b5a058d36d3ec3.1643292455.git.asml.silence@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/btf.h')
0 files changed, 0 insertions, 0 deletions