libbpf: Extract generic string hashing function for reuse

Calculating a hash of zero-terminated string is a common need when using
hashmap, so extract it for reuse.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200926011357.2366158-5-andriin@fb.com
This commit is contained in:
Andrii Nakryiko 2020-09-25 18:13:52 -07:00 • committed by Alexei Starovoitov
commit 7d9c71e10b
2 changed files with 13 additions and 8 deletions