diff options
author | Jakub Sitnicki <jakub@cloudflare.com> | 2020-02-18 17:10:20 +0000 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-02-21 22:29:45 +0100 |
commit | 9fed9000c5c6cacfcaaa48aff74818072ae294cc (patch) | |
tree | 66854f14a43c09c2aea3c3c5e6e5ed93a65a1aea /kernel/bpf/reuseport_array.c | |
parent | 1d59f3bcee356caa933646dc45ff0836455535e8 (diff) | |
download | linux-9fed9000c5c6cacfcaaa48aff74818072ae294cc.tar.gz linux-9fed9000c5c6cacfcaaa48aff74818072ae294cc.tar.bz2 linux-9fed9000c5c6cacfcaaa48aff74818072ae294cc.zip |
bpf: Allow selecting reuseport socket from a SOCKMAP/SOCKHASH
SOCKMAP & SOCKHASH now support storing references to listening
sockets. Nothing keeps us from using these map types a collection of
sockets to select from in BPF reuseport programs. Whitelist the map types
with the bpf_sk_select_reuseport helper.
The restriction that the socket has to be a member of a reuseport group
still applies. Sockets in SOCKMAP/SOCKHASH that don't have sk_reuseport_cb
set are not a valid target and we signal it with -EINVAL.
The main benefit from this change is that, in contrast to
REUSEPORT_SOCKARRAY, SOCK{MAP,HASH} don't impose a restriction that a
listening socket can be just one BPF map at the same time.
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200218171023.844439-9-jakub@cloudflare.com
Diffstat (limited to 'kernel/bpf/reuseport_array.c')
0 files changed, 0 insertions, 0 deletions