diff mbox series

[bpf-next] selftests/bpf: set unlimited RLIMIT_MEMLOCK for test_sock_fields

Message ID 20190301061816.2552119-1-yhs@fb.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf-next] selftests/bpf: set unlimited RLIMIT_MEMLOCK for test_sock_fields | expand

Commit Message

Yonghong Song March 1, 2019, 6:18 a.m. UTC
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")
Signed-off-by: Yonghong Song <yhs@fb.com>
---
 tools/testing/selftests/bpf/test_sock_fields.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Song Liu March 1, 2019, 11:08 p.m. UTC | #1
On Thu, Feb 28, 2019 at 10:20 PM Yonghong Song <yhs@fb.com> wrote:
>
> 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")
> Signed-off-by: Yonghong Song <yhs@fb.com>

Acked-by: Song Liu <songliubraving@fb.com>

> ---
>  tools/testing/selftests/bpf/test_sock_fields.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/test_sock_fields.c b/tools/testing/selftests/bpf/test_sock_fields.c
> index 9bb58369b481..bc8943938bf5 100644
> --- a/tools/testing/selftests/bpf/test_sock_fields.c
> +++ b/tools/testing/selftests/bpf/test_sock_fields.c
> @@ -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
>
Daniel Borkmann March 2, 2019, 12:10 a.m. UTC | #2
On 03/01/2019 07:18 AM, Yonghong Song wrote:
> 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")
> Signed-off-by: Yonghong Song <yhs@fb.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_sock_fields.c b/tools/testing/selftests/bpf/test_sock_fields.c
index 9bb58369b481..bc8943938bf5 100644
--- a/tools/testing/selftests/bpf/test_sock_fields.c
+++ b/tools/testing/selftests/bpf/test_sock_fields.c
@@ -14,6 +14,7 @@ 
 #include <bpf/libbpf.h>
 
 #include "cgroup_helpers.h"
+#include "bpf_rlimit.h"
 
 enum bpf_array_idx {
 	SRV_IDX,