Home
last modified time | relevance | path

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

/linux-4.1.27/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()
Dtracex2_user.c53 print_hist(map_fd[1]); in int_exit()
83 while (bpf_get_next_key(map_fd[0], &key, &next_key) == 0) { in main()
84 bpf_lookup_elem(map_fd[0], &next_key, &value); in main()
92 print_hist(map_fd[1]); in main()
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()
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()
Dtest_verifier.c762 int map_fd; in create_map() local
764 map_fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(key), sizeof(value), 1024); in create_map()
765 if (map_fd < 0) { in create_map()
769 return map_fd; in create_map()
780 int map_fd = -1; in test() local
783 map_fd = create_map(); in test()
786 prog[*fixup].imm = map_fd; in test()
822 if (map_fd >= 0) in test()
823 close(map_fd); in test()
Dbpf_load.c28 int map_fd[MAX_MAPS]; variable
127 map_fd[i] = bpf_create_map(maps[i].type, in load_maps()
131 if (map_fd[i] < 0) in load_maps()
184 insn[insn_idx].imm = map_fd[sym.st_value / sizeof(struct bpf_map_def)]; in parse_relo_and_apply()
Dbpf_load.h7 extern int map_fd[MAX_MAPS];
Dtracex3_user.c145 print_hist(map_fd[1]); in main()
/linux-4.1.27/kernel/bpf/
Dsyscall.c151 int ufd = attr->map_fd; in map_lookup_elem()
209 int ufd = attr->map_fd; in map_update_elem()
261 int ufd = attr->map_fd; in map_delete_elem()
301 int ufd = attr->map_fd; in map_get_next_key()
/linux-4.1.27/include/uapi/linux/
Dbpf.h142 __u32 map_fd; member
/linux-4.1.27/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: