• Home
  • Raw
  • Download

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 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()
294 func_info_rec_size = OPTS_GET(opts, func_info_rec_size, 0); in bpf_prog_load()
295 func_info = OPTS_GET(opts, func_info, NULL); in bpf_prog_load()
298 attr.func_info_cnt = OPTS_GET(opts, func_info_cnt, 0); in bpf_prog_load()
300 line_info_rec_size = OPTS_GET(opts, line_info_rec_size, 0); in bpf_prog_load()
301 line_info = OPTS_GET(opts, line_info, NULL); in bpf_prog_load()
304 attr.line_info_cnt = OPTS_GET(opts, line_info_cnt, 0); in bpf_prog_load()
306 attr.fd_array = ptr_to_u64(OPTS_GET(opts, fd_array, NULL)); in bpf_prog_load()
315 OPTS_SET(opts, log_true_size, attr.log_true_size); in bpf_prog_load()
356 OPTS_SET(opts, log_true_size, attr.log_true_size); in bpf_prog_load()
371 OPTS_SET(opts, log_true_size, attr.log_true_size); in bpf_prog_load()
519 const struct bpf_map_batch_opts *opts) in bpf_map_batch_common() argument
525 if (!OPTS_VALID(opts, bpf_map_batch_opts)) in bpf_map_batch_common()
535 attr.batch.elem_flags = OPTS_GET(opts, elem_flags, 0); in bpf_map_batch_common()
536 attr.batch.flags = OPTS_GET(opts, flags, 0); in bpf_map_batch_common()
545 const struct bpf_map_batch_opts *opts) in bpf_map_delete_batch() argument
548 NULL, (void *)keys, NULL, count, opts); in bpf_map_delete_batch()
553 const struct bpf_map_batch_opts *opts) in bpf_map_lookup_batch() argument
556 out_batch, keys, values, count, opts); in bpf_map_lookup_batch()
561 const struct bpf_map_batch_opts *opts) in bpf_map_lookup_and_delete_batch() argument
565 count, opts); in bpf_map_lookup_and_delete_batch()
569 const struct bpf_map_batch_opts *opts) in bpf_map_update_batch() argument
572 (void *)keys, (void *)values, count, opts); in bpf_map_update_batch()
575 int bpf_obj_pin_opts(int fd, const char *pathname, const struct bpf_obj_pin_opts *opts) in bpf_obj_pin_opts() argument
581 if (!OPTS_VALID(opts, bpf_obj_pin_opts)) in bpf_obj_pin_opts()
585 attr.path_fd = OPTS_GET(opts, path_fd, 0); in bpf_obj_pin_opts()
587 attr.file_flags = OPTS_GET(opts, file_flags, 0); in bpf_obj_pin_opts()
604 int bpf_obj_get_opts(const char *pathname, const struct bpf_obj_get_opts *opts) in bpf_obj_get_opts() argument
610 if (!OPTS_VALID(opts, bpf_obj_get_opts)) in bpf_obj_get_opts()
614 attr.path_fd = OPTS_GET(opts, path_fd, 0); in bpf_obj_get_opts()
616 attr.file_flags = OPTS_GET(opts, file_flags, 0); in bpf_obj_get_opts()
625 DECLARE_LIBBPF_OPTS(bpf_prog_attach_opts, opts, in bpf_prog_attach()
629 return bpf_prog_attach_opts(prog_fd, target_fd, type, &opts); in bpf_prog_attach()
633 const struct bpf_prog_attach_opts *opts) in bpf_prog_attach_opts() argument
640 if (!OPTS_VALID(opts, bpf_prog_attach_opts)) in bpf_prog_attach_opts()
643 relative_id = OPTS_GET(opts, relative_id, 0); in bpf_prog_attach_opts()
644 relative_fd = OPTS_GET(opts, relative_fd, 0); in bpf_prog_attach_opts()
645 flags = OPTS_GET(opts, flags, 0); in bpf_prog_attach_opts()
655 attr.replace_bpf_fd = OPTS_GET(opts, replace_fd, 0); in bpf_prog_attach_opts()
656 attr.expected_revision = OPTS_GET(opts, expected_revision, 0); in bpf_prog_attach_opts()
671 const struct bpf_prog_detach_opts *opts) in bpf_prog_detach_opts() argument
678 if (!OPTS_VALID(opts, bpf_prog_detach_opts)) in bpf_prog_detach_opts()
681 relative_id = OPTS_GET(opts, relative_id, 0); in bpf_prog_detach_opts()
682 relative_fd = OPTS_GET(opts, relative_fd, 0); in bpf_prog_detach_opts()
683 flags = OPTS_GET(opts, flags, 0); in bpf_prog_detach_opts()
693 attr.expected_revision = OPTS_GET(opts, expected_revision, 0); in bpf_prog_detach_opts()
719 const struct bpf_link_create_opts *opts) in bpf_link_create() argument
726 if (!OPTS_VALID(opts, bpf_link_create_opts)) in bpf_link_create()
729 iter_info_len = OPTS_GET(opts, iter_info_len, 0); in bpf_link_create()
730 target_btf_id = OPTS_GET(opts, target_btf_id, 0); in bpf_link_create()
736 if (!OPTS_ZEROED(opts, target_btf_id)) in bpf_link_create()
744 attr.link_create.flags = OPTS_GET(opts, flags, 0); in bpf_link_create()
753 attr.link_create.iter_info = ptr_to_u64(OPTS_GET(opts, iter_info, (void *)0)); in bpf_link_create()
757 attr.link_create.perf_event.bpf_cookie = OPTS_GET(opts, perf_event.bpf_cookie, 0); in bpf_link_create()
758 if (!OPTS_ZEROED(opts, perf_event)) in bpf_link_create()
762 attr.link_create.kprobe_multi.flags = OPTS_GET(opts, kprobe_multi.flags, 0); in bpf_link_create()
763 attr.link_create.kprobe_multi.cnt = OPTS_GET(opts, kprobe_multi.cnt, 0); in bpf_link_create()
764 attr.link_create.kprobe_multi.syms = ptr_to_u64(OPTS_GET(opts, kprobe_multi.syms, 0)); in bpf_link_create()
765 attr.link_create.kprobe_multi.addrs = ptr_to_u64(OPTS_GET(opts, kprobe_multi.addrs, 0)); in bpf_link_create()
766 attr.link_create.kprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, kprobe_multi.cookies, 0)); in bpf_link_create()
767 if (!OPTS_ZEROED(opts, kprobe_multi)) in bpf_link_create()
771 attr.link_create.uprobe_multi.flags = OPTS_GET(opts, uprobe_multi.flags, 0); in bpf_link_create()
772 attr.link_create.uprobe_multi.cnt = OPTS_GET(opts, uprobe_multi.cnt, 0); in bpf_link_create()
773 attr.link_create.uprobe_multi.path = ptr_to_u64(OPTS_GET(opts, uprobe_multi.path, 0)); in bpf_link_create()
774 attr.link_create.uprobe_multi.offsets = ptr_to_u64(OPTS_GET(opts, uprobe_multi.offsets, 0)); in bpf_link_create()
775 …attr.link_create.uprobe_multi.ref_ctr_offsets = ptr_to_u64(OPTS_GET(opts, uprobe_multi.ref_ctr_off… in bpf_link_create()
776 attr.link_create.uprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, uprobe_multi.cookies, 0)); in bpf_link_create()
777 attr.link_create.uprobe_multi.pid = OPTS_GET(opts, uprobe_multi.pid, 0); in bpf_link_create()
778 if (!OPTS_ZEROED(opts, uprobe_multi)) in bpf_link_create()
785 attr.link_create.tracing.cookie = OPTS_GET(opts, tracing.cookie, 0); in bpf_link_create()
786 if (!OPTS_ZEROED(opts, tracing)) in bpf_link_create()
790 attr.link_create.netfilter.pf = OPTS_GET(opts, netfilter.pf, 0); in bpf_link_create()
791 attr.link_create.netfilter.hooknum = OPTS_GET(opts, netfilter.hooknum, 0); in bpf_link_create()
792 attr.link_create.netfilter.priority = OPTS_GET(opts, netfilter.priority, 0); in bpf_link_create()
793 attr.link_create.netfilter.flags = OPTS_GET(opts, netfilter.flags, 0); in bpf_link_create()
794 if (!OPTS_ZEROED(opts, netfilter)) in bpf_link_create()
799 relative_fd = OPTS_GET(opts, tcx.relative_fd, 0); in bpf_link_create()
800 relative_id = OPTS_GET(opts, tcx.relative_id, 0); in bpf_link_create()
809 attr.link_create.tcx.expected_revision = OPTS_GET(opts, tcx.expected_revision, 0); in bpf_link_create()
810 if (!OPTS_ZEROED(opts, tcx)) in bpf_link_create()
815 relative_fd = OPTS_GET(opts, netkit.relative_fd, 0); in bpf_link_create()
816 relative_id = OPTS_GET(opts, netkit.relative_id, 0); in bpf_link_create()
825 attr.link_create.netkit.expected_revision = OPTS_GET(opts, netkit.expected_revision, 0); in bpf_link_create()
826 if (!OPTS_ZEROED(opts, netkit)) in bpf_link_create()
830 if (!OPTS_ZEROED(opts, flags)) in bpf_link_create()
850 if (!OPTS_ZEROED(opts, sz)) in bpf_link_create()
883 const struct bpf_link_update_opts *opts) in bpf_link_update() argument
889 if (!OPTS_VALID(opts, bpf_link_update_opts)) in bpf_link_update()
892 if (OPTS_GET(opts, old_prog_fd, 0) && OPTS_GET(opts, old_map_fd, 0)) in bpf_link_update()
898 attr.link_update.flags = OPTS_GET(opts, flags, 0); in bpf_link_update()
899 if (OPTS_GET(opts, old_prog_fd, 0)) in bpf_link_update()
900 attr.link_update.old_prog_fd = OPTS_GET(opts, old_prog_fd, 0); in bpf_link_update()
901 else if (OPTS_GET(opts, old_map_fd, 0)) in bpf_link_update()
902 attr.link_update.old_map_fd = OPTS_GET(opts, old_map_fd, 0); in bpf_link_update()
922 struct bpf_prog_query_opts *opts) in bpf_prog_query_opts() argument
928 if (!OPTS_VALID(opts, bpf_prog_query_opts)) in bpf_prog_query_opts()
934 attr.query.query_flags = OPTS_GET(opts, query_flags, 0); in bpf_prog_query_opts()
935 attr.query.count = OPTS_GET(opts, count, 0); in bpf_prog_query_opts()
936 attr.query.prog_ids = ptr_to_u64(OPTS_GET(opts, prog_ids, NULL)); in bpf_prog_query_opts()
937 attr.query.link_ids = ptr_to_u64(OPTS_GET(opts, link_ids, NULL)); in bpf_prog_query_opts()
938 attr.query.prog_attach_flags = ptr_to_u64(OPTS_GET(opts, prog_attach_flags, NULL)); in bpf_prog_query_opts()
939 attr.query.link_attach_flags = ptr_to_u64(OPTS_GET(opts, link_attach_flags, NULL)); in bpf_prog_query_opts()
943 OPTS_SET(opts, attach_flags, attr.query.attach_flags); in bpf_prog_query_opts()
944 OPTS_SET(opts, revision, attr.query.revision); in bpf_prog_query_opts()
945 OPTS_SET(opts, count, attr.query.count); in bpf_prog_query_opts()
953 LIBBPF_OPTS(bpf_prog_query_opts, opts); in bpf_prog_query()
956 opts.query_flags = query_flags; in bpf_prog_query()
957 opts.prog_ids = prog_ids; in bpf_prog_query()
958 opts.prog_cnt = *prog_cnt; in bpf_prog_query()
960 ret = bpf_prog_query_opts(target_fd, type, &opts); in bpf_prog_query()
963 *attach_flags = opts.attach_flags; in bpf_prog_query()
964 *prog_cnt = opts.prog_cnt; in bpf_prog_query()
969 int bpf_prog_test_run_opts(int prog_fd, struct bpf_test_run_opts *opts) in bpf_prog_test_run_opts() argument
975 if (!OPTS_VALID(opts, bpf_test_run_opts)) in bpf_prog_test_run_opts()
980 attr.test.batch_size = OPTS_GET(opts, batch_size, 0); in bpf_prog_test_run_opts()
981 attr.test.cpu = OPTS_GET(opts, cpu, 0); in bpf_prog_test_run_opts()
982 attr.test.flags = OPTS_GET(opts, flags, 0); in bpf_prog_test_run_opts()
983 attr.test.repeat = OPTS_GET(opts, repeat, 0); in bpf_prog_test_run_opts()
984 attr.test.duration = OPTS_GET(opts, duration, 0); in bpf_prog_test_run_opts()
985 attr.test.ctx_size_in = OPTS_GET(opts, ctx_size_in, 0); in bpf_prog_test_run_opts()
986 attr.test.ctx_size_out = OPTS_GET(opts, ctx_size_out, 0); in bpf_prog_test_run_opts()
987 attr.test.data_size_in = OPTS_GET(opts, data_size_in, 0); in bpf_prog_test_run_opts()
988 attr.test.data_size_out = OPTS_GET(opts, data_size_out, 0); in bpf_prog_test_run_opts()
989 attr.test.ctx_in = ptr_to_u64(OPTS_GET(opts, ctx_in, NULL)); in bpf_prog_test_run_opts()
990 attr.test.ctx_out = ptr_to_u64(OPTS_GET(opts, ctx_out, NULL)); in bpf_prog_test_run_opts()
991 attr.test.data_in = ptr_to_u64(OPTS_GET(opts, data_in, NULL)); in bpf_prog_test_run_opts()
992 attr.test.data_out = ptr_to_u64(OPTS_GET(opts, data_out, NULL)); in bpf_prog_test_run_opts()
996 OPTS_SET(opts, data_size_out, attr.test.data_size_out); in bpf_prog_test_run_opts()
997 OPTS_SET(opts, ctx_size_out, attr.test.ctx_size_out); in bpf_prog_test_run_opts()
998 OPTS_SET(opts, duration, attr.test.duration); in bpf_prog_test_run_opts()
999 OPTS_SET(opts, retval, attr.test.retval); in bpf_prog_test_run_opts()
1041 const struct bpf_get_fd_by_id_opts *opts) in bpf_prog_get_fd_by_id_opts() argument
1047 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_prog_get_fd_by_id_opts()
1052 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_prog_get_fd_by_id_opts()
1064 const struct bpf_get_fd_by_id_opts *opts) in bpf_map_get_fd_by_id_opts() argument
1070 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_map_get_fd_by_id_opts()
1075 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_map_get_fd_by_id_opts()
1087 const struct bpf_get_fd_by_id_opts *opts) in bpf_btf_get_fd_by_id_opts() argument
1093 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_btf_get_fd_by_id_opts()
1098 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_btf_get_fd_by_id_opts()
1110 const struct bpf_get_fd_by_id_opts *opts) in bpf_link_get_fd_by_id_opts() argument
1116 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_link_get_fd_by_id_opts()
1121 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_link_get_fd_by_id_opts()
1183 int bpf_btf_load(const void *btf_data, size_t btf_size, struct bpf_btf_load_opts *opts) in bpf_btf_load() argument
1196 if (!OPTS_VALID(opts, bpf_btf_load_opts)) in bpf_btf_load()
1199 log_buf = OPTS_GET(opts, log_buf, NULL); in bpf_btf_load()
1200 log_size = OPTS_GET(opts, log_size, 0); in bpf_btf_load()
1201 log_level = OPTS_GET(opts, log_level, 0); in bpf_btf_load()
1229 OPTS_SET(opts, log_true_size, attr.btf_log_true_size); in bpf_btf_load()
1273 const struct bpf_prog_bind_opts *opts) in bpf_prog_bind_map() argument
1279 if (!OPTS_VALID(opts, bpf_prog_bind_opts)) in bpf_prog_bind_map()
1285 attr.prog_bind_map.flags = OPTS_GET(opts, flags, 0); in bpf_prog_bind_map()