* [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels
@ 2020-07-27 23:33 Andrii Nakryiko
2020-07-28 1:34 ` Yonghong Song
2020-07-28 10:29 ` Daniel Borkmann
0 siblings, 2 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2020-07-27 23:33 UTC (permalink / raw)
To: bpf, netdev, ast, daniel
Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko, Yonghong Song
Add bpf_iter__bpf_map_elem and bpf_iter__bpf_sk_storage_map to bpf_iter.h
Cc: Yonghong Song <yhs@fb.com>
Fixes: 3b1c420bd882 ("selftests/bpf: Add a test for bpf sk_storage_map iterator")
Fixes: 2a7c2fff7dd6 ("selftests/bpf: Add test for bpf hash map iterators")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/testing/selftests/bpf/progs/bpf_iter.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/tools/testing/selftests/bpf/progs/bpf_iter.h b/tools/testing/selftests/bpf/progs/bpf_iter.h
index 17db3bac518b..c196280df90d 100644
--- a/tools/testing/selftests/bpf/progs/bpf_iter.h
+++ b/tools/testing/selftests/bpf/progs/bpf_iter.h
@@ -11,6 +11,8 @@
#define tcp6_sock tcp6_sock___not_used
#define bpf_iter__udp bpf_iter__udp___not_used
#define udp6_sock udp6_sock___not_used
+#define bpf_iter__bpf_map_elem bpf_iter__bpf_map_elem___not_used
+#define bpf_iter__bpf_sk_storage_map bpf_iter__bpf_sk_storage_map___not_used
#include "vmlinux.h"
#undef bpf_iter_meta
#undef bpf_iter__bpf_map
@@ -22,6 +24,8 @@
#undef tcp6_sock
#undef bpf_iter__udp
#undef udp6_sock
+#undef bpf_iter__bpf_map_elem
+#undef bpf_iter__bpf_sk_storage_map
struct bpf_iter_meta {
struct seq_file *seq;
@@ -78,3 +82,17 @@ struct udp6_sock {
struct udp_sock udp;
struct ipv6_pinfo inet6;
} __attribute__((preserve_access_index));
+
+struct bpf_iter__bpf_map_elem {
+ struct bpf_iter_meta *meta;
+ struct bpf_map *map;
+ void *key;
+ void *value;
+};
+
+struct bpf_iter__bpf_sk_storage_map {
+ struct bpf_iter_meta *meta;
+ struct bpf_map *map;
+ struct sock *sk;
+ void *value;
+};
--
2.24.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels
2020-07-27 23:33 [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels Andrii Nakryiko
@ 2020-07-28 1:34 ` Yonghong Song
2020-07-28 10:29 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2020-07-28 1:34 UTC (permalink / raw)
To: Andrii Nakryiko, bpf, netdev, ast, daniel; +Cc: andrii.nakryiko, kernel-team
On 7/27/20 4:33 PM, Andrii Nakryiko wrote:
> Add bpf_iter__bpf_map_elem and bpf_iter__bpf_sk_storage_map to bpf_iter.h
>
> Cc: Yonghong Song <yhs@fb.com>
> Fixes: 3b1c420bd882 ("selftests/bpf: Add a test for bpf sk_storage_map iterator")
> Fixes: 2a7c2fff7dd6 ("selftests/bpf: Add test for bpf hash map iterators")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels
2020-07-27 23:33 [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels Andrii Nakryiko
2020-07-28 1:34 ` Yonghong Song
@ 2020-07-28 10:29 ` Daniel Borkmann
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-07-28 10:29 UTC (permalink / raw)
To: Andrii Nakryiko, bpf, netdev, ast
Cc: andrii.nakryiko, kernel-team, Yonghong Song
On 7/28/20 1:33 AM, Andrii Nakryiko wrote:
> Add bpf_iter__bpf_map_elem and bpf_iter__bpf_sk_storage_map to bpf_iter.h
>
> Cc: Yonghong Song <yhs@fb.com>
> Fixes: 3b1c420bd882 ("selftests/bpf: Add a test for bpf sk_storage_map iterator")
> Fixes: 2a7c2fff7dd6 ("selftests/bpf: Add test for bpf hash map iterators")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-28 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 23:33 [PATCH bpf-next] selftests/bpf: add new bpf_iter context structs to fix build on old kernels Andrii Nakryiko
2020-07-28 1:34 ` Yonghong Song
2020-07-28 10:29 ` Daniel Borkmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.