]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: sockmap, add hash map support
authorJohn Fastabend <john.fastabend@gmail.com>
Mon, 14 May 2018 17:00:17 +0000 (10:00 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 15 May 2018 18:41:03 +0000 (20:41 +0200)
commit11052050f9ca0e2a100775f370e13eaefb2f1aea
tree4c178876a42538fbefb50678562f9801a805d667
parent2246965e6b021095d52f9242d35ed4bb956b9b14
bpf: sockmap, add hash map support

Sockmap is currently backed by an array and enforces keys to be
four bytes. This works well for many use cases and was originally
modeled after devmap which also uses four bytes keys. However,
this has become limiting in larger use cases where a hash would
be more appropriate. For example users may want to use the 5-tuple
of the socket as the lookup key.

To support this add hash support.

Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
include/linux/bpf_types.h
include/uapi/linux/bpf.h
kernel/bpf/core.c
kernel/bpf/sockmap.c
kernel/bpf/verifier.c
net/core/filter.c