summary refs log tree commit diff
path: root/kernel/sched
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2018-01-18 15:08:50 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2018-01-19 23:26:41 +0100
commitb471f2f1de8b816f1e799b80aa92588f3566e4bd (patch)
tree0ba426508fa8d1365460989daf658681eaf47f8e /kernel/sched
parentb7bcc0bbb8acb640258bb451f1f9391737da48b1 (diff)
downloadlinux-b471f2f1de8b816f1e799b80aa92588f3566e4bd.tar.gz
bpf: implement MAP_GET_NEXT_KEY command for LPM_TRIE map
Current LPM_TRIE map type does not implement MAP_GET_NEXT_KEY
command. This command is handy when users want to enumerate
keys. Otherwise, a different map which supports key
enumeration may be required to store the keys. If the
map data is sparse and all map data are to be deleted without
closing file descriptor, using MAP_GET_NEXT_KEY to find
all keys is much faster than enumerating all key space.

This patch implements MAP_GET_NEXT_KEY command for LPM_TRIE map.
If user provided key pointer is NULL or the key does not have
an exact match in the trie, the first key will be returned.
Otherwise, the next key will be returned.

In this implemenation, key enumeration follows a postorder
traversal of internal trie. More specific keys
will be returned first than less specific ones, given
a sequence of MAP_GET_NEXT_KEY syscalls.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel/sched')
0 files changed, 0 insertions, 0 deletions