Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 519) sorted by relevance

12345678910>>...21

/tools/testing/selftests/bpf/progs/
Dtest_tunnel_kern.c73 __type(key, __u32);
81 struct bpf_tunnel_key key; in gre_set_tunnel() local
83 __builtin_memset(&key, 0x0, sizeof(key)); in gre_set_tunnel()
84 key.remote_ipv4 = 0xac100164; /* 172.16.1.100 */ in gre_set_tunnel()
85 key.tunnel_id = 2; in gre_set_tunnel()
86 key.tunnel_tos = 0; in gre_set_tunnel()
87 key.tunnel_ttl = 64; in gre_set_tunnel()
89 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in gre_set_tunnel()
103 struct bpf_tunnel_key key; in gre_set_tunnel_no_key() local
105 __builtin_memset(&key, 0x0, sizeof(key)); in gre_set_tunnel_no_key()
[all …]
Dmap_kptr_fail.c18 __type(key, int);
28 int key = 0; in size_not_bpf_dw() local
30 v = bpf_map_lookup_elem(&array_map, &key); in size_not_bpf_dw()
43 int key = 0, id; in non_const_var_off() local
45 v = bpf_map_lookup_elem(&array_map, &key); in non_const_var_off()
62 int key = 0, id; in non_const_var_off_kptr_xchg() local
64 v = bpf_map_lookup_elem(&array_map, &key); in non_const_var_off_kptr_xchg()
81 int key = 0; in misaligned_access_write() local
83 v = bpf_map_lookup_elem(&array_map, &key); in misaligned_access_write()
97 int key = 0; in misaligned_access_read() local
[all …]
Dtest_btf_map_in_map.c9 __type(key, int);
17 __type(key, int);
24 __type(key, int);
32 __type(key, int);
48 __type(key, int);
57 __type(key, int);
64 __type(key, int);
70 __type(key, int);
84 __type(key, int);
100 __type(key, int);
[all …]
Dtest_spin_lock_fail.c14 __type(key, int);
22 __type(key, int);
57 int key = 0; in lock_id_mapval_preserve() local
59 f = bpf_map_lookup_elem(&array_map, &key); in lock_id_mapval_preserve()
70 int key = 0; in lock_id_innermapval_preserve() local
73 map = bpf_map_lookup_elem(&map_of_maps, &key); in lock_id_innermapval_preserve()
76 f = bpf_map_lookup_elem(map, &key); in lock_id_innermapval_preserve()
88 int key = 0; \
91 map = bpf_map_lookup_elem(&map_of_maps, &key); \
94 iv = bpf_map_lookup_elem(map, &key); \
[all …]
Dbpf_iter_bpf_hash_map.c17 __type(key, struct key_t);
24 __type(key, __u64);
31 __type(key, struct key_t);
48 struct key_t *key = ctx->key; in dump_bpf_hash_map() local
63 if (key == (void *)0 || val == (void *)0) in dump_bpf_hash_map()
70 __builtin_memcpy(&tmp_key, key, sizeof(struct key_t)); in dump_bpf_hash_map()
78 key_sum_a += key->a; in dump_bpf_hash_map()
79 key_sum_b += key->b; in dump_bpf_hash_map()
80 key_sum_c += key->c; in dump_bpf_hash_map()
105 if (key == (void *)0 || val == (void *)0) { in dump_bpf_hash_map()
[all …]
Dtimer.c19 __type(key, int);
27 __type(key, int);
38 __type(key, int);
45 __type(key, int);
52 __type(key, int);
69 static int timer_cb1(void *map, int *key, struct bpf_timer *timer) in timer_cb1() argument
79 if (*key == ARRAY) { in timer_cb1()
93 } else if (*key == LRU) { in timer_cb1()
118 if (*key != LRU) in timer_cb1()
164 static int timer_cb2(void *map, int *key, struct hmap_elem *val) in timer_cb2() argument
[all …]
Dtest_map_in_map.c12 __type(key, __u32);
20 __type(key, int);
30 __type(key, __u32);
37 __type(key, __u32);
45 __type(key, __u32);
55 int key = 0; in xdp_mimtest0() local
58 map = bpf_map_lookup_elem(&mim_array, &key); in xdp_mimtest0()
62 bpf_map_update_elem(map, &key, &value, 0); in xdp_mimtest0()
63 value_p = bpf_map_lookup_elem(map, &key); in xdp_mimtest0()
67 map = bpf_map_lookup_elem(&mim_hash, &key); in xdp_mimtest0()
[all …]
Dtest_stacktrace_build_id.c14 __type(key, __u32);
21 __type(key, __u32);
31 __type(key, __u32);
38 __type(key, __u32);
47 __u32 key = 0, val = 0, *value_p; in oncpu() local
50 value_p = bpf_map_lookup_elem(&control_map, &key); in oncpu()
55 key = bpf_get_stackid(args, &stackmap, BPF_F_USER_STACK); in oncpu()
56 if ((int)key >= 0) { in oncpu()
57 bpf_map_update_elem(&stackid_hmap, &key, &val, 0); in oncpu()
58 stack_p = bpf_map_lookup_elem(&stack_amap, &key); in oncpu()
Dbpf_iter_bpf_array_map.c18 __type(key, __u32);
25 __type(key, __u64);
35 __u32 *hmap_val, *key = ctx->key; in dump_bpf_array_map() local
38 if (key == (void *)0 || val == (void *)0) in dump_bpf_array_map()
41 bpf_seq_write(ctx->meta->seq, key, sizeof(__u32)); in dump_bpf_array_map()
43 key_sum += *key; in dump_bpf_array_map()
55 *hmap_val = *key; in dump_bpf_array_map()
57 *val = *key; in dump_bpf_array_map()
Dtest_stacktrace_map.c14 __type(key, __u32);
21 __type(key, __u32);
30 __type(key, __u32);
37 __type(key, __u32);
57 __u32 key = 0, val = 0, *value_p; in oncpu() local
60 value_p = bpf_map_lookup_elem(&control_map, &key); in oncpu()
65 key = bpf_get_stackid(ctx, &stackmap, 0); in oncpu()
66 if ((int)key >= 0) { in oncpu()
67 bpf_map_update_elem(&stackid_hmap, &key, &val, 0); in oncpu()
68 stack_p = bpf_map_lookup_elem(&stack_amap, &key); in oncpu()
/tools/testing/selftests/bpf/
Dtest_lru_map.c42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key, 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()
150 unsigned long long key, value[nr_cpus]; in test_lru_sanity0() local
172 key = 1; in test_lru_sanity0()
173 assert(!bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST)); in test_lru_sanity0()
174 assert(!bpf_map_update_elem(expected_map_fd, &key, value, in test_lru_sanity0()
178 assert(bpf_map_update_elem(lru_map_fd, &key, value, BPF_NOEXIST) == -EEXIST); in test_lru_sanity0()
181 assert(bpf_map_update_elem(lru_map_fd, &key, value, -1) == -EINVAL); in test_lru_sanity0()
186 key = 2; in test_lru_sanity0()
187 assert(bpf_map_lookup_elem(lru_map_fd, &key, value) == -ENOENT); in test_lru_sanity0()
[all …]
Dtest_lpm_map.c33 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()
52 memcpy(node->key, key, n); in tlpm_add()
63 memcpy(node->key, key, n); in tlpm_add()
81 const uint8_t *key, in tlpm_match() argument
95 if ((key[i / 8] & (1 << (7 - i % 8))) != in tlpm_match()
96 (list->key[i / 8] & (1 << (7 - i % 8)))) in tlpm_match()
110 const uint8_t *key, in tlpm_delete() argument
[all …]
Dtest_maps.c39 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()
51 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
55 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap()
60 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap()
64 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap()
66 key = 2; in test_hashmap()
69 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap()
72 assert(bpf_map_lookup_and_delete_elem(fd, &key, &value) == 0 && value == 1234); in test_hashmap()
[all …]
/tools/perf/arch/x86/util/
Dkvm-stat.c31 struct event_key *key) in mmio_event_get_key() argument
33 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key()
34 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key()
42 struct perf_sample *sample, struct event_key *key) in mmio_event_begin() argument
51 mmio_event_get_key(evsel, sample, key); in mmio_event_begin()
59 struct event_key *key) in mmio_event_end() argument
68 mmio_event_get_key(evsel, sample, key); in mmio_event_end()
76 struct event_key *key, in mmio_event_decode_key() argument
80 (unsigned long)key->key, in mmio_event_decode_key()
81 key->info == KVM_TRACE_MMIO_WRITE ? "W" : "R"); in mmio_event_decode_key()
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dlookup_and_delete.c15 __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()
29 __u64 key, value[nr_cpus]; in fill_values_percpu() local
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()
78 static int trigger_tp(struct test_lookup_and_delete *skel, __u64 key, in trigger_tp() argument
84 skel->bss->set_key = key; in trigger_tp()
101 __u64 key, value; in test_lookup_and_delete_hash() local
114 key = 1; in test_lookup_and_delete_hash()
[all …]
Dcg_storage_multi.c22 static bool assert_storage(struct bpf_map *map, const void *key, in assert_storage() argument
30 if (CHECK(bpf_map_lookup_elem(map_fd, key, &value) < 0, in assert_storage()
40 static bool assert_storage_noexist(struct bpf_map *map, const void *key) in assert_storage_noexist() argument
47 if (CHECK(bpf_map_lookup_elem(map_fd, key, &value) == 0, in assert_storage_noexist()
92 struct bpf_cgroup_storage_key key; in test_egress_only() local
96 key.attach_type = BPF_CGROUP_INET_EGRESS; in test_egress_only()
117 key.cgroup_inode_id = get_cgroup_id(PARENT_CGROUP); in test_egress_only()
120 &key, &expected_cgroup_value)) in test_egress_only()
122 key.cgroup_inode_id = get_cgroup_id(CHILD_CGROUP); in test_egress_only()
123 if (assert_storage_noexist(obj->maps.cgroup_storage, &key)) in test_egress_only()
[all …]
/tools/perf/util/bpf_skel/
Dkwork_trace.bpf.c89 static __always_inline int trace_event_match(struct work_key *key, char *name) in trace_event_match() argument
116 static __always_inline void do_update_time(void *map, struct work_key *key, in do_update_time() argument
125 data = bpf_map_lookup_elem(map, key); in do_update_time()
128 bpf_map_update_elem(map, key, &zero, BPF_NOEXIST); in do_update_time()
129 data = bpf_map_lookup_elem(map, key); in do_update_time()
145 static __always_inline void do_update_timestart(void *map, struct work_key *key) in do_update_timestart() argument
149 bpf_map_update_elem(map, key, &ts, BPF_ANY); in do_update_timestart()
153 struct work_key *key) in do_update_timeend() argument
155 __u64 *time = bpf_map_lookup_elem(time_map, key); in do_update_timeend()
158 bpf_map_delete_elem(time_map, key); in do_update_timeend()
[all …]
/tools/perf/arch/s390/util/
Dkvm-stat.c28 struct event_key *key) in event_icpt_insn_get_key() argument
33 key->key = icpt_insn_decoder(insn); in event_icpt_insn_get_key()
34 key->exit_reasons = sie_icpt_insn_codes; in event_icpt_insn_get_key()
39 struct event_key *key) in event_sigp_get_key() argument
41 key->key = evsel__intval(evsel, sample, "order_code"); in event_sigp_get_key()
42 key->exit_reasons = sie_sigp_order_codes; in event_sigp_get_key()
47 struct event_key *key) in event_diag_get_key() argument
49 key->key = evsel__intval(evsel, sample, "code"); in event_diag_get_key()
50 key->exit_reasons = sie_diagnose_codes; in event_diag_get_key()
55 struct event_key *key) in event_icpt_prog_get_key() argument
[all …]
/tools/perf/arch/arm64/util/
Dkvm-stat.c26 struct event_key *key) in event_get_key() argument
28 key->info = 0; in event_get_key()
29 key->key = evsel__intval(evsel, sample, kvm_exit_reason); in event_get_key()
30 key->exit_reasons = arm64_exit_reasons; in event_get_key()
37 if (key->key == ARM_EXCEPTION_TRAP) { in event_get_key()
38 key->key = evsel__intval(evsel, sample, kvm_trap_exit_reason); in event_get_key()
39 key->exit_reasons = arm64_trap_exit_reasons; in event_get_key()
45 struct event_key *key __maybe_unused) in event_begin()
52 struct event_key *key) in event_end() argument
55 event_get_key(evsel, sample, key); in event_end()
/tools/perf/util/
Dhashmap.h43 typedef size_t (*hashmap_hash_fn)(long key, void *ctx);
62 long key; member
129 int hashmap_insert(struct hashmap *map, long key, long value,
133 #define hashmap__insert(map, key, value, strategy, old_key, old_value) \ argument
134 hashmap_insert((map), (long)(key), (long)(value), (strategy), \
138 #define hashmap__add(map, key, value) \ argument
139 hashmap__insert((map), (key), (value), HASHMAP_ADD, NULL, NULL)
141 #define hashmap__set(map, key, value, old_key, old_value) \ argument
142 hashmap__insert((map), (key), (value), HASHMAP_SET, (old_key), (old_value))
144 #define hashmap__update(map, key, value, old_key, old_value) \ argument
[all …]
/tools/lib/bpf/
Dhashmap.h43 typedef size_t (*hashmap_hash_fn)(long key, void *ctx);
62 long key; member
129 int hashmap_insert(struct hashmap *map, long key, long value,
133 #define hashmap__insert(map, key, value, strategy, old_key, old_value) \ argument
134 hashmap_insert((map), (long)(key), (long)(value), (strategy), \
138 #define hashmap__add(map, key, value) \ argument
139 hashmap__insert((map), (key), (value), HASHMAP_ADD, NULL, NULL)
141 #define hashmap__set(map, key, value, old_key, old_value) \ argument
142 hashmap__insert((map), (key), (value), HASHMAP_SET, (old_key), (old_value))
144 #define hashmap__update(map, key, value, old_key, old_value) \ argument
[all …]
/tools/perf/ui/tui/
Dutil.c28 int key; in popup_menu__run() local
34 key = ui_browser__run(menu, 0); in popup_menu__run()
36 switch (key) { in popup_menu__run()
39 key = menu->index; in popup_menu__run()
45 key = -1; in popup_menu__run()
49 *keyp = key; in popup_menu__run()
50 key = menu->nr_entries; in popup_menu__run()
60 return key; in popup_menu__run()
78 int x, y, len, key; in ui_browser__input_window() local
132 key = ui__getch(delay_secs); in ui_browser__input_window()
[all …]
/tools/testing/selftests/drivers/net/netdevsim/
Dethtool-coalesce.sh14 for key in ${!SETTINGS_MAP[@]}; do
15 CURRENT_SETTINGS[$key]=$(get_value $key)
99 for key in ${!SETTINGS_MAP[@]}; do
100 EXPECTED_SETTINGS[$key]=$(get_value $key)
104 for key in ${!SETTINGS_MAP[@]}; do
107 ethtool -C $NSIM_NETDEV "$key" "$value"
109 EXPECTED_SETTINGS[$key]="$value"
Dethtool-ring.sh15 for key in ${!SETTINGS_MAP[@]}; do
16 CURRENT_SETTINGS[$key]=$(get_value $key)
61 for key in ${!SETTINGS_MAP[@]}; do
62 EXPECTED_SETTINGS[$key]=$(get_value $key)
66 for key in ${!SETTINGS_MAP[@]}; do
69 ethtool -G $NSIM_NETDEV "$key" "$value"
71 EXPECTED_SETTINGS[$key]="$value"
/tools/testing/selftests/riscv/hwprobe/
Dhwprobe.c27 pairs[i].key = i; in main()
33 if ((i < 4) && (pairs[i].key != i)) in main()
36 if (pairs[i].key != RISCV_HWPROBE_KEY_BASE_BEHAVIOR) in main()
65 pairs[0].key = RISCV_HWPROBE_KEY_BASE_BEHAVIOR; in main()
69 if (pairs[0].key != RISCV_HWPROBE_KEY_BASE_BEHAVIOR) in main()
76 pairs[0].key = 0x5555; in main()
77 pairs[1].key = 1; in main()
83 if (pairs[0].key != -1) in main()
86 if ((pairs[1].key != 1) || (pairs[1].value == 0xAAAA)) in main()

12345678910>>...21