Skip to contentSkip to conversation

selftests/bpf: set unlimited RLIMIT_MEMLOCK for test_sock_fields

PATCH Applied Yonghong Song 3 participants 3 messages Mar 1, 2019 – Mar 2, 2019

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

PATCH 1/1 selftests/bpf: set unlimited RLIMIT_MEMLOCK for test_sock_fields

This is to avoid permission denied error. A lot of systems may have a much lower number, e.g., 64KB, for RLIMIT_MEMLOCK, which may not be sufficient for the test to run successfully.

Fixes e0b27b3f97b8 ("bpf: Add test_sock_fields for skb->sk and bpf_tcp_sock")
---
 tools/testing/selftests/bpf/test_sock_fields.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/test_sock_fields.c +1 -0
index 9bb58369b481..bc8943938bf5 100644
@@ -14,6 +14,7 @@
 #include <bpf/libbpf.h>
 
 #include "cgroup_helpers.h"
+#include "bpf_rlimit.h"
 
 enum bpf_array_idx {
 	SRV_IDX,
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Yonghong Song

This is to avoid permission denied error. A lot of systems may have a much lower number, e.g., 64KB, for RLIMIT_MEMLOCK, which may not be sufficient for the test to run successfully.

Fixes e0b27b3f97b8 ("bpf: Add test_sock_fields for skb->sk and bpf_tcp_sock")
Quoted 19 lines
---
 tools/testing/selftests/bpf/test_sock_fields.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/test_sock_fields.c +1 -1
index 9bb58369b481..bc8943938bf5 100644
@@ -14,6 +14,7 @@
 #include <bpf/libbpf.h>
 
 #include "cgroup_helpers.h"
+#include "bpf_rlimit.h"
 
 enum bpf_array_idx {
        SRV_IDX,
--

2.17.1

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

This is to avoid permission denied error. A lot of systems may have a much lower number, e.g., 64KB, for RLIMIT_MEMLOCK, which may not be sufficient for the test to run successfully.

Fixes e0b27b3f97b8 ("bpf: Add test_sock_fields for skb->sk and bpf_tcp_sock")

Applied, thanks!