bpf: add get_next_key callback to LPM map
Subsystems (3)
PATCH 1/1 bpf: add get_next_key callback to LPM map
map_get_next_key callback is mandatory. Supply dummy handler.
--- kernel/bpf/lpm_trie.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/bpf/lpm_trie.c +6 -0
@@ -500,9 +500,15 @@ static void trie_free(struct bpf_map *map)raw_spin_unlock (&trie->lock); } +static int trie_get_next_key (struct bpf_map *map,void *key,void *next_key) +{ +return -ENOTSUPP ; +} +static const struct bpf_map_ops trie_ops = { .map_alloc = trie_alloc, .map_free = trie_free, + .map_get_next_key = trie_get_next_key, .map_lookup_elem = trie_lookup_elem, .map_update_elem = trie_update_elem, .map_delete_elem = trie_delete_elem,
Signature · 1 line
2.8.0
David Miller
maintainerFrom: Alexei Starovoitov <[email protected]>
Date: Sun, 5 Mar 2017 09:41:08 -0800
Quoted 5 lines
map_get_next_keycallback is mandatory. Supply dummy handler.Fixes b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")Reported-by Dmitry Vyukov <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>
Wouldn't it be more appropriate to provide a proper DFS ordered traversal rather than return an error code?
Quoted 11 lines · David Miller
From: Alexei Starovoitov <[email protected]>
Date: Sun, 5 Mar 2017 09:41:08 -0800Quoted 5 lines
map_get_next_keycallback is mandatory. Supply dummy handler.Fixes b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")Reported-by Dmitry Vyukov <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>Wouldn't it be more appropriate to provide a proper DFS ordered traversal rather than return an error code?
yes. of course. This is quick fix for 'net'.
That's why the error code is ENOTSUPP with meaning that it's not supported right now and will be supported in the future.
David Miller
maintainerFrom: Alexei Starovoitov <[email protected]>
Date: Sun, 5 Mar 2017 10:58:00 -0800
Quoted 11 lines · David Miller
Quoted 10 lines
From: Alexei Starovoitov <[email protected]>
Date: Sun, 5 Mar 2017 09:41:08 -0800Quoted 6 lines
map_get_next_keycallback is mandatory. Supply dummy handler.Fixes b95a5c4db09b ("bpf: add a longest prefix match trie mapimplementation")
Reported-by Dmitry Vyukov <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>
Quoted 6 lines
Quoted 2 lines
Wouldn't it be more appropriate to provide a proper DFS ordered traversal rather than return an error code?
yes. of course. This is quick fix for 'net'.
That's why the error code is ENOTSUPP with meaning that it's not supported right now and will be supported in the future.
Ok, fair enough, applied.
Thanks.
Quoted 5 lines · Alexei Starovoitov
map_get_next_keycallback is mandatory. Supply dummy handler.Fixes b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")Reported-by Dmitry Vyukov <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>