diff mbox

bpf: testing: fix devmap tests

Message ID 20170727003206.16649.50637.stgit@john-Precision-Tower-5810
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

John Fastabend July 27, 2017, 12:32 a.m. UTC
Apparently through one of my revisions of the initial patches
series I lost the devmap test. We can add more testing later but
for now lets fix the simple one we have.

Fixes: 546ac1ffb70d "bpf: add devmap, a map for storing net device references"
Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
---
 tools/testing/selftests/bpf/test_maps.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

John Fastabend July 27, 2017, 12:35 a.m. UTC | #1
On 07/26/2017 05:32 PM, John Fastabend wrote:
> Apparently through one of my revisions of the initial patches
> series I lost the devmap test. We can add more testing later but
> for now lets fix the simple one we have.
> 
> Fixes: 546ac1ffb70d "bpf: add devmap, a map for storing net device references"
> Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
> ---

Forgot prefix, this is for net-next. Sorry about that.

Thanks,
John
Daniel Borkmann July 27, 2017, 12:40 a.m. UTC | #2
On 07/27/2017 02:32 AM, John Fastabend wrote:
> Apparently through one of my revisions of the initial patches
> series I lost the devmap test. We can add more testing later but
> for now lets fix the simple one we have.
>
> Fixes: 546ac1ffb70d "bpf: add devmap, a map for storing net device references"
> Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: John Fastabend <john.fastabend@gmail.com>

Looks good, thanks!

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
David Miller July 29, 2017, 9:13 p.m. UTC | #3
From: John Fastabend <john.fastabend@gmail.com>
Date: Wed, 26 Jul 2017 17:35:41 -0700

> On 07/26/2017 05:32 PM, John Fastabend wrote:
>> Apparently through one of my revisions of the initial patches
>> series I lost the devmap test. We can add more testing later but
>> for now lets fix the simple one we have.
>> 
>> Fixes: 546ac1ffb70d "bpf: add devmap, a map for storing net device references"
>> Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>> Signed-off-by: John Fastabend <john.fastabend@gmail.com>
>> ---
> 
> Forgot prefix, this is for net-next. Sorry about that.

It's ok.

Aplpied, thanks John.
diff mbox

Patch

diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index ce2988b..1579cab 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -104,6 +104,7 @@  enum bpf_map_type {
 	BPF_MAP_TYPE_LPM_TRIE,
 	BPF_MAP_TYPE_ARRAY_OF_MAPS,
 	BPF_MAP_TYPE_HASH_OF_MAPS,
+	BPF_MAP_TYPE_DEVMAP,
 };
 
 enum bpf_prog_type {
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index 36d6ac3..c991ab6 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -440,7 +440,7 @@  static void test_arraymap_percpu_many_keys(void)
 
 static void test_devmap(int task, void *data)
 {
-	int next_key, fd;
+	int fd;
 	__u32 key, value;
 
 	fd = bpf_create_map(BPF_MAP_TYPE_DEVMAP, sizeof(key), sizeof(value),
@@ -620,6 +620,8 @@  static void run_all_tests(void)
 
 	test_arraymap_percpu_many_keys();
 
+	test_devmap(0, NULL);
+
 	test_map_large();
 	test_map_parallel();
 	test_map_stress();