Lines Matching refs:opts
170 const struct bpf_map_create_opts *opts) in bpf_map_create() argument
180 if (!OPTS_VALID(opts, bpf_map_create_opts)) in bpf_map_create()
190 attr.btf_fd = OPTS_GET(opts, btf_fd, 0); in bpf_map_create()
191 attr.btf_key_type_id = OPTS_GET(opts, btf_key_type_id, 0); in bpf_map_create()
192 attr.btf_value_type_id = OPTS_GET(opts, btf_value_type_id, 0); in bpf_map_create()
193 attr.btf_vmlinux_value_type_id = OPTS_GET(opts, btf_vmlinux_value_type_id, 0); in bpf_map_create()
195 attr.inner_map_fd = OPTS_GET(opts, inner_map_fd, 0); in bpf_map_create()
196 attr.map_flags = OPTS_GET(opts, map_flags, 0); in bpf_map_create()
197 attr.map_extra = OPTS_GET(opts, map_extra, 0); in bpf_map_create()
198 attr.numa_node = OPTS_GET(opts, numa_node, 0); in bpf_map_create()
199 attr.map_ifindex = OPTS_GET(opts, map_ifindex, 0); in bpf_map_create()
233 const struct bpf_prog_load_opts *opts) in bpf_prog_load() argument
246 if (!OPTS_VALID(opts, bpf_prog_load_opts)) in bpf_prog_load()
249 attempts = OPTS_GET(opts, attempts, 0); in bpf_prog_load()
258 attr.expected_attach_type = OPTS_GET(opts, expected_attach_type, 0); in bpf_prog_load()
260 attr.prog_btf_fd = OPTS_GET(opts, prog_btf_fd, 0); in bpf_prog_load()
261 attr.prog_flags = OPTS_GET(opts, prog_flags, 0); in bpf_prog_load()
262 attr.prog_ifindex = OPTS_GET(opts, prog_ifindex, 0); in bpf_prog_load()
263 attr.kern_version = OPTS_GET(opts, kern_version, 0); in bpf_prog_load()
275 attach_prog_fd = OPTS_GET(opts, attach_prog_fd, 0); in bpf_prog_load()
276 attach_btf_obj_fd = OPTS_GET(opts, attach_btf_obj_fd, 0); in bpf_prog_load()
281 attr.attach_btf_id = OPTS_GET(opts, attach_btf_id, 0); in bpf_prog_load()
287 log_buf = OPTS_GET(opts, log_buf, NULL); in bpf_prog_load()
288 log_size = OPTS_GET(opts, log_size, 0); in bpf_prog_load()
289 log_level = OPTS_GET(opts, log_level, 0); in bpf_prog_load()
298 func_info_rec_size = OPTS_GET(opts, func_info_rec_size, 0); in bpf_prog_load()
299 func_info = OPTS_GET(opts, func_info, NULL); in bpf_prog_load()
302 attr.func_info_cnt = OPTS_GET(opts, func_info_cnt, 0); in bpf_prog_load()
304 line_info_rec_size = OPTS_GET(opts, line_info_rec_size, 0); in bpf_prog_load()
305 line_info = OPTS_GET(opts, line_info, NULL); in bpf_prog_load()
308 attr.line_info_cnt = OPTS_GET(opts, line_info_cnt, 0); in bpf_prog_load()
310 attr.fd_array = ptr_to_u64(OPTS_GET(opts, fd_array, NULL)); in bpf_prog_load()
520 const struct bpf_map_batch_opts *opts) in bpf_map_batch_common() argument
526 if (!OPTS_VALID(opts, bpf_map_batch_opts)) in bpf_map_batch_common()
536 attr.batch.elem_flags = OPTS_GET(opts, elem_flags, 0); in bpf_map_batch_common()
537 attr.batch.flags = OPTS_GET(opts, flags, 0); in bpf_map_batch_common()
546 const struct bpf_map_batch_opts *opts) in bpf_map_delete_batch() argument
549 NULL, (void *)keys, NULL, count, opts); in bpf_map_delete_batch()
554 const struct bpf_map_batch_opts *opts) in bpf_map_lookup_batch() argument
557 out_batch, keys, values, count, opts); in bpf_map_lookup_batch()
562 const struct bpf_map_batch_opts *opts) in bpf_map_lookup_and_delete_batch() argument
566 count, opts); in bpf_map_lookup_and_delete_batch()
570 const struct bpf_map_batch_opts *opts) in bpf_map_update_batch() argument
573 (void *)keys, (void *)values, count, opts); in bpf_map_update_batch()
595 int bpf_obj_get_opts(const char *pathname, const struct bpf_obj_get_opts *opts) in bpf_obj_get_opts() argument
601 if (!OPTS_VALID(opts, bpf_obj_get_opts)) in bpf_obj_get_opts()
606 attr.file_flags = OPTS_GET(opts, file_flags, 0); in bpf_obj_get_opts()
615 DECLARE_LIBBPF_OPTS(bpf_prog_attach_opts, opts, in bpf_prog_attach()
619 return bpf_prog_attach_opts(prog_fd, target_fd, type, &opts); in bpf_prog_attach()
624 const struct bpf_prog_attach_opts *opts) in bpf_prog_attach_opts() argument
630 if (!OPTS_VALID(opts, bpf_prog_attach_opts)) in bpf_prog_attach_opts()
637 attr.attach_flags = OPTS_GET(opts, flags, 0); in bpf_prog_attach_opts()
638 attr.replace_bpf_fd = OPTS_GET(opts, replace_prog_fd, 0); in bpf_prog_attach_opts()
675 const struct bpf_link_create_opts *opts) in bpf_link_create() argument
682 if (!OPTS_VALID(opts, bpf_link_create_opts)) in bpf_link_create()
685 iter_info_len = OPTS_GET(opts, iter_info_len, 0); in bpf_link_create()
686 target_btf_id = OPTS_GET(opts, target_btf_id, 0); in bpf_link_create()
692 if (!OPTS_ZEROED(opts, target_btf_id)) in bpf_link_create()
700 attr.link_create.flags = OPTS_GET(opts, flags, 0); in bpf_link_create()
709 attr.link_create.iter_info = ptr_to_u64(OPTS_GET(opts, iter_info, (void *)0)); in bpf_link_create()
713 attr.link_create.perf_event.bpf_cookie = OPTS_GET(opts, perf_event.bpf_cookie, 0); in bpf_link_create()
714 if (!OPTS_ZEROED(opts, perf_event)) in bpf_link_create()
718 attr.link_create.kprobe_multi.flags = OPTS_GET(opts, kprobe_multi.flags, 0); in bpf_link_create()
719 attr.link_create.kprobe_multi.cnt = OPTS_GET(opts, kprobe_multi.cnt, 0); in bpf_link_create()
720 attr.link_create.kprobe_multi.syms = ptr_to_u64(OPTS_GET(opts, kprobe_multi.syms, 0)); in bpf_link_create()
721 attr.link_create.kprobe_multi.addrs = ptr_to_u64(OPTS_GET(opts, kprobe_multi.addrs, 0)); in bpf_link_create()
722 attr.link_create.kprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, kprobe_multi.cookies, 0)); in bpf_link_create()
723 if (!OPTS_ZEROED(opts, kprobe_multi)) in bpf_link_create()
730 attr.link_create.tracing.cookie = OPTS_GET(opts, tracing.cookie, 0); in bpf_link_create()
731 if (!OPTS_ZEROED(opts, tracing)) in bpf_link_create()
735 if (!OPTS_ZEROED(opts, flags)) in bpf_link_create()
755 if (!OPTS_ZEROED(opts, sz)) in bpf_link_create()
788 const struct bpf_link_update_opts *opts) in bpf_link_update() argument
794 if (!OPTS_VALID(opts, bpf_link_update_opts)) in bpf_link_update()
800 attr.link_update.flags = OPTS_GET(opts, flags, 0); in bpf_link_update()
801 attr.link_update.old_prog_fd = OPTS_GET(opts, old_prog_fd, 0); in bpf_link_update()
822 struct bpf_prog_query_opts *opts) in bpf_prog_query_opts() argument
828 if (!OPTS_VALID(opts, bpf_prog_query_opts)) in bpf_prog_query_opts()
835 attr.query.query_flags = OPTS_GET(opts, query_flags, 0); in bpf_prog_query_opts()
836 attr.query.prog_cnt = OPTS_GET(opts, prog_cnt, 0); in bpf_prog_query_opts()
837 attr.query.prog_ids = ptr_to_u64(OPTS_GET(opts, prog_ids, NULL)); in bpf_prog_query_opts()
838 attr.query.prog_attach_flags = ptr_to_u64(OPTS_GET(opts, prog_attach_flags, NULL)); in bpf_prog_query_opts()
842 OPTS_SET(opts, attach_flags, attr.query.attach_flags); in bpf_prog_query_opts()
843 OPTS_SET(opts, prog_cnt, attr.query.prog_cnt); in bpf_prog_query_opts()
851 LIBBPF_OPTS(bpf_prog_query_opts, opts); in bpf_prog_query()
854 opts.query_flags = query_flags; in bpf_prog_query()
855 opts.prog_ids = prog_ids; in bpf_prog_query()
856 opts.prog_cnt = *prog_cnt; in bpf_prog_query()
858 ret = bpf_prog_query_opts(target_fd, type, &opts); in bpf_prog_query()
861 *attach_flags = opts.attach_flags; in bpf_prog_query()
862 *prog_cnt = opts.prog_cnt; in bpf_prog_query()
867 int bpf_prog_test_run_opts(int prog_fd, struct bpf_test_run_opts *opts) in bpf_prog_test_run_opts() argument
873 if (!OPTS_VALID(opts, bpf_test_run_opts)) in bpf_prog_test_run_opts()
878 attr.test.batch_size = OPTS_GET(opts, batch_size, 0); in bpf_prog_test_run_opts()
879 attr.test.cpu = OPTS_GET(opts, cpu, 0); in bpf_prog_test_run_opts()
880 attr.test.flags = OPTS_GET(opts, flags, 0); in bpf_prog_test_run_opts()
881 attr.test.repeat = OPTS_GET(opts, repeat, 0); in bpf_prog_test_run_opts()
882 attr.test.duration = OPTS_GET(opts, duration, 0); in bpf_prog_test_run_opts()
883 attr.test.ctx_size_in = OPTS_GET(opts, ctx_size_in, 0); in bpf_prog_test_run_opts()
884 attr.test.ctx_size_out = OPTS_GET(opts, ctx_size_out, 0); in bpf_prog_test_run_opts()
885 attr.test.data_size_in = OPTS_GET(opts, data_size_in, 0); in bpf_prog_test_run_opts()
886 attr.test.data_size_out = OPTS_GET(opts, data_size_out, 0); in bpf_prog_test_run_opts()
887 attr.test.ctx_in = ptr_to_u64(OPTS_GET(opts, ctx_in, NULL)); in bpf_prog_test_run_opts()
888 attr.test.ctx_out = ptr_to_u64(OPTS_GET(opts, ctx_out, NULL)); in bpf_prog_test_run_opts()
889 attr.test.data_in = ptr_to_u64(OPTS_GET(opts, data_in, NULL)); in bpf_prog_test_run_opts()
890 attr.test.data_out = ptr_to_u64(OPTS_GET(opts, data_out, NULL)); in bpf_prog_test_run_opts()
894 OPTS_SET(opts, data_size_out, attr.test.data_size_out); in bpf_prog_test_run_opts()
895 OPTS_SET(opts, ctx_size_out, attr.test.ctx_size_out); in bpf_prog_test_run_opts()
896 OPTS_SET(opts, duration, attr.test.duration); in bpf_prog_test_run_opts()
897 OPTS_SET(opts, retval, attr.test.retval); in bpf_prog_test_run_opts()
939 const struct bpf_get_fd_by_id_opts *opts) in bpf_prog_get_fd_by_id_opts() argument
945 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_prog_get_fd_by_id_opts()
950 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_prog_get_fd_by_id_opts()
962 const struct bpf_get_fd_by_id_opts *opts) in bpf_map_get_fd_by_id_opts() argument
968 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_map_get_fd_by_id_opts()
973 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_map_get_fd_by_id_opts()
985 const struct bpf_get_fd_by_id_opts *opts) in bpf_btf_get_fd_by_id_opts() argument
991 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_btf_get_fd_by_id_opts()
996 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_btf_get_fd_by_id_opts()
1008 const struct bpf_get_fd_by_id_opts *opts) in bpf_link_get_fd_by_id_opts() argument
1014 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_link_get_fd_by_id_opts()
1019 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_link_get_fd_by_id_opts()
1081 int bpf_btf_load(const void *btf_data, size_t btf_size, const struct bpf_btf_load_opts *opts) in bpf_btf_load() argument
1094 if (!OPTS_VALID(opts, bpf_btf_load_opts)) in bpf_btf_load()
1097 log_buf = OPTS_GET(opts, log_buf, NULL); in bpf_btf_load()
1098 log_size = OPTS_GET(opts, log_size, 0); in bpf_btf_load()
1099 log_level = OPTS_GET(opts, log_level, 0); in bpf_btf_load()
1169 const struct bpf_prog_bind_opts *opts) in bpf_prog_bind_map() argument
1175 if (!OPTS_VALID(opts, bpf_prog_bind_opts)) in bpf_prog_bind_map()
1181 attr.prog_bind_map.flags = OPTS_GET(opts, flags, 0); in bpf_prog_bind_map()