]> git.baikalelectronics.ru Git - kernel.git/commit
tools/bpf: fix test_sockmap failure
authorYonghong Song <yhs@fb.com>
Thu, 21 Jun 2018 17:02:20 +0000 (10:02 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 21 Jun 2018 22:31:42 +0000 (00:31 +0200)
commit723489a9082a79a4a2c1b91212d2361457ca86ba
treef3be2d526350b7529df5e53b7f69284d50ebf15b
parent71de3389cdfb13fdd8256b8cadd1133cfc19b3de
tools/bpf: fix test_sockmap failure

On one of our production test machine, when running
bpf selftest test_sockmap, I got the following error:
  # sudo ./test_sockmap
  libbpf: failed to create map (name: 'sock_map'): Operation not permitted
  libbpf: failed to load object 'test_sockmap_kern.o'
  libbpf: Can't get the 0th fd from program sk_skb1: only -1 instances
  ......
  load_bpf_file: (-1) Operation not permitted
  ERROR: (-1) load bpf failed

The error is due to not-big-enough rlimit
  struct rlimit r = {10 * 1024 * 1024, RLIM_INFINITY};

The test already includes "bpf_rlimit.h", which sets current
and max rlimit to RLIM_INFINITY. Let us just use it.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_sockmap.c