Lines Matching refs:value

23 	long long key, next_key, value;  in test_hashmap_sanity()  local
26 map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), 2); in test_hashmap_sanity()
33 value = 1234; in test_hashmap_sanity()
35 assert(bpf_update_elem(map_fd, &key, &value, BPF_ANY) == 0); in test_hashmap_sanity()
37 value = 0; in test_hashmap_sanity()
39 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap_sanity()
43 assert(bpf_update_elem(map_fd, &key, &value, -1) == -1 && errno == EINVAL); in test_hashmap_sanity()
46 assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && value == 1234); in test_hashmap_sanity()
50 assert(bpf_lookup_elem(map_fd, &key, &value) == -1 && errno == ENOENT); in test_hashmap_sanity()
53 assert(bpf_update_elem(map_fd, &key, &value, BPF_EXIST) == -1 && in test_hashmap_sanity()
58 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == 0); in test_hashmap_sanity()
64 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == -1 && in test_hashmap_sanity()
95 long long value; in test_arraymap_sanity() local
97 map_fd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2); in test_arraymap_sanity()
104 value = 1234; in test_arraymap_sanity()
106 assert(bpf_update_elem(map_fd, &key, &value, BPF_ANY) == 0); in test_arraymap_sanity()
108 value = 0; in test_arraymap_sanity()
109 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == -1 && in test_arraymap_sanity()
113 assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && value == 1234); in test_arraymap_sanity()
117 assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && value == 0); in test_arraymap_sanity()
124 assert(bpf_update_elem(map_fd, &key, &value, BPF_EXIST) == -1 && in test_arraymap_sanity()
128 assert(bpf_lookup_elem(map_fd, &key, &value) == -1 && errno == ENOENT); in test_arraymap_sanity()
153 int map_fd, i, value; in test_map_large() local
156 map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_map_large()
165 value = i; in test_map_large()
166 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == 0); in test_map_large()
169 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == -1 && in test_map_large()
178 assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && value == 0); in test_map_large()
180 assert(bpf_lookup_elem(map_fd, &key, &value) == -1 && errno == ENOENT); in test_map_large()
223 int key, value; in do_work() local
226 key = value = i; in do_work()
228 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == 0); in do_work()
236 int i, map_fd, key = 0, value = 0; in test_map_parallel() local
239 map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), in test_map_parallel()
257 assert(bpf_update_elem(map_fd, &key, &value, BPF_NOEXIST) == -1 && in test_map_parallel()
269 assert(bpf_lookup_elem(map_fd, &key, &value) == 0 && in test_map_parallel()
270 value == key); in test_map_parallel()