bpf: bloom_filter memory usage
authorYafang Shao <laoar.shao@gmail.com>
Sun, 5 Mar 2023 12:46:05 +0000 (12:46 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 7 Mar 2023 17:33:42 +0000 (09:33 -0800)
commit71a49abe73cb56b15bf0701b5e98b6103480f762
treec5435d43a804735a8c7243ff0cb5ff036b31ab50
parent2f7e4ab2caa9a692ffc843f801cea90632cdc782
bpf: bloom_filter memory usage

Introduce a new helper to calculate the bloom_filter memory usage.

The result as follows,
- before
16: bloom_filter  flags 0x0
        key 0B  value 8B  max_entries 65536  memlock 524288B

- after
16: bloom_filter  flags 0x0
        key 0B  value 8B  max_entries 65536  memlock 65856B

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20230305124615.12358-9-laoar.shao@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/bloom_filter.c