map.c (3bec5b6aae830355e786e204b20a7cea38c3a8ed) map.c (8ea636848aca35b9f97c5b5dee30225cf2dd0fe6)
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/* Copyright (C) 2017-2018 Netronome Systems, Inc. */
3
4#include <assert.h>
5#include <errno.h>
6#include <fcntl.h>
7#include <linux/err.h>
8#include <linux/kernel.h>

--- 36 unchanged lines hidden (view full) ---

45 [BPF_MAP_TYPE_CGROUP_STORAGE] = "cgroup_storage",
46 [BPF_MAP_TYPE_REUSEPORT_SOCKARRAY] = "reuseport_sockarray",
47 [BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE] = "percpu_cgroup_storage",
48 [BPF_MAP_TYPE_QUEUE] = "queue",
49 [BPF_MAP_TYPE_STACK] = "stack",
50 [BPF_MAP_TYPE_SK_STORAGE] = "sk_storage",
51 [BPF_MAP_TYPE_STRUCT_OPS] = "struct_ops",
52 [BPF_MAP_TYPE_RINGBUF] = "ringbuf",
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/* Copyright (C) 2017-2018 Netronome Systems, Inc. */
3
4#include <assert.h>
5#include <errno.h>
6#include <fcntl.h>
7#include <linux/err.h>
8#include <linux/kernel.h>

--- 36 unchanged lines hidden (view full) ---

45 [BPF_MAP_TYPE_CGROUP_STORAGE] = "cgroup_storage",
46 [BPF_MAP_TYPE_REUSEPORT_SOCKARRAY] = "reuseport_sockarray",
47 [BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE] = "percpu_cgroup_storage",
48 [BPF_MAP_TYPE_QUEUE] = "queue",
49 [BPF_MAP_TYPE_STACK] = "stack",
50 [BPF_MAP_TYPE_SK_STORAGE] = "sk_storage",
51 [BPF_MAP_TYPE_STRUCT_OPS] = "struct_ops",
52 [BPF_MAP_TYPE_RINGBUF] = "ringbuf",
53 [BPF_MAP_TYPE_INODE_STORAGE] = "inode_storage",
53};
54
55const size_t map_type_name_size = ARRAY_SIZE(map_type_name);
56
57static bool map_is_per_cpu(__u32 type)
58{
59 return type == BPF_MAP_TYPE_PERCPU_HASH ||
60 type == BPF_MAP_TYPE_PERCPU_ARRAY ||

--- 1376 unchanged lines hidden (view full) ---

1437 " " HELP_SPEC_PROGRAM "\n"
1438 " VALUE := { DATA | MAP | PROG }\n"
1439 " UPDATE_FLAGS := { any | exist | noexist }\n"
1440 " TYPE := { hash | array | prog_array | perf_event_array | percpu_hash |\n"
1441 " percpu_array | stack_trace | cgroup_array | lru_hash |\n"
1442 " lru_percpu_hash | lpm_trie | array_of_maps | hash_of_maps |\n"
1443 " devmap | devmap_hash | sockmap | cpumap | xskmap | sockhash |\n"
1444 " cgroup_storage | reuseport_sockarray | percpu_cgroup_storage |\n"
54};
55
56const size_t map_type_name_size = ARRAY_SIZE(map_type_name);
57
58static bool map_is_per_cpu(__u32 type)
59{
60 return type == BPF_MAP_TYPE_PERCPU_HASH ||
61 type == BPF_MAP_TYPE_PERCPU_ARRAY ||

--- 1376 unchanged lines hidden (view full) ---

1438 " " HELP_SPEC_PROGRAM "\n"
1439 " VALUE := { DATA | MAP | PROG }\n"
1440 " UPDATE_FLAGS := { any | exist | noexist }\n"
1441 " TYPE := { hash | array | prog_array | perf_event_array | percpu_hash |\n"
1442 " percpu_array | stack_trace | cgroup_array | lru_hash |\n"
1443 " lru_percpu_hash | lpm_trie | array_of_maps | hash_of_maps |\n"
1444 " devmap | devmap_hash | sockmap | cpumap | xskmap | sockhash |\n"
1445 " cgroup_storage | reuseport_sockarray | percpu_cgroup_storage |\n"
1445 " queue | stack | sk_storage | struct_ops | ringbuf }\n"
1446 " queue | stack | sk_storage | struct_ops | ringbuf | inode_storage }\n"
1446 " " HELP_SPEC_OPTIONS "\n"
1447 "",
1448 bin_name, argv[-2]);
1449
1450 return 0;
1451}
1452
1453static const struct cmd cmds[] = {

--- 24 unchanged lines hidden ---
1447 " " HELP_SPEC_OPTIONS "\n"
1448 "",
1449 bin_name, argv[-2]);
1450
1451 return 0;
1452}
1453
1454static const struct cmd cmds[] = {

--- 24 unchanged lines hidden ---