提交 81f6bf81 编写于 作者: J John Fastabend 提交者: David S. Miller

bpf: testing: fix devmap tests

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: 546ac1ff "bpf: add devmap, a map for storing net device references"
Reported-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NJohn Fastabend <john.fastabend@gmail.com>
Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e9e38077
...@@ -104,6 +104,7 @@ enum bpf_map_type { ...@@ -104,6 +104,7 @@ enum bpf_map_type {
BPF_MAP_TYPE_LPM_TRIE, BPF_MAP_TYPE_LPM_TRIE,
BPF_MAP_TYPE_ARRAY_OF_MAPS, BPF_MAP_TYPE_ARRAY_OF_MAPS,
BPF_MAP_TYPE_HASH_OF_MAPS, BPF_MAP_TYPE_HASH_OF_MAPS,
BPF_MAP_TYPE_DEVMAP,
}; };
enum bpf_prog_type { enum bpf_prog_type {
......
...@@ -440,7 +440,7 @@ static void test_arraymap_percpu_many_keys(void) ...@@ -440,7 +440,7 @@ static void test_arraymap_percpu_many_keys(void)
static void test_devmap(int task, void *data) static void test_devmap(int task, void *data)
{ {
int next_key, fd; int fd;
__u32 key, value; __u32 key, value;
fd = bpf_create_map(BPF_MAP_TYPE_DEVMAP, sizeof(key), sizeof(value), fd = bpf_create_map(BPF_MAP_TYPE_DEVMAP, sizeof(key), sizeof(value),
...@@ -620,6 +620,8 @@ static void run_all_tests(void) ...@@ -620,6 +620,8 @@ static void run_all_tests(void)
test_arraymap_percpu_many_keys(); test_arraymap_percpu_many_keys();
test_devmap(0, NULL);
test_map_large(); test_map_large();
test_map_parallel(); test_map_parallel();
test_map_stress(); test_map_stress();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册