| /kernel/linux/linux-6.6/tools/testing/selftests/bpf/ |
| D | test_lru_map.c | 1 // SPDX-License-Identifier: GPL-2.0-only 36 if (map_fd == -1) in create_map() 42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key, in bpf_map_lookup_elem_with_ref_bit() argument 43 void *value) in bpf_map_lookup_elem_with_ref_bit() argument 48 BPF_LD_IMM64(BPF_REG_3, key), in bpf_map_lookup_elem_with_ref_bit() 50 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), in bpf_map_lookup_elem_with_ref_bit() 71 return -1; in bpf_map_lookup_elem_with_ref_bit() 78 return -1; in bpf_map_lookup_elem_with_ref_bit() 83 ret = -1; in bpf_map_lookup_elem_with_ref_bit() 85 assert(!bpf_map_lookup_elem(mfd, &zero, value)); in bpf_map_lookup_elem_with_ref_bit() [all …]
|
| D | test_lpm_map.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Randomized tests for eBPF longest-prefix-match maps 5 * This program runs randomized tests against the lpm-bpf-map. It implements a 9 * Based on tlpm, this inserts randomized data into bpf-lpm-maps and verifies 10 * the trie-based bpf-map implementation behaves the same way as tlpm. 33 uint8_t key[]; member 37 const uint8_t *key, 41 const uint8_t *key, in tlpm_add() argument 50 node = tlpm_match(list, key, n_bits); in tlpm_add() 51 if (node && node->n_bits == n_bits) { in tlpm_add() [all …]
|
| D | test_maps.c | 1 // SPDX-License-Identifier: GPL-2.0-only 39 long long key, next_key, first_key, value; in test_hashmap() local 42 fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(key), sizeof(value), 2, &map_opts); in test_hashmap() 48 key = 1; in test_hashmap() 49 value = 1234; in test_hashmap() 50 /* Insert key=1 element. */ in test_hashmap() 51 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 53 value = 0; in test_hashmap() 55 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() 56 /* key=1 already exists. */ in test_hashmap() [all …]
|
| /kernel/linux/linux-5.10/tools/testing/selftests/bpf/ |
| D | test_lru_map.c | 1 // SPDX-License-Identifier: GPL-2.0-only 36 if (map_fd == -1) in create_map() 42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key, in bpf_map_lookup_elem_with_ref_bit() argument 43 void *value) in bpf_map_lookup_elem_with_ref_bit() argument 50 BPF_LD_IMM64(BPF_REG_3, key), in bpf_map_lookup_elem_with_ref_bit() 52 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), in bpf_map_lookup_elem_with_ref_bit() 75 return -1; in bpf_map_lookup_elem_with_ref_bit() 88 return -1; in bpf_map_lookup_elem_with_ref_bit() 94 ret = -1; in bpf_map_lookup_elem_with_ref_bit() 96 assert(!bpf_map_lookup_elem(mfd, &zero, value)); in bpf_map_lookup_elem_with_ref_bit() [all …]
|
| D | test_lpm_map.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Randomized tests for eBPF longest-prefix-match maps 5 * This program runs randomized tests against the lpm-bpf-map. It implements a 9 * Based on tlpm, this inserts randomized data into bpf-lpm-maps and verifies 10 * the trie-based bpf-map implementation behaves the same way as tlpm. 34 uint8_t key[]; member 38 const uint8_t *key, 42 const uint8_t *key, in tlpm_add() argument 51 node = tlpm_match(list, key, n_bits); in tlpm_add() 52 if (node && node->n_bits == n_bits) { in tlpm_add() [all …]
|
| D | test_maps.c | 1 // SPDX-License-Identifier: GPL-2.0-only 39 long long key, next_key, first_key, value; in test_hashmap() local 42 fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_hashmap() 49 key = 1; in test_hashmap() 50 value = 1234; in test_hashmap() 51 /* Insert key=1 element. */ in test_hashmap() 52 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 54 value = 0; in test_hashmap() 56 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap() 57 /* key=1 already exists. */ in test_hashmap() [all …]
|
| /kernel/linux/linux-6.6/crypto/ |
| D | rsa_helper.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * RSA key extract helper 17 const void *value, size_t vlen) in rsa_get_n() argument 19 struct rsa_key *key = context; in rsa_get_n() local 20 const u8 *ptr = value; in rsa_get_n() 23 /* invalid key provided */ in rsa_get_n() 24 if (!value || !vlen) in rsa_get_n() 25 return -EINVAL; in rsa_get_n() 30 n_sz--; in rsa_get_n() 33 /* In FIPS mode only allow key size 2K and higher */ in rsa_get_n() [all …]
|
| /kernel/linux/linux-5.10/crypto/ |
| D | rsa_helper.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * RSA key extract helper 17 const void *value, size_t vlen) in rsa_get_n() argument 19 struct rsa_key *key = context; in rsa_get_n() local 20 const u8 *ptr = value; in rsa_get_n() 23 /* invalid key provided */ in rsa_get_n() 24 if (!value || !vlen) in rsa_get_n() 25 return -EINVAL; in rsa_get_n() 30 n_sz--; in rsa_get_n() 33 /* In FIPS mode only allow key size 2K and higher */ in rsa_get_n() [all …]
|
| /kernel/linux/linux-5.10/include/linux/ |
| D | bootconfig.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 17 #define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1) 29 /* Maximum size of boot config is 32KB - 1 */ 30 #define XBC_DATA_MAX (XBC_VALUE - 1) 45 * xbc_node_is_value() - Test the node is a value node 48 * Test the @node is a value node and return true if a value node, false if not. 52 return node->data & XBC_VALUE; in xbc_node_is_value() 56 * xbc_node_is_key() - Test the node is a key node 59 * Test the @node is a key node and return true if a key node, false if not. 67 * xbc_node_is_array() - Test the node is an arraied value node [all …]
|
| /kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
| D | lookup_and_delete.c | 1 // SPDX-License-Identifier: GPL-2.0-only 15 __u64 key, value = START_VALUE; in fill_values() local 18 for (key = 1; key < MAX_ENTRIES + 1; key++) { in fill_values() 19 err = bpf_map_update_elem(map_fd, &key, &value, BPF_NOEXIST); in fill_values() 21 return -1; in fill_values() 29 __u64 key, value[nr_cpus]; in fill_values_percpu() local 33 value[i] = START_VALUE; in fill_values_percpu() 35 for (key = 1; key < MAX_ENTRIES + 1; key++) { in fill_values_percpu() 36 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in fill_values_percpu() 38 return -1; in fill_values_percpu() [all …]
|
| D | map_init.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 pcpu_map_value_t value[nr_cpus]; in map_populate() local 24 map_key_t key; in map_populate() local 27 bpf_percpu(value, i) = FILL_VALUE; in map_populate() 29 for (key = 1; key <= num; key++) { in map_populate() 30 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in map_populate() 32 return -1; in map_populate() 48 err = bpf_map__set_type(skel->maps.hashmap1, map_type); in setup() 52 err = bpf_map__set_max_entries(skel->maps.hashmap1, map_sz); in setup() 60 *map_fd = bpf_map__fd(skel->maps.hashmap1); in setup() [all …]
|
| /kernel/linux/linux-6.6/include/linux/ |
| D | bootconfig.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 27 #define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1) 30 * xbc_calc_checksum() - Calculate checksum of bootconfig 34 * Calculate the checksum value of the bootconfig data. 43 while (size--) in xbc_calc_checksum() 59 /* Maximum size of boot config is 32KB - 1 */ 60 #define XBC_DATA_MAX (XBC_VALUE - 1) 75 * xbc_node_is_value() - Test the node is a value node 78 * Test the @node is a value node and return true if a value node, false if not. 82 return node->data & XBC_VALUE; in xbc_node_is_value() [all …]
|
| /kernel/linux/linux-5.10/Documentation/admin-guide/ |
| D | bootconfig.rst | 1 .. SPDX-License-Identifier: GPL-2.0 15 additional key-value data when booting the kernel in an efficient way. 16 This allows administrators to pass a structured-Key config file. 21 The boot config syntax is a simple structured key-value. Each key consists 22 of dot-connected-words, and key and value are connected by ``=``. The value 23 has to be terminated by semi-colon (``;``) or newline (``\n``). 24 For array value, array entries are separated by comma (``,``). :: 26 KEY[.WORD[...]] = VALUE[, VALUE2[...]][;] 30 Each key word must contain only alphabets, numbers, dash (``-``) or underscore 31 (``_``). And each value only contains printable characters or spaces except [all …]
|
| /kernel/linux/linux-6.6/Documentation/admin-guide/ |
| D | bootconfig.rst | 1 .. SPDX-License-Identifier: GPL-2.0 15 additional key-value data when booting the kernel in an efficient way. 16 This allows administrators to pass a structured-Key config file. 21 The boot config syntax is a simple structured key-value. Each key consists 22 of dot-connected-words, and key and value are connected by ``=``. The value 23 has to be terminated by semi-colon (``;``) or newline (``\n``). 24 For array value, array entries are separated by comma (``,``). :: 26 KEY[.WORD[...]] = VALUE[, VALUE2[...]][;] 30 Each key word must contain only alphabets, numbers, dash (``-``) or underscore 31 (``_``). And each value only contains printable characters or spaces except [all …]
|
| /kernel/linux/linux-6.6/tools/lib/bpf/ |
| D | hashmap.h | 1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 4 * Generic non-thread safe hash map implementation. 23 return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - bits); in hash_bits() 25 return (h * 2654435769lu) >> (__SIZEOF_LONG__ * 8 - bits); in hash_bits() 31 /* generic C-string hashing function */ 43 typedef size_t (*hashmap_hash_fn)(long key, void *ctx); 48 * long-sized integers or pointers, this is achieved as follows: 49 * - interface functions that operate on keys and values are hidden 50 * behind auxiliary macros, e.g. hashmap_insert <-> hashmap__insert; 51 * - these auxiliary macros cast the key and value parameters as [all …]
|
| /kernel/linux/linux-6.6/tools/perf/util/ |
| D | hashmap.h | 1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 4 * Generic non-thread safe hash map implementation. 23 return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - bits); in hash_bits() 25 return (h * 2654435769lu) >> (__SIZEOF_LONG__ * 8 - bits); in hash_bits() 31 /* generic C-string hashing function */ 43 typedef size_t (*hashmap_hash_fn)(long key, void *ctx); 48 * long-sized integers or pointers, this is achieved as follows: 49 * - interface functions that operate on keys and values are hidden 50 * behind auxiliary macros, e.g. hashmap_insert <-> hashmap__insert; 51 * - these auxiliary macros cast the key and value parameters as [all …]
|
| /kernel/linux/linux-6.6/samples/bpf/ |
| D | map_perf_test.bpf.c | 19 __type(key, u32); 20 __type(value, long); 26 __type(key, u32); 27 __type(value, long); 33 __type(key, u32); 34 __type(value, long); 41 __type(key, u32); 42 __type(value, long); 67 __type(key, u32); 68 __type(value, long); [all …]
|
| /kernel/linux/linux-5.10/samples/bpf/ |
| D | map_perf_test_kern.c | 21 __type(key, u32); 22 __type(value, long); 28 __type(key, u32); 29 __type(value, long); 35 __type(key, u32); 36 __type(value, long); 43 __type(key, u32); 44 __type(value, long); 69 __type(key, u32); 70 __type(value, long); [all …]
|
| /kernel/linux/linux-5.10/tools/lib/bpf/ |
| D | hashmap.h | 1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 4 * Generic non-thread safe hash map implementation. 23 return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - bits); in hash_bits() 25 return (h * 2654435769lu) >> (__SIZEOF_LONG__ * 8 - bits); in hash_bits() 31 /* generic C-string hashing function */ 43 typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx); 47 const void *key; member 48 void *value; member 86 * - HASHMAP_ADD - only add key/value if key doesn't exist yet; 87 * - HASHMAP_SET - add key/value pair if key doesn't exist yet; otherwise, [all …]
|
| /kernel/linux/linux-5.10/tools/perf/util/ |
| D | hashmap.h | 1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 4 * Generic non-thread safe hash map implementation. 23 return (h * 11400714819323198485llu) >> (__SIZEOF_LONG_LONG__ * 8 - bits); in hash_bits() 25 return (h * 2654435769lu) >> (__SIZEOF_LONG__ * 8 - bits); in hash_bits() 31 /* generic C-string hashing function */ 43 typedef size_t (*hashmap_hash_fn)(const void *key, void *ctx); 47 const void *key; member 48 void *value; member 86 * - HASHMAP_ADD - only add key/value if key doesn't exist yet; 87 * - HASHMAP_SET - add key/value pair if key doesn't exist yet; otherwise, [all …]
|
| /kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/ |
| D | map_init.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 pcpu_map_value_t value[nr_cpus]; in map_populate() local 24 map_key_t key; in map_populate() local 27 bpf_percpu(value, i) = FILL_VALUE; in map_populate() 29 for (key = 1; key <= num; key++) { in map_populate() 30 err = bpf_map_update_elem(map_fd, &key, value, BPF_NOEXIST); in map_populate() 32 return -1; in map_populate() 48 err = bpf_map__set_type(skel->maps.hashmap1, map_type); in setup() 52 err = bpf_map__set_max_entries(skel->maps.hashmap1, map_sz); in setup() 60 *map_fd = bpf_map__fd(skel->maps.hashmap1); in setup() [all …]
|
| /kernel/linux/linux-6.6/tools/bpf/bpftool/ |
| D | map.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ 59 return -1; in map_type_from_str() 64 if (map_is_per_cpu(info->type)) in alloc_value() 65 return malloc(round_up(info->value_size, 8) * in alloc_value() 68 return malloc(info->value_size); in alloc_value() 72 struct bpf_map_info *map_info, void *key, in do_dump_btf() argument 73 void *value) in do_dump_btf() argument 78 /* start of key-value pair */ in do_dump_btf() 79 jsonw_start_object(d->jw); in do_dump_btf() [all …]
|
| /kernel/linux/linux-5.10/tools/bpf/bpftool/ |
| D | map.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ 85 return -1; in map_type_from_str() 90 if (map_is_per_cpu(info->type)) in alloc_value() 91 return malloc(round_up(info->value_size, 8) * in alloc_value() 94 return malloc(info->value_size); in alloc_value() 98 struct bpf_map_info *map_info, void *key, in do_dump_btf() argument 99 void *value) in do_dump_btf() argument 104 /* start of key-value pair */ in do_dump_btf() 105 jsonw_start_object(d->jw); in do_dump_btf() [all …]
|
| /kernel/linux/linux-6.6/tools/testing/selftests/bpf/progs/ |
| D | lsm.c | 1 // SPDX-License-Identifier: GPL-2.0 17 __type(key, __u32); 18 __type(value, __u64); 24 __type(key, __u32); 25 __type(value, __u64); 31 __type(key, __u32); 32 __type(value, __u64); 38 __type(key, __u32); 39 __type(value, __u64); 45 __type(key, __u32); [all …]
|
| /kernel/linux/linux-5.10/fs/ |
| D | mbcache.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 * Mbcache is a simple key-value store. Keys need not be unique, however 13 * key-value pairs are expected to be unique (we use this fact in 18 * They use hash of data as a key and provide a value that may represent a 20 * data may be the same). However user provided value always uniquely 23 * We provide functions for creation and removal of entries, search by key, 24 * and a special "delete entry with given key-value pair" operation. Fixed 25 * size hash table is used for fast key lookups. 51 u32 key) in mb_cache_entry_head() argument 53 return &cache->c_hash[hash_32(key, cache->c_bucket_bits)]; in mb_cache_entry_head() [all …]
|