diff options
author | John Fastabend <john.fastabend@gmail.com> | 2018-05-14 20:00:17 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-05-15 21:41:03 +0300 |
commit | 81110384441a59cff47430f20f049e69b98c17f4 (patch) | |
tree | 4c178876a42538fbefb50678562f9801a805d667 /kernel/bpf/core.c | |
parent | e5cd3abcb31a48d4ea91bd32f0618802ca5f3592 (diff) | |
download | linux-81110384441a59cff47430f20f049e69b98c17f4.tar.xz |
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>
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r-- | kernel/bpf/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index d0d7d9462368..2194c6a9df42 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -1707,6 +1707,7 @@ const struct bpf_func_proto bpf_get_current_pid_tgid_proto __weak; const struct bpf_func_proto bpf_get_current_uid_gid_proto __weak; const struct bpf_func_proto bpf_get_current_comm_proto __weak; const struct bpf_func_proto bpf_sock_map_update_proto __weak; +const struct bpf_func_proto bpf_sock_hash_update_proto __weak; const struct bpf_func_proto * __weak bpf_get_trace_printk_proto(void) { |