]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: use per htab salt for bucket hash
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 22 Aug 2018 21:49:37 +0000 (23:49 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 23 Aug 2018 16:45:47 +0000 (18:45 +0200)
commitb10a1400d6a4adeecaf772dbe1a474c0699389eb
tree0d71d10f5a83b6bd9a2c4d309edd81d7671c095d
parent4cf21553573b265aee4d0444394df59f94dcef0b
bpf: use per htab salt for bucket hash

All BPF hash and LRU maps currently have a known and global seed
we feed into jhash() which is 0. This is suboptimal, thus fix it
by generating a random seed upon hashtab setup time which we can
later on feed into jhash() on lookup, update and deletions.

Fixes: 82ec8d67c7772 ("bpf: add hashtable type of eBPF maps")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Eduardo Valentin <eduval@amazon.com>
kernel/bpf/hashtab.c