/linux-4.4.14/samples/bpf/ |
D | test_maps.c | 24 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 …]
|
D | sock_example.c | 33 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()
|
D | sockex1_user.c | 35 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()
|
D | tracex4_user.c | 40 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()
|
D | tracex2_user.c | 102 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()
|
D | libbpf.c | 37 .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()
|
D | sockex2_user.c | 39 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()
|
D | tracex6_user.c | 39 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()
|
D | bpf_load.c | 29 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()
|
D | sockex3_user.c | 54 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()
|
D | test_verifier.c | 1198 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 …]
|
D | bpf_load.h | 7 extern int map_fd[MAX_MAPS];
|
D | lathist_user.c | 97 get_data(map_fd[1]); in main()
|
D | tracex3_user.c | 145 print_hist(map_fd[1]); in main()
|
D | trace_output_user.c | 165 assert(bpf_update_elem(map_fd[0], &key, &pmu_fd, BPF_ANY) == 0); in test_bpf_perf_event()
|
/linux-4.4.14/kernel/bpf/ |
D | syscall.c | 226 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/ |
D | bpf.h | 110 __u32 map_fd; member
|
/linux-4.4.14/Documentation/networking/ |
D | filter.txt | 1105 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:
|