Skip to content

Commit

Permalink
bpf: testing: fix devmap tests
Browse files Browse the repository at this point in the history
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: 546ac1f "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>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
John Fastabend authored and David S. Miller committed Jul 29, 2017
1 parent e9e3807 commit 81f6bf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions tools/include/uapi/linux/bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion tools/testing/selftests/bpf/test_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 81f6bf8

Please sign in to comment.