diff mbox series

[bpf-next] bpf: Increase MAX_NR_MAPS to 17 in test_verifier.c

Message ID 20190418213330.225474-1-kafai@fb.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf-next] bpf: Increase MAX_NR_MAPS to 17 in test_verifier.c | expand

Commit Message

Martin KaFai Lau April 18, 2019, 9:33 p.m. UTC
map_fds[16] is the last one index-ed by fixup_map_array_small.
Hence, the MAX_NR_MAPS should be 17 instead.

Fixes: fb2abb73e575 ("bpf, selftest: test {rd, wr}only flags and direct value access")
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
---
 tools/testing/selftests/bpf/test_verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yonghong Song April 18, 2019, 9:45 p.m. UTC | #1
On 4/18/19 2:33 PM, Martin KaFai Lau wrote:
> map_fds[16] is the last one index-ed by fixup_map_array_small.
> Hence, the MAX_NR_MAPS should be 17 instead.
> 
> Fixes: fb2abb73e575 ("bpf, selftest: test {rd, wr}only flags and direct value access")
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Acked-by: Yonghong Song <yhs@fb.com>

> ---
>   tools/testing/selftests/bpf/test_verifier.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
> index 6cb6a1074fd1..ed9e894afef3 100644
> --- a/tools/testing/selftests/bpf/test_verifier.c
> +++ b/tools/testing/selftests/bpf/test_verifier.c
> @@ -52,7 +52,7 @@
>   #define MAX_INSNS	BPF_MAXINSNS
>   #define MAX_TEST_INSNS	1000000
>   #define MAX_FIXUPS	8
> -#define MAX_NR_MAPS	16
> +#define MAX_NR_MAPS	17
>   #define MAX_TEST_RUNS	8
>   #define POINTER_VALUE	0xcafe4all
>   #define TEST_DATA_LEN	64
>
Alexei Starovoitov April 18, 2019, 11:11 p.m. UTC | #2
On Thu, Apr 18, 2019 at 2:34 PM Martin KaFai Lau <kafai@fb.com> wrote:
>
> map_fds[16] is the last one index-ed by fixup_map_array_small.
> Hence, the MAX_NR_MAPS should be 17 instead.
>
> Fixes: fb2abb73e575 ("bpf, selftest: test {rd, wr}only flags and direct value access")
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>

Applied. Thanks
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
index 6cb6a1074fd1..ed9e894afef3 100644
--- a/tools/testing/selftests/bpf/test_verifier.c
+++ b/tools/testing/selftests/bpf/test_verifier.c
@@ -52,7 +52,7 @@ 
 #define MAX_INSNS	BPF_MAXINSNS
 #define MAX_TEST_INSNS	1000000
 #define MAX_FIXUPS	8
-#define MAX_NR_MAPS	16
+#define MAX_NR_MAPS	17
 #define MAX_TEST_RUNS	8
 #define POINTER_VALUE	0xcafe4all
 #define TEST_DATA_LEN	64