diff mbox series

[bpf-next,v3,07/27] bpf: selftests: Set libbpf 1.0 API mode explicitly in get_cgroup_id_user

Message ID 20220405130858.12165-8-laoar.shao@gmail.com
State New
Headers show
Series bpf: RLIMIT_MEMLOCK cleanups | expand

Commit Message

Yafang Shao April 5, 2022, 1:08 p.m. UTC
Let's set libbpf 1.0 API mode explicitly, then we can get rid of the
included bpf_rlimit.h.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 tools/testing/selftests/bpf/test_dev_cgroup.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jeff Johnson April 5, 2022, 8:46 p.m. UTC | #1
On 4/5/2022 6:08 AM, Yafang Shao wrote:
> Let's set libbpf 1.0 API mode explicitly, then we can get rid of the
> included bpf_rlimit.h.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
>   tools/testing/selftests/bpf/test_dev_cgroup.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/test_dev_cgroup.c b/tools/testing/selftests/bpf/test_dev_cgroup.c

patch subject should refer to test_dev_cgroup
(currently has same subject as 05/27)

> index c299d3452695..7886265846a0 100644
> --- a/tools/testing/selftests/bpf/test_dev_cgroup.c
> +++ b/tools/testing/selftests/bpf/test_dev_cgroup.c
> @@ -15,7 +15,6 @@
>   
>   #include "cgroup_helpers.h"
>   #include "testing_helpers.h"
> -#include "bpf_rlimit.h"
>   
>   #define DEV_CGROUP_PROG "./dev_cgroup.o"
>   
> @@ -28,6 +27,9 @@ int main(int argc, char **argv)
>   	int prog_fd, cgroup_fd;
>   	__u32 prog_cnt;
>   
> +	/* Use libbpf 1.0 API mode */
> +	libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
> +
>   	if (bpf_prog_test_load(DEV_CGROUP_PROG, BPF_PROG_TYPE_CGROUP_DEVICE,
>   			  &obj, &prog_fd)) {
>   		printf("Failed to load DEV_CGROUP program\n");
Yafang Shao April 6, 2022, 2:33 p.m. UTC | #2
On Wed, Apr 6, 2022 at 4:47 AM Jeff Johnson <quic_jjohnson@quicinc.com> wrote:
>
> On 4/5/2022 6:08 AM, Yafang Shao wrote:
> > Let's set libbpf 1.0 API mode explicitly, then we can get rid of the
> > included bpf_rlimit.h.
> >
> > Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> > ---
> >   tools/testing/selftests/bpf/test_dev_cgroup.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/bpf/test_dev_cgroup.c b/tools/testing/selftests/bpf/test_dev_cgroup.c
>
> patch subject should refer to test_dev_cgroup
> (currently has same subject as 05/27)
>

Thanks for pointing this out. It was caused by the copy-and-paste :(
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_dev_cgroup.c b/tools/testing/selftests/bpf/test_dev_cgroup.c
index c299d3452695..7886265846a0 100644
--- a/tools/testing/selftests/bpf/test_dev_cgroup.c
+++ b/tools/testing/selftests/bpf/test_dev_cgroup.c
@@ -15,7 +15,6 @@ 
 
 #include "cgroup_helpers.h"
 #include "testing_helpers.h"
-#include "bpf_rlimit.h"
 
 #define DEV_CGROUP_PROG "./dev_cgroup.o"
 
@@ -28,6 +27,9 @@  int main(int argc, char **argv)
 	int prog_fd, cgroup_fd;
 	__u32 prog_cnt;
 
+	/* Use libbpf 1.0 API mode */
+	libbpf_set_strict_mode(LIBBPF_STRICT_ALL);
+
 	if (bpf_prog_test_load(DEV_CGROUP_PROG, BPF_PROG_TYPE_CGROUP_DEVICE,
 			  &obj, &prog_fd)) {
 		printf("Failed to load DEV_CGROUP program\n");