diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-07-10 14:43:07 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-07-11 22:13:34 +0200 |
commit | 3ff5a4dc5d890963e669fc99cc62ee07d1da24e8 (patch) | |
tree | 227ec4a474eaa03236f5ce8df1df25d890846ee4 /tools/bpf/bpftool/map.c | |
parent | 26736eb9a483715c2e971a8866f55fbb156903e2 (diff) | |
download | op-kernel-dev-3ff5a4dc5d890963e669fc99cc62ee07d1da24e8.zip op-kernel-dev-3ff5a4dc5d890963e669fc99cc62ee07d1da24e8.tar.gz |
tools: bpftool: allow reuse of maps with bpftool prog load
Add map parameter to prog load which will allow reuse of existing
maps instead of creating new ones.
We need feature detection and compat code for reallocarray, since
it's not available in many libc versions.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/map.c')
-rw-r--r-- | tools/bpf/bpftool/map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 5989e15..e2baec1 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -93,7 +93,7 @@ static void *alloc_value(struct bpf_map_info *info) return malloc(info->value_size); } -static int map_parse_fd(int *argc, char ***argv) +int map_parse_fd(int *argc, char ***argv) { int fd; @@ -824,7 +824,7 @@ static int do_help(int argc, char **argv) " %s %s event_pipe MAP [cpu N index M]\n" " %s %s help\n" "\n" - " MAP := { id MAP_ID | pinned FILE }\n" + " " HELP_SPEC_MAP "\n" " DATA := { [hex] BYTES }\n" " " HELP_SPEC_PROGRAM "\n" " VALUE := { DATA | MAP | PROG }\n" |