Commit 6467acbc authored by Martin KaFai Lau's avatar Martin KaFai Lau Committed by David S. Miller

bpf: lru: Cleanup test_lru_map.c

This patch does the following cleanup on test_lru_map.c
1) Fix indentation (Replace spaces by tabs)
2) Remove redundant BPF_F_NO_COMMON_LRU test
3) Simplify some comments
Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9746f856
...@@ -191,12 +191,7 @@ static void test_lru_sanity1(int map_type, int map_flags, unsigned int tgt_free) ...@@ -191,12 +191,7 @@ static void test_lru_sanity1(int map_type, int map_flags, unsigned int tgt_free)
int next_cpu = 0; int next_cpu = 0;
if (map_flags & BPF_F_NO_COMMON_LRU) if (map_flags & BPF_F_NO_COMMON_LRU)
/* Ther percpu lru list (i.e each cpu has its own LRU /* This test is only applicable to common LRU list */
* list) does not have a local free list. Hence,
* it will only free old nodes till there is no free
* from the LRU list. Hence, this test does not apply
* to BPF_F_NO_COMMON_LRU
*/
return; return;
printf("%s (map_type:%d map_flags:0x%X): ", __func__, map_type, printf("%s (map_type:%d map_flags:0x%X): ", __func__, map_type,
...@@ -273,12 +268,7 @@ static void test_lru_sanity2(int map_type, int map_flags, unsigned int tgt_free) ...@@ -273,12 +268,7 @@ static void test_lru_sanity2(int map_type, int map_flags, unsigned int tgt_free)
int next_cpu = 0; int next_cpu = 0;
if (map_flags & BPF_F_NO_COMMON_LRU) if (map_flags & BPF_F_NO_COMMON_LRU)
/* Ther percpu lru list (i.e each cpu has its own LRU /* This test is only applicable to common LRU list */
* list) does not have a local free list. Hence,
* it will only free old nodes till there is no free
* from the LRU list. Hence, this test does not apply
* to BPF_F_NO_COMMON_LRU
*/
return; return;
printf("%s (map_type:%d map_flags:0x%X): ", __func__, map_type, printf("%s (map_type:%d map_flags:0x%X): ", __func__, map_type,
...@@ -290,10 +280,6 @@ static void test_lru_sanity2(int map_type, int map_flags, unsigned int tgt_free) ...@@ -290,10 +280,6 @@ static void test_lru_sanity2(int map_type, int map_flags, unsigned int tgt_free)
assert(batch_size * 2 == tgt_free); assert(batch_size * 2 == tgt_free);
map_size = tgt_free + batch_size; map_size = tgt_free + batch_size;
if (map_flags & BPF_F_NO_COMMON_LRU)
lru_map_fd = create_map(map_type, map_flags,
map_size * nr_cpus);
else
lru_map_fd = create_map(map_type, map_flags, map_size); lru_map_fd = create_map(map_type, map_flags, map_size);
assert(lru_map_fd != -1); assert(lru_map_fd != -1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment