Skip to contentSkip to conversation

tools/bpf: add unlimited rlimit for flow_dissector_load

PATCH Applied Yonghong Song 3 participants 3 messages Oct 30, 2018 – Oct 31, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/bpf: add unlimited rlimit for flow_dissector_load

On our test machine, bpf selftest test_flow_dissector.sh failed with the following error:

  # ./test_flow_dissector.sh
  bpffs not mounted. Mounting...
  libbpf: failed to create map (name: 'jmp_table'): Operation not permitted
  libbpf: failed to load object 'bpf_flow.o'
  ./flow_dissector_load: bpf_prog_load bpf_flow.o
  selftests: test_flow_dissector [FAILED]

Let us increase the rlimit to remove the above map creation failure.

---
 tools/testing/selftests/bpf/flow_dissector_load.c | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/bpf/flow_dissector_load.c +2 -0
index d3273b5b3173..ae8180b11d5f 100644
@@ -11,6 +11,8 @@
 #include <bpf/bpf.h>
 #include <bpf/libbpf.h>
 
+#include "bpf_rlimit.h"
+
 const char *cfg_pin_path = "/sys/fs/bpf/flow_dissector";
 const char *cfg_map_name = "jmp_table";
 bool cfg_attach = true;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Yonghong Song

On our test machine, bpf selftest test_flow_dissector.sh failed with the following error:

  # ./test_flow_dissector.sh
  bpffs not mounted. Mounting...
  libbpf: failed to create map (name: 'jmp_table'): Operation not permitted
  libbpf: failed to load object 'bpf_flow.o'
  ./flow_dissector_load: bpf_prog_load bpf_flow.o
  selftests: test_flow_dissector [FAILED]
Quoted 4 lines

Let us increase the rlimit to remove the above map creation failure.

Quoted 20 lines
---
 tools/testing/selftests/bpf/flow_dissector_load.c | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/bpf/flow_dissector_load.c +2 -1
index d3273b5b3173..ae8180b11d5f 100644
@@ -11,6 +11,8 @@
 #include <bpf/bpf.h>
 #include <bpf/libbpf.h>
 
+#include "bpf_rlimit.h"
+
 const char *cfg_pin_path = "/sys/fs/bpf/flow_dissector";
 const char *cfg_map_name = "jmp_table";
 bool cfg_attach = true;
--

2.17.1

maintainer Applied
#2 lore raw
In reply to Yonghong Song
Quoted 9 lines · Yonghong Song

On our test machine, bpf selftest test_flow_dissector.sh failed with the following error:

  # ./test_flow_dissector.sh
  bpffs not mounted. Mounting...
  libbpf: failed to create map (name: 'jmp_table'): Operation not permitted
  libbpf: failed to load object 'bpf_flow.o'
  ./flow_dissector_load: bpf_prog_load bpf_flow.o
  selftests: test_flow_dissector [FAILED]
Quoted 4 lines

Let us increase the rlimit to remove the above map creation failure.

Applied to bpf, thanks!