Home
last modified time | relevance | path

Searched refs:map_fd (Results 1 – 18 of 18) sorted by relevance

/linux-4.4.14/samples/bpf/
Dtest_maps.c24 int map_fd; in test_hashmap_sanity() local
26 map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), 2); in test_hashmap_sanity()
27 if (map_fd < 0) { in test_hashmap_sanity()
35 assert(bpf_update_elem(map_fd, &key, &value, BPF_ANY) == 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()
[all …]
Dsock_example.c33 int sock = -1, map_fd, prog_fd, i, key; in test_sock() local
36 map_fd = bpf_create_map(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), in test_sock()
38 if (map_fd < 0) { in test_sock()
49 BPF_LD_MAP_FD(BPF_REG_1, map_fd), in test_sock()
75 assert(bpf_lookup_elem(map_fd, &key, &tcp_cnt) == 0); in test_sock()
78 assert(bpf_lookup_elem(map_fd, &key, &udp_cnt) == 0); in test_sock()
81 assert(bpf_lookup_elem(map_fd, &key, &icmp_cnt) == 0); in test_sock()
Dsockex1_user.c35 assert(bpf_lookup_elem(map_fd[0], &key, &tcp_cnt) == 0); in main()
38 assert(bpf_lookup_elem(map_fd[0], &key, &udp_cnt) == 0); in main()
41 assert(bpf_lookup_elem(map_fd[0], &key, &icmp_cnt) == 0); in main()
Dtracex4_user.c40 while (bpf_get_next_key(map_fd[0], &key, &next_key) == 0) { in print_old_objects()
41 bpf_lookup_elem(map_fd[0], &next_key, &v); in print_old_objects()
64 print_old_objects(map_fd[1]); in main()
Dtracex2_user.c102 print_hist(map_fd[1]); in int_exit()
132 while (bpf_get_next_key(map_fd[0], &key, &next_key) == 0) { in main()
133 bpf_lookup_elem(map_fd[0], &next_key, &value); in main()
141 print_hist(map_fd[1]); in main()
Dlibbpf.c37 .map_fd = fd, in bpf_update_elem()
49 .map_fd = fd, in bpf_lookup_elem()
60 .map_fd = fd, in bpf_delete_elem()
70 .map_fd = fd, in bpf_get_next_key()
Dsockex2_user.c39 while (bpf_get_next_key(map_fd[0], &key, &next_key) == 0) { in main()
40 bpf_lookup_elem(map_fd[0], &next_key, &value); in main()
Dtracex6_user.c39 bpf_update_elem(map_fd[0], &i, &pmu_fd[i], BPF_ANY); in test_bpf_perf_event()
53 close(map_fd[0]); in test_bpf_perf_event()
Dbpf_load.c29 int map_fd[MAX_MAPS]; variable
157 map_fd[i] = bpf_create_map(maps[i].type, in load_maps()
161 if (map_fd[i] < 0) in load_maps()
165 prog_array_fd = map_fd[i]; in load_maps()
217 insn[insn_idx].imm = map_fd[sym.st_value / sizeof(struct bpf_map_def)]; in parse_relo_and_apply()
Dsockex3_user.c54 while (bpf_get_next_key(map_fd[2], &key, &next_key) == 0) { in main()
55 bpf_lookup_elem(map_fd[2], &next_key, &value); in main()
Dtest_verifier.c1198 int map_fd; in create_map() local
1200 map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, in create_map()
1202 if (map_fd < 0) in create_map()
1205 return map_fd; in create_map()
1210 int map_fd; in create_prog_array() local
1212 map_fd = bpf_create_map(BPF_MAP_TYPE_PROG_ARRAY, in create_prog_array()
1214 if (map_fd < 0) in create_prog_array()
1217 return map_fd; in create_prog_array()
1233 int map_fd = -1, prog_array_fd = -1; in test() local
1236 map_fd = create_map(); in test()
[all …]
Dbpf_load.h7 extern int map_fd[MAX_MAPS];
Dlathist_user.c97 get_data(map_fd[1]); in main()
Dtracex3_user.c145 print_hist(map_fd[1]); in main()
Dtrace_output_user.c165 assert(bpf_update_elem(map_fd[0], &key, &pmu_fd, BPF_ANY) == 0); in test_bpf_perf_event()
/linux-4.4.14/kernel/bpf/
Dsyscall.c226 int ufd = attr->map_fd; in map_lookup_elem()
285 int ufd = attr->map_fd; in map_update_elem()
338 int ufd = attr->map_fd; in map_delete_elem()
379 int ufd = attr->map_fd; in map_get_next_key()
/linux-4.4.14/include/uapi/linux/
Dbpf.h110 __u32 map_fd; member
/linux-4.4.14/Documentation/networking/
Dfilter.txt1105 map_fd = bpf(BPF_MAP_CREATE, union bpf_attr *attr, u32 size)
1111 using attr->map_fd, attr->key, attr->value
1116 using attr->map_fd, attr->key, attr->value
1121 using attr->map_fd, attr->key
1186 Program that uses invalid map_fd=0 while calling to map_lookup_elem() function: