aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/map.c')
-rw-r--r--tools/bpf/bpftool/map.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index a8c3a33dd185..f95fa67bb498 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -66,6 +66,7 @@ static const char * const map_type_name[] = {
66 [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps", 66 [BPF_MAP_TYPE_HASH_OF_MAPS] = "hash_of_maps",
67 [BPF_MAP_TYPE_DEVMAP] = "devmap", 67 [BPF_MAP_TYPE_DEVMAP] = "devmap",
68 [BPF_MAP_TYPE_SOCKMAP] = "sockmap", 68 [BPF_MAP_TYPE_SOCKMAP] = "sockmap",
69 [BPF_MAP_TYPE_CPUMAP] = "cpumap",
69}; 70};
70 71
71static unsigned int get_possible_cpus(void) 72static unsigned int get_possible_cpus(void)
@@ -428,6 +429,9 @@ static int show_map_close_json(int fd, struct bpf_map_info *info)
428 429
429 jsonw_name(json_wtr, "flags"); 430 jsonw_name(json_wtr, "flags");
430 jsonw_printf(json_wtr, "%#x", info->map_flags); 431 jsonw_printf(json_wtr, "%#x", info->map_flags);
432
433 print_dev_json(info->ifindex, info->netns_dev, info->netns_ino);
434
431 jsonw_uint_field(json_wtr, "bytes_key", info->key_size); 435 jsonw_uint_field(json_wtr, "bytes_key", info->key_size);
432 jsonw_uint_field(json_wtr, "bytes_value", info->value_size); 436 jsonw_uint_field(json_wtr, "bytes_value", info->value_size);
433 jsonw_uint_field(json_wtr, "max_entries", info->max_entries); 437 jsonw_uint_field(json_wtr, "max_entries", info->max_entries);
@@ -469,7 +473,9 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info)
469 if (*info->name) 473 if (*info->name)
470 printf("name %s ", info->name); 474 printf("name %s ", info->name);
471 475
472 printf("flags 0x%x\n", info->map_flags); 476 printf("flags 0x%x", info->map_flags);
477 print_dev_plain(info->ifindex, info->netns_dev, info->netns_ino);
478 printf("\n");
473 printf("\tkey %uB value %uB max_entries %u", 479 printf("\tkey %uB value %uB max_entries %u",
474 info->key_size, info->value_size, info->max_entries); 480 info->key_size, info->value_size, info->max_entries);
475 481
@@ -861,7 +867,7 @@ static int do_help(int argc, char **argv)
861 } 867 }
862 868
863 fprintf(stderr, 869 fprintf(stderr,
864 "Usage: %s %s show [MAP]\n" 870 "Usage: %s %s { show | list } [MAP]\n"
865 " %s %s dump MAP\n" 871 " %s %s dump MAP\n"
866 " %s %s update MAP key BYTES value VALUE [UPDATE_FLAGS]\n" 872 " %s %s update MAP key BYTES value VALUE [UPDATE_FLAGS]\n"
867 " %s %s lookup MAP key BYTES\n" 873 " %s %s lookup MAP key BYTES\n"
@@ -885,6 +891,7 @@ static int do_help(int argc, char **argv)
885 891
886static const struct cmd cmds[] = { 892static const struct cmd cmds[] = {
887 { "show", do_show }, 893 { "show", do_show },
894 { "list", do_show },
888 { "help", do_help }, 895 { "help", do_help },
889 { "dump", do_dump }, 896 { "dump", do_dump },
890 { "update", do_update }, 897 { "update", do_update },