/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/include/linux/ |
D | bootconfig.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 28 #define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1) 31 * xbc_calc_checksum() - Calculate checksum of bootconfig 35 * Calculate the checksum value of the bootconfig data. 44 while (size--) in xbc_calc_checksum() 60 /* Maximum size of boot config is 32KB - 1 */ 61 #define XBC_DATA_MAX (XBC_VALUE - 1) 76 * xbc_node_is_value() - Test the node is a value node 79 * Test the @node is a value node and return true if a value node, false if not. 83 return node->data & XBC_VALUE; in xbc_node_is_value() [all …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/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 …]
|
D | wq.c | 1 // SPDX-License-Identifier: GPL-2.0 22 __type(key, int); 23 __type(value, struct hmap_elem); 30 __type(key, int); 31 __type(value, struct hmap_elem); 42 __type(key, int); 43 __type(value, struct elem); 49 __type(key, int); 50 __type(value, struct elem); 56 static int test_elem_callback(void *map, int *key, in test_elem_callback() argument [all …]
|
D | bpf_iter_bpf_hash_map.c | 1 // SPDX-License-Identifier: GPL-2.0 17 __type(key, struct key_t); 18 __type(value, __u64); 24 __type(key, __u64); 25 __type(value, __u64); 31 __type(key, struct key_t); 32 __type(value, __u32); 45 struct seq_file *seq = ctx->meta->seq; in dump_bpf_hash_map() 46 __u32 seq_num = ctx->meta->seq_num; in dump_bpf_hash_map() 47 struct bpf_map *map = ctx->map; in dump_bpf_hash_map() [all …]
|
D | test_btf_map_in_map.c | 1 /* SPDX-License-Identifier: GPL-2.0 */ 9 __type(key, int); 10 __type(value, int); 17 __type(key, int); 18 __type(value, int); 24 __type(key, int); 25 __type(value, int); 32 __type(key, int); 33 __type(value, int); 48 __type(key, int); [all …]
|
/linux-6.12.1/drivers/md/dm-vdo/ |
D | int-map.c | 1 // SPDX-License-Identifier: GPL-2.0-only 38 * "no next hop" (i.e. NULL) as the natural initial value of zero, the offsets are biased by one 45 * need to ensure the table is pre-sized to be large enough so no resize is ever needed, or we'll 49 #include "int-map.h" 55 #include "memory-alloc.h" 62 #define NULL_HOP_OFFSET 0 /* the hop offset value terminating the hop list */ 66 * struct bucket - hash bucket 69 * tempting to encode the hop offsets separately and maintain alignment of key/value pairs, but 81 /** @key: The key stored in this bucket. */ 82 u64 key; member [all …]
|
/linux-6.12.1/drivers/input/ |
D | sparse-keymap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 14 #include <linux/input/sparse-keymap.h> 25 struct key_entry *key; in sparse_keymap_get_key_index() local 28 for (key = dev->keycode; key->type != KE_END; key++) { in sparse_keymap_get_key_index() 29 if (key->type == KE_KEY) { in sparse_keymap_get_key_index() 30 if (key == k) in sparse_keymap_get_key_index() 42 struct key_entry *key; in sparse_keymap_entry_by_index() local 45 for (key = dev->keycode; key->type != KE_END; key++) in sparse_keymap_entry_by_index() 46 if (key->type == KE_KEY) in sparse_keymap_entry_by_index() 48 return key; in sparse_keymap_entry_by_index() [all …]
|
/linux-6.12.1/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 …]
|
/linux-6.12.1/tools/testing/selftests/riscv/hwprobe/ |
D | which-cpus.c | 1 // SPDX-License-Identifier: GPL-2.0-only 22 "which-cpus: [-h] [<key=value> [<key=value> ...]]\n\n" in help() 25 " <key=value>, outputs the cpulist for cpus which all match the given set\n" in help() 26 " of pairs. 'key' and 'value' should be in numeric form, e.g. 4=0x3b\n"); in help() 41 printf("-%d", end); in print_cpulist() 55 printf("-%d", end); in print_cpulist() 62 int nr_pairs = argc - 1; in do_which_cpus() 71 pairs[i].key = strtol(start, &end, 0); in do_which_cpus() 74 pairs[i].value = strtoul(start, &end, 0); in do_which_cpus() 95 if (!strcmp(argv[1], "-h")) in main() [all …]
|
/linux-6.12.1/drivers/target/iscsi/ |
D | iscsi_target_parameters.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * (c) Copyright 2007-2013 Datera, Inc. 7 * Author: Nicholas A. Bellinger <nab@linux-iscsi.org> 33 return -1; in iscsi_login_rx_data() 64 return -1; in iscsi_login_tx_data() 72 pr_debug("HeaderDigest: %s\n", (conn_ops->HeaderDigest) ? in iscsi_dump_conn_ops() 74 pr_debug("DataDigest: %s\n", (conn_ops->DataDigest) ? in iscsi_dump_conn_ops() 77 conn_ops->MaxRecvDataSegmentLength); in iscsi_dump_conn_ops() 82 pr_debug("InitiatorName: %s\n", sess_ops->InitiatorName); in iscsi_dump_sess_ops() 83 pr_debug("InitiatorAlias: %s\n", sess_ops->InitiatorAlias); in iscsi_dump_sess_ops() [all …]
|
/linux-6.12.1/Documentation/netlink/specs/ |
D | tc.yaml | 1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 4 protocol: netlink-raw 12 - 16 - 19 - 23 - 26 - 29 - 32 - 35 - [all …]
|
/linux-6.12.1/drivers/thunderbolt/ |
D | property.c | 1 // SPDX-License-Identifier: GPL-2.0 22 u32 value; member 55 switch (entry->type) { in tb_property_entry_valid() 59 if (entry->length > block_len) in tb_property_entry_valid() 61 if (entry->value + entry->length > block_len) in tb_property_entry_valid() 66 if (entry->length != 1) in tb_property_entry_valid() 74 static bool tb_property_key_valid(const char *key) in tb_property_key_valid() argument 76 return key && strlen(key) <= TB_PROPERTY_KEY_SIZE; in tb_property_key_valid() 80 tb_property_alloc(const char *key, enum tb_property_type type) in tb_property_alloc() argument 88 strcpy(property->key, key); in tb_property_alloc() [all …]
|
/linux-6.12.1/Documentation/bpf/ |
D | map_hash.rst | 1 .. SPDX-License-Identifier: GPL-2.0-only 3 .. Copyright (C) 2022-2023 Isovalent, Inc. 10 - ``BPF_MAP_TYPE_HASH`` was introduced in kernel version 3.19 11 - ``BPF_MAP_TYPE_PERCPU_HASH`` was introduced in version 4.6 12 - Both ``BPF_MAP_TYPE_LRU_HASH`` and ``BPF_MAP_TYPE_LRU_PERCPU_HASH`` 16 purpose hash map storage. Both the key and the value can be structs, 19 The kernel is responsible for allocating and freeing key/value pairs, up 20 to the max_entries limit that you specify. Hash maps use pre-allocation 22 used to disable pre-allocation when it is too memory expensive. 24 ``BPF_MAP_TYPE_PERCPU_HASH`` provides a separate value slot per [all …]
|
/linux-6.12.1/tools/bpf/bpftool/Documentation/ |
D | bpftool-map.rst | 1 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 4 bpftool-map 6 ------------------------------------------------------------------------------- 8 ------------------------------------------------------------------------------- 19 *OPTIONS* := { |COMMON_OPTIONS| | { **-f** | **--bpffs** } | { **-n** | **--nomount** } } 29 | **bpftool** **map create** *FILE* **type** *TYPE* **key** *KEY_SIZE* **value** *VALUE_SIZE* \ 33 | **bpftool** **map update** *MAP* [**key** *DATA*] [**value** *VALUE*] [*UPDATE_FLAGS*] 34 | **bpftool** **map lookup** *MAP* [**key** *DATA*] 35 | **bpftool** **map getnext** *MAP* [**key** *DATA*] 36 | **bpftool** **map delete** *MAP* **key** *DATA* [all …]
|