| /linux/tools/testing/selftests/bpf/map_tests/ |
| H A D | map_percpu_stats.c | 338 struct bpf_map_create_opts *map_opts, in map_create_opts() argument 349 map_fd = bpf_map_create(type, name, key_size, val_size, max_entries, map_opts); in map_create_opts() 356 static int map_create(__u32 type, const char *name, struct bpf_map_create_opts *map_opts) in map_create() argument 358 return map_create_opts(type, name, map_opts, sizeof(int), sizeof(int)); in map_create() 363 LIBBPF_OPTS(bpf_map_create_opts, map_opts, .map_flags = BPF_F_NO_PREALLOC); in create_hash() 365 return map_create(BPF_MAP_TYPE_HASH, "hash", &map_opts); in create_hash() 370 LIBBPF_OPTS(bpf_map_create_opts, map_opts, .map_flags = BPF_F_NO_PREALLOC); in create_percpu_hash() 372 return map_create(BPF_MAP_TYPE_PERCPU_HASH, "percpu_hash", &map_opts); in create_percpu_hash() 387 LIBBPF_OPTS(bpf_map_create_opts, map_opts, .map_flags = map_flags); in create_lru_hash() 389 return map_create(type, "lru_hash", &map_opts); in create_lru_hash() [all …]
|
| H A D | sk_storage_map.c | 22 static struct bpf_map_create_opts map_opts = { variable 23 .sz = sizeof(map_opts), 149 map_opts.btf_fd = btf_fd; in create_sk_storage_map() 151 map_fd = bpf_map_create(BPF_MAP_TYPE_SK_STORAGE, "sk_storage_map", 4, 8, 0, &map_opts); in create_sk_storage_map() 152 map_opts.btf_fd = -1; in create_sk_storage_map() 468 map_opts.btf_fd = btf_fd; in test_sk_storage_map_basic() 474 map_fd = bpf_map_create(BPF_MAP_TYPE_SK_STORAGE, "sk_storage_map", 4, 8, 0, &map_opts); in test_sk_storage_map_basic() 563 memcpy(&bad_xattr, &map_opts, sizeof(map_opts)); in test_sk_storage_map_basic() 569 memcpy(&bad_xattr, &map_opts, sizeof(map_opts)); in test_sk_storage_map_basic() 575 err = bpf_map_create(BPF_MAP_TYPE_SK_STORAGE, "sk_storage_map", 4, 8, 1, &map_opts); in test_sk_storage_map_basic() [all …]
|
| /linux/tools/testing/selftests/bpf/ |
| H A D | test_maps.c | 31 static struct bpf_map_create_opts map_opts = { .sz = sizeof(map_opts) }; variable 38 fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(key), sizeof(value), 2, &map_opts); in test_hashmap() 135 fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, i, j, 2, &map_opts); in test_hashmap_sizes() 157 sizeof(bpf_percpu(value, 0)), 2, &map_opts); in test_hashmap_percpu() 270 max_entries, &map_opts); in helper_fill_hashmap() 273 "err: %s, flags: 0x%x\n", strerror(errno), map_opts.map_flags); in helper_fill_hashmap() 329 old_flags = map_opts.map_flags; in test_hashmap_zero_seed() 330 map_opts.map_flags |= BPF_F_ZERO_SEED; in test_hashmap_zero_seed() 352 map_opts.map_flags = old_flags; in test_hashmap_zero_seed() 546 fd = bpf_map_create(BPF_MAP_TYPE_QUEUE, NULL, 4, sizeof(val), MAP_SIZE, &map_opts); in test_queuemap() [all …]
|
| /linux/tools/testing/selftests/bpf/prog_tests/ |
| H A D | token.c | 502 LIBBPF_OPTS(bpf_map_create_opts, map_opts); in userns_map_create() 522 map_opts.map_flags = 0; in userns_map_create() 523 map_opts.token_fd = 0; in userns_map_create() 524 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "wo_token_wo_bpf", 0, 8, 1, &map_opts); in userns_map_create() 531 map_opts.map_flags = BPF_F_TOKEN_FD; in userns_map_create() 532 map_opts.token_fd = token_fd; in userns_map_create() 533 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "w_token_wo_bpf", 0, 8, 1, &map_opts); in userns_map_create() 545 map_opts.map_flags = 0; in userns_map_create() 546 map_opts.token_fd = 0; in userns_map_create() 547 map_fd = bpf_map_create(BPF_MAP_TYPE_STACK, "wo_token_w_bpf", 0, 8, 1, &map_opts); in userns_map_create() [all …]
|