]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: sockmap redirect ingress support
authorJohn Fastabend <john.fastabend@gmail.com>
Wed, 28 Mar 2018 19:49:15 +0000 (12:49 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 29 Mar 2018 22:09:43 +0000 (00:09 +0200)
commit995b1a2f7b09942d4a2e6b3807665bf01e48da94
tree9a75574aadb3cfad15d09bffa0fe9eb6cbd9a03d
parentdd5d4b75c416faf21f688a8d119dfffe27cecb6c
bpf: sockmap redirect ingress support

Add support for the BPF_F_INGRESS flag in sk_msg redirect helper.
To do this add a scatterlist ring for receiving socks to check
before calling into regular recvmsg call path. Additionally, because
the poll wakeup logic only checked the skb recv queue we need to
add a hook in TCP stack (similar to write side) so that we have
a way to wake up polling socks when a scatterlist is redirected
to that sock.

After this all that is needed is for the redirect helper to
push the scatterlist into the psock receive queue.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/filter.h
include/net/sock.h
kernel/bpf/sockmap.c
net/core/filter.c
net/ipv4/tcp.c