aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_dev_cgroup.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-02-26 22:34:32 +0100
committerAlexei Starovoitov <ast@kernel.org>2018-02-26 20:11:23 -0800
commitfe8d662aef26394388bfcd3b96ce123b6d33044b (patch)
treec236669015f5b2b435d0283f3d6f62f30cdc552c /tools/testing/selftests/bpf/test_dev_cgroup.c
parentMerge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue (diff)
downloadlinux-dev-fe8d662aef26394388bfcd3b96ce123b6d33044b.tar.xz
linux-dev-fe8d662aef26394388bfcd3b96ce123b6d33044b.zip
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 '')
-rw-r--r--tools/testing/selftests/bpf/test_dev_cgroup.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/test_dev_cgroup.c b/tools/testing/selftests/bpf/test_dev_cgroup.c
index 3489cc283433..9c8b50bac7e0 100644
--- a/tools/testing/selftests/bpf/test_dev_cgroup.c
+++ b/tools/testing/selftests/bpf/test_dev_cgroup.c
@@ -11,13 +11,13 @@
#include <errno.h>
#include <assert.h>
#include <sys/time.h>
-#include <sys/resource.h>
#include <linux/bpf.h>
#include <bpf/bpf.h>
#include <bpf/libbpf.h>
#include "cgroup_helpers.h"
+#include "bpf_rlimit.h"
#define DEV_CGROUP_PROG "./dev_cgroup.o"
@@ -25,15 +25,11 @@
int main(int argc, char **argv)
{
- struct rlimit limit = { RLIM_INFINITY, RLIM_INFINITY };
struct bpf_object *obj;
int error = EXIT_FAILURE;
int prog_fd, cgroup_fd;
__u32 prog_cnt;
- if (setrlimit(RLIMIT_MEMLOCK, &limit) < 0)
- perror("Unable to lift memlock rlimit");
-
if (bpf_prog_load(DEV_CGROUP_PROG, BPF_PROG_TYPE_CGROUP_DEVICE,
&obj, &prog_fd)) {
printf("Failed to load DEV_CGROUP program\n");