diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-02-26 22:34:32 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-02-26 20:11:23 -0800 |
commit | fe8d662aef26394388bfcd3b96ce123b6d33044b (patch) | |
tree | c236669015f5b2b435d0283f3d6f62f30cdc552c /tools/testing/selftests/bpf/test_lru_map.c | |
parent | 3808b51911fe1a2bf8d6f4f2836d4c51aa29a6fd (diff) |
bpf: unify rlimit handling in selftests
Unify memlock handling into bpf_rlimit.h and replace all occurences
in BPF kselftests with it.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_lru_map.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_lru_map.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/test_lru_map.c b/tools/testing/selftests/bpf/test_lru_map.c index 8c10c9180c1a..781c7de343be 100644 --- a/tools/testing/selftests/bpf/test_lru_map.c +++ b/tools/testing/selftests/bpf/test_lru_map.c @@ -16,10 +16,11 @@ #include <time.h> #include <sys/wait.h> -#include <sys/resource.h> #include <bpf/bpf.h> + #include "bpf_util.h" +#include "bpf_rlimit.h" #define LOCAL_FREE_TARGET (128) #define PERCPU_FREE_TARGET (4) @@ -613,7 +614,6 @@ static void test_lru_sanity6(int map_type, int map_flags, int tgt_free) int main(int argc, char **argv) { - struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; int map_types[] = {BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH}; int map_flags[] = {0, BPF_F_NO_COMMON_LRU}; @@ -621,8 +621,6 @@ int main(int argc, char **argv) setbuf(stdout, NULL); - assert(!setrlimit(RLIMIT_MEMLOCK, &r)); - nr_cpus = bpf_num_possible_cpus(); assert(nr_cpus != -1); printf("nr_cpus:%d\n\n", nr_cpus); |