bpf: Add lru_hash_lookup performance test
authorMartin KaFai Lau <kafai@fb.com>
Fri, 1 Sep 2017 06:27:11 +0000 (23:27 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Sep 2017 16:57:38 +0000 (09:57 -0700)
commit637cd8c312d8caf234821fd37238b8f956d9ab13
treeb422830fb0c110f940499c839b3cb1e2f2ef1f67
parent08daaec742d170eabe7f8355c2f86fc8be166f10
bpf: Add lru_hash_lookup performance test

Create a new case to test the LRU lookup performance.

At the beginning, the LRU map is fully loaded (i.e. the number of keys
is equal to map->max_entries).   The lookup is done through key 0
to num_map_entries and then repeats from 0 again.

This patch also creates an anonymous struct to properly
name the test params in stress_lru_hmap_alloc() in map_perf_test_kern.c.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
samples/bpf/map_perf_test_kern.c
samples/bpf/map_perf_test_user.c