/openbmc/linux/tools/testing/selftests/bpf/prog_tests/ |
H A D | bpf_iter.c | 54 int iter_fd, len; in do_dummy_read_opts() local 60 iter_fd = bpf_iter_create(bpf_link__fd(link)); in do_dummy_read_opts() 61 if (!ASSERT_GE(iter_fd, 0, "create_iter")) in do_dummy_read_opts() 65 while ((len = read(iter_fd, buf, sizeof(buf))) > 0) in do_dummy_read_opts() 69 close(iter_fd); in do_dummy_read_opts() 87 int iter_fd, len; in do_read_map_iter_fd() local 97 iter_fd = bpf_iter_create(bpf_link__fd(link)); in do_read_map_iter_fd() 98 if (!ASSERT_GE(iter_fd, 0, "create_map_iter")) { in do_read_map_iter_fd() 117 while ((len = read(iter_fd, buf, sizeof(buf))) > 0) in do_read_map_iter_fd() 121 close(iter_fd); in do_read_map_iter_fd() [all …]
|
H A D | cgroup_iter.c | 56 int len, iter_fd; in read_from_cgroup_iter() local 71 iter_fd = bpf_iter_create(bpf_link__fd(link)); in read_from_cgroup_iter() 72 if (iter_fd < 0) in read_from_cgroup_iter() 78 while ((len = read(iter_fd, p, left)) > 0) { in read_from_cgroup_iter() 87 ASSERT_OK(read(iter_fd, buf, sizeof(buf)), "second_read"); in read_from_cgroup_iter() 89 close(iter_fd); in read_from_cgroup_iter() 198 int len, cgrp_fd, iter_fd; in test_walk_dead_self_only() local 222 iter_fd = bpf_iter_create(bpf_link__fd(link)); in test_walk_dead_self_only() 223 if (!ASSERT_GE(iter_fd, 0, "iter_create")) in test_walk_dead_self_only() 247 while ((len = read(iter_fd, p, left)) > 0) { in test_walk_dead_self_only() [all …]
|
H A D | bpf_iter_setsockopt.c | 109 int err, iter_fd = -1, listen_fd = -1; in do_bpf_iter_setsockopt() local 145 iter_fd = bpf_iter_create(bpf_link__fd(iter_skel->links.change_tcp_cc)); in do_bpf_iter_setsockopt() 146 if (!ASSERT_GE(iter_fd, 0, "create iter_fd")) in do_bpf_iter_setsockopt() 149 while ((err = read(iter_fd, &buf, sizeof(buf))) == -1 && in do_bpf_iter_setsockopt() 173 if (iter_fd != -1) in do_bpf_iter_setsockopt() 174 close(iter_fd); in do_bpf_iter_setsockopt()
|
H A D | bpf_iter_setsockopt_unix.c | 72 int err, unix_fd, iter_fd; in test_bpf_iter_setsockopt_unix() local 87 iter_fd = bpf_iter_create(bpf_link__fd(skel->links.change_sndbuf)); in test_bpf_iter_setsockopt_unix() 88 if (!ASSERT_GE(iter_fd, 0, "bpf_iter_create")) in test_bpf_iter_setsockopt_unix() 91 while ((err = read(iter_fd, &buf, sizeof(buf))) == -1 && in test_bpf_iter_setsockopt_unix()
|
H A D | sock_destroy.c | 15 int iter_fd, len; in start_iter_sockets() local 21 iter_fd = bpf_iter_create(bpf_link__fd(link)); in start_iter_sockets() 22 if (!ASSERT_GE(iter_fd, 0, "create_iter")) in start_iter_sockets() 25 while ((len = read(iter_fd, buf, sizeof(buf))) > 0) in start_iter_sockets() 29 close(iter_fd); in start_iter_sockets()
|
H A D | cgrp_local_storage.c | 161 int err, iter_fd; in test_cgroup_iter_sleepable() local 182 iter_fd = bpf_iter_create(bpf_link__fd(link)); in test_cgroup_iter_sleepable() 183 if (!ASSERT_GE(iter_fd, 0, "iter_create")) in test_cgroup_iter_sleepable() 187 (void)read(iter_fd, buf, sizeof(buf)); in test_cgroup_iter_sleepable() 191 close(iter_fd); in test_cgroup_iter_sleepable()
|
H A D | sockmap_basic.c | 193 int err, len, src_fd, iter_fd; in test_sockmap_copy() local 242 iter_fd = bpf_iter_create(bpf_link__fd(link)); in test_sockmap_copy() 243 if (!ASSERT_GE(iter_fd, 0, "create_iter")) in test_sockmap_copy() 247 while ((len = read(iter_fd, buf, sizeof(buf))) > 0) in test_sockmap_copy() 262 close(iter_fd); in test_sockmap_copy()
|
/openbmc/linux/tools/testing/selftests/bpf/map_tests/ |
H A D | map_percpu_stats.c | 189 static __u32 read_cur_elements(int iter_fd) in read_cur_elements() argument 195 n = read(iter_fd, buf, sizeof(buf)-1); in read_cur_elements() 211 int iter_fd; in get_cur_elements() local 225 iter_fd = bpf_iter_create(bpf_link__fd(link)); in get_cur_elements() 226 CHECK(iter_fd < 0, "bpf_iter_create", "error: %s\n", strerror(errno)); in get_cur_elements() 228 n_elements = read_cur_elements(iter_fd); in get_cur_elements() 230 close(iter_fd); in get_cur_elements()
|
/openbmc/linux/Documentation/bpf/ |
H A D | bpf_iterators.rst | 326 link = bpf_program__attach_iter(prog, &opts); iter_fd = 348 int iter_fd = -1, len; 356 iter_fd = bpf_iter_create(bpf_link__fd(link)); 357 if (iter_fd < 0) { 363 while ((len = read(iter_fd, buf, sizeof(buf) - 1)) > 0) { 369 if (iter_fd >= 0) 370 close(iter_fd);
|