Home
last modified time | relevance | path

Searched refs:map_flags (Results 1 – 25 of 160) sorted by relevance

1234567

/linux/tools/testing/selftests/bpf/
H A Dtest_lru_map.c28 static int create_map(int map_type, int map_flags, unsigned int size) in create_map() argument
30 LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = map_flags); in create_map()
161 static void test_lru_sanity0(int map_type, int map_flags) in test_lru_sanity0() argument
168 map_flags); in test_lru_sanity0()
172 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity0()
173 lru_map_fd = create_map(map_type, map_flags, 2 * nr_cpus); in test_lru_sanity0()
175 lru_map_fd = create_map(map_type, map_flags, 2); in test_lru_sanity0()
252 static void test_lru_sanity1(int map_type, int map_flags, unsigned int tgt_free) in test_lru_sanity1() argument
260 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_sanity1()
265 map_flags); in test_lru_sanity1()
[all …]
H A Dtest_maps.c269 map_opts.map_flags == BPF_F_NO_PREALLOC)); in can_retry()
283 "err: %s, flags: 0x%x\n", strerror(errno), map_opts.map_flags); in helper_fill_hashmap()
340 old_flags = map_opts.map_flags; in test_hashmap_zero_seed()
341 map_opts.map_flags |= BPF_F_ZERO_SEED; in test_hashmap_zero_seed()
363 map_opts.map_flags = old_flags; in test_hashmap_zero_seed()
562 if (map_opts.map_flags & BPF_F_NO_PREALLOC) { in test_queuemap()
618 if (map_opts.map_flags & BPF_F_NO_PREALLOC) { in test_stackmap()
1539 old_flags = map_opts.map_flags; in test_map_rdonly()
1540 map_opts.map_flags |= BPF_F_RDONLY; in test_map_rdonly()
1543 map_opts.map_flags = old_flags; in test_map_rdonly()
[all …]
/linux/samples/bpf/
H A Dtest_lru_dist.c202 static int create_map(int map_type, int map_flags, unsigned int size) in create_map() argument
205 .map_flags = map_flags, in create_map()
307 static void test_parallel_lru_dist(int map_type, int map_flags, in test_parallel_lru_dist() argument
314 map_flags); in test_parallel_lru_dist()
316 if (map_flags & BPF_F_NO_COMMON_LRU) in test_parallel_lru_dist()
317 lru_map_fd = create_map(map_type, map_flags, in test_parallel_lru_dist()
320 lru_map_fd = create_map(map_type, map_flags, in test_parallel_lru_dist()
332 static void test_lru_loss0(int map_type, int map_flags) in test_lru_loss0() argument
341 map_flags); in test_lru_loss0()
345 if (map_flags & BPF_F_NO_COMMON_LRU) in test_lru_loss0()
[all …]
H A Dmap_perf_test.bpf.c36 __uint(map_flags, BPF_F_NO_COMMON_LRU);
44 __uint(map_flags, BPF_F_NUMA_NODE);
70 __uint(map_flags, BPF_F_NO_PREALLOC);
78 __uint(map_flags, BPF_F_NO_PREALLOC);
86 __uint(map_flags, BPF_F_NO_PREALLOC);
H A Dtcp_dumpstats_kern.c17 __u32 map_flags; member
22 .map_flags = BPF_F_NO_PREALLOC,
/linux/kernel/bpf/
H A Dhashtab.c137 return !(htab->map.map_flags & BPF_F_NO_PREALLOC); in htab_is_prealloc()
352 htab->map.map_flags & BPF_F_NO_COMMON_LRU, in prealloc_init()
424 bool percpu_lru = (attr->map_flags & BPF_F_NO_COMMON_LRU); in htab_map_alloc_check()
425 bool prealloc = !(attr->map_flags & BPF_F_NO_PREALLOC); in htab_map_alloc_check()
426 bool zero_seed = (attr->map_flags & BPF_F_ZERO_SEED); in htab_map_alloc_check()
436 if (attr->map_flags & ~HTAB_CREATE_FLAG_MASK || in htab_map_alloc_check()
437 !bpf_map_flags_access_ok(attr->map_flags)) in htab_map_alloc_check()
572 bool percpu_lru = (attr->map_flags & BPF_F_NO_COMMON_LRU); in htab_map_alloc()
573 bool prealloc = !(attr->map_flags & BPF_F_NO_PREALLOC); in htab_map_alloc()
626 if (htab->map.map_flags in htab_map_alloc()
1019 pcpu_copy_value(struct bpf_htab * htab,void __percpu * pptr,void * value,bool onallcpus,u64 map_flags) pcpu_copy_value() argument
1052 pcpu_init_value(struct bpf_htab * htab,void __percpu * pptr,void * value,bool onallcpus,u64 map_flags) pcpu_init_value() argument
1085 alloc_htab_elem(struct bpf_htab * htab,void * key,void * value,u32 key_size,u32 hash,bool percpu,bool onallcpus,struct htab_elem * old_elem,u64 map_flags) alloc_htab_elem() argument
1166 check_flags(struct bpf_htab * htab,struct htab_elem * l_old,u64 map_flags) check_flags() argument
1181 htab_map_update_elem(struct bpf_map * map,void * key,void * value,u64 map_flags) htab_map_update_elem() argument
1288 htab_lru_map_update_elem(struct bpf_map * map,void * key,void * value,u64 map_flags) htab_lru_map_update_elem() argument
1353 htab_map_check_update_flags(bool onallcpus,u64 map_flags) htab_map_check_update_flags() argument
1363 htab_map_update_elem_in_place(struct bpf_map * map,void * key,void * value,u64 map_flags,bool percpu,bool onallcpus) htab_map_update_elem_in_place() argument
1426 __htab_lru_percpu_map_update_elem(struct bpf_map * map,void * key,void * value,u64 map_flags,bool onallcpus) __htab_lru_percpu_map_update_elem() argument
1495 htab_percpu_map_update_elem(struct bpf_map * map,void * key,void * value,u64 map_flags) htab_percpu_map_update_elem() argument
1501 htab_lru_percpu_map_update_elem(struct bpf_map * map,void * key,void * value,u64 map_flags) htab_lru_percpu_map_update_elem() argument
1797 u64 elem_map_flags, map_flags, allowed_flags; __htab_map_lookup_and_delete_batch() local
2500 bpf_percpu_hash_copy(struct bpf_map * map,void * key,void * value,u64 map_flags) bpf_percpu_hash_copy() argument
2539 bpf_percpu_hash_update(struct bpf_map * map,void * key,void * value,u64 map_flags) bpf_percpu_hash_update() argument
2678 bpf_fd_htab_map_update_elem(struct bpf_map * map,struct file * map_file,void * key,void * value,u64 map_flags) bpf_fd_htab_map_update_elem() argument
3021 rhtab_map_update_existing(struct bpf_map * map,struct rhtab_elem * elem,void * value,u64 map_flags) rhtab_map_update_existing() argument
3046 rhtab_map_update_elem(struct bpf_map * map,void * key,void * value,u64 map_flags) rhtab_map_update_elem() argument
3273 u64 elem_map_flags, map_flags; __rhtab_map_lookup_and_delete_batch() local
[all...]
H A Darraymap.c61 attr->map_flags & ~ARRAY_CREATE_FLAG_MASK || in array_map_alloc_check()
62 !bpf_map_flags_access_ok(attr->map_flags) || in array_map_alloc_check()
67 attr->map_flags & (BPF_F_MMAPABLE | BPF_F_INNER_MAP)) in array_map_alloc_check()
71 attr->map_flags & BPF_F_PRESERVE_ELEMS) in array_map_alloc_check()
123 if (attr->map_flags & BPF_F_MMAPABLE) { in array_map_alloc()
132 if (attr->map_flags & BPF_F_MMAPABLE) { in array_map_alloc()
227 if (map->map_flags & BPF_F_INNER_MAP) in array_map_gen_lookup()
302 if (map->map_flags & BPF_F_INNER_MAP) in percpu_array_map_gen_lookup()
339 int bpf_percpu_array_copy(struct bpf_map *map, void *key, void *value, u64 map_flags) in bpf_percpu_array_copy() argument
357 if (map_flags & BPF_F_CPU) { in bpf_percpu_array_copy()
[all …]
H A Dbpf_local_storage.c463 u64 map_flags) in check_flags() argument
465 if (old_sdata && (map_flags & ~BPF_F_LOCK) == BPF_NOEXIST) in check_flags()
469 if (!old_sdata && (map_flags & ~BPF_F_LOCK) == BPF_EXIST) in check_flags()
548 void *value, u64 map_flags, bool swap_uptrs) in bpf_local_storage_update() argument
559 if (unlikely((map_flags & ~BPF_F_LOCK) > BPF_EXIST) || in bpf_local_storage_update()
561 unlikely((map_flags & BPF_F_LOCK) && in bpf_local_storage_update()
569 err = check_flags(NULL, map_flags); in bpf_local_storage_update()
587 if ((map_flags & BPF_F_LOCK) && !(map_flags & BPF_NOEXIST)) { in bpf_local_storage_update()
594 err = check_flags(old_sdata, map_flags); in bpf_local_storage_update()
627 err = check_flags(old_sdata, map_flags); in bpf_local_storage_update()
[all …]
H A Dreuseport_array.c192 u32 map_flags) in reuseport_array_update_check() argument
194 if (osk && map_flags == BPF_NOEXIST) in reuseport_array_update_check()
197 if (!osk && map_flags == BPF_EXIST) in reuseport_array_update_check()
233 void *value, u64 map_flags) in bpf_fd_reuseport_array_update_elem() argument
243 if (map_flags > BPF_EXIST) in bpf_fd_reuseport_array_update_elem()
273 map_flags); in bpf_fd_reuseport_array_update_elem()
289 err = reuseport_array_update_check(array, nsk, osk, reuse, map_flags); in bpf_fd_reuseport_array_update_elem()
H A Dlocal_storage.c183 void *value, u64 map_flags) in bpf_percpu_cgroup_storage_copy() argument
201 if (map_flags & BPF_F_CPU) { in bpf_percpu_cgroup_storage_copy()
202 cpu = map_flags >> 32; in bpf_percpu_cgroup_storage_copy()
217 void *value, u64 map_flags) in bpf_percpu_cgroup_storage_update() argument
225 if ((u32)map_flags & ~(BPF_ANY | BPF_EXIST | BPF_F_CPU | BPF_F_ALL_CPUS)) in bpf_percpu_cgroup_storage_update()
241 if (map_flags & BPF_F_CPU) { in bpf_percpu_cgroup_storage_update()
242 cpu = map_flags >> 32; in bpf_percpu_cgroup_storage_update()
248 val = (map_flags & BPF_F_ALL_CPUS) ? value : value + off; in bpf_percpu_cgroup_storage_update()
320 if (attr->map_flags & ~LOCAL_STORAGE_CREATE_FLAG_MASK || in cgroup_storage_map_alloc()
321 !bpf_map_flags_access_ok(attr->map_flags)) in cgroup_storage_map_alloc()
H A Dbpf_insn_array.c31 attr->value_size != value_size || attr->map_flags != 0) in insn_array_alloc_check()
59 insn_array->map.map_flags |= BPF_F_RDONLY_PROG; in insn_array_alloc()
75 static long insn_array_update_elem(struct bpf_map *map, void *key, void *value, u64 map_flags) in insn_array_update_elem() argument
84 if (unlikely(map_flags & BPF_NOEXIST)) in insn_array_update_elem()
H A Dbloom_filter.c108 attr->map_flags & ~BLOOM_CREATE_FLAG_MASK || in bloom_map_alloc()
109 !bpf_map_flags_access_ok(attr->map_flags) || in bloom_map_alloc()
155 if (!(attr->map_flags & BPF_F_ZERO_SEED)) in bloom_map_alloc()
/linux/tools/testing/selftests/bpf/progs/
H A Dlocal_storage.c28 __uint(map_flags, BPF_F_NO_PREALLOC);
35 __uint(map_flags, BPF_F_NO_PREALLOC | BPF_F_CLONE);
42 __uint(map_flags, BPF_F_NO_PREALLOC | BPF_F_CLONE);
49 __uint(map_flags, BPF_F_NO_PREALLOC);
56 __uint(map_flags, BPF_F_NO_PREALLOC);
H A Dsockopt_inherit.c20 __uint(map_flags, BPF_F_NO_PREALLOC | BPF_F_CLONE);
27 __uint(map_flags, BPF_F_NO_PREALLOC | BPF_F_CLONE);
34 __uint(map_flags, BPF_F_NO_PREALLOC);
H A Dtest_btf_map_in_map.c46 __uint(map_flags, BPF_F_INNER_MAP);
55 __uint(map_flags, BPF_F_INNER_MAP);
68 __uint(map_flags, BPF_F_INNER_MAP);
H A Dtest_mmap.c12 __uint(map_flags, BPF_F_MMAPABLE | BPF_F_RDONLY_PROG);
19 __uint(map_flags, BPF_F_MMAPABLE);
H A Dtest_queue_stack_map.h14 __uint(map_flags, 0);
22 __uint(map_flags, 0);
H A Dmap_kptr_race.c14 __uint(map_flags, BPF_F_NO_PREALLOC);
22 __uint(map_flags, BPF_F_NO_PREALLOC);
30 __uint(map_flags, BPF_F_NO_PREALLOC);
H A Dtask_ls_recursion.c18 __uint(map_flags, BPF_F_NO_PREALLOC);
25 __uint(map_flags, BPF_F_NO_PREALLOC);
H A Dbench_local_storage_create.c19 __uint(map_flags, BPF_F_NO_PREALLOC);
26 __uint(map_flags, BPF_F_NO_PREALLOC);
H A Dtest_map_in_map.c11 __uint(map_flags, 0);
19 __uint(map_flags, 0);
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dbtf_map_keyless.c12 static void check_keyless(int map_type, __u32 map_flags, int btf_fd, int val_id) in check_keyless() argument
17 opts.map_flags = map_flags; in check_keyless()
/linux/tools/testing/selftests/bpf/map_tests/
H A Dmap_percpu_stats.c289 n_iter, n_real, map_type_to_s(info->type), info->map_flags); in check_expected_number_elements()
316 opts.retry_for_nomem = is_percpu(opts.map_type) && (info.map_flags & BPF_F_NO_PREALLOC); in __test()
363 LIBBPF_OPTS(bpf_map_create_opts, map_opts, .map_flags = BPF_F_NO_PREALLOC); in create_hash()
370 LIBBPF_OPTS(bpf_map_create_opts, map_opts, .map_flags = BPF_F_NO_PREALLOC); in create_percpu_hash()
385 static int create_lru_hash(__u32 type, __u32 map_flags) in create_lru_hash() argument
387 LIBBPF_OPTS(bpf_map_create_opts, map_opts, .map_flags = map_flags); in create_lru_hash()
395 .map_flags = BPF_F_NO_PREALLOC, in create_hash_of_maps()
/linux/tools/testing/selftests/bpf/benchs/
H A Dbench_bpf_hashmap_lookup.c22 __u32 map_flags; member
28 .map_flags = 0,
45 { "map_flags", ARG_MAP_FLAGS, "MAP_FLAGS", 0,
72 fprintf(stderr, "invalid map_flags"); in parse_arg()
75 args.map_flags = ret; in parse_arg()
154 __u32 map_flags; in setup()
167 map_flags = args.map_flags; in setup()
169 map_flags |= BPF_F_NO_PREALLOC; in setup()
175 bpf_map__set_map_flags(ctx.skel->maps.hash_map_bench, map_flags); in setup()
[all...]
/linux/net/xdp/
H A Dxskmap.c72 attr->map_flags & ~(BPF_F_NUMA_NODE | BPF_F_RDONLY | BPF_F_WRONLY)) in xsk_map_alloc()
162 u64 map_flags) in xsk_map_update_elem() argument
172 if (unlikely(map_flags > BPF_EXIST)) in xsk_map_update_elem()
204 } else if (old_xs && map_flags == BPF_NOEXIST) { in xsk_map_update_elem()
207 } else if (!old_xs && map_flags == BPF_EXIST) { in xsk_map_update_elem()

1234567