]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: make key and value optional in update command
authorStanislav Fomichev <sdf@google.com>
Wed, 16 Jan 2019 19:09:59 +0000 (11:09 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 17 Jan 2019 09:30:30 +0000 (10:30 +0100)
commit68d7c529d1e268c5c266d8ecd1e0c85d3ccf18be
tree3f28024a1cb06d94073025680adc44c854d5c41d
parent07cf9d36194fb8c08a4e27d5e530d23b502152df
bpftool: make key and value optional in update command

Bpftool expects both key and value for 'update' operations. For some
map types, key should not be specified. Support updating those map types.

Before:
bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q
bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3
Error: did not find key

After:
bpftool map create /sys/fs/bpf/q type queue value 4 entries 10 name q
bpftool map update pinned /sys/fs/bpf/q value 0 1 2 3

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/Documentation/bpftool-map.rst
tools/bpf/bpftool/map.c