Lines Matching refs:opts

322 int bpf_xdp_attach(int ifindex, int prog_fd, __u32 flags, const struct bpf_xdp_attach_opts *opts)
326 if (!OPTS_VALID(opts, bpf_xdp_attach_opts))
329 old_prog_fd = OPTS_GET(opts, old_prog_fd, 0);
339 int bpf_xdp_detach(int ifindex, __u32 flags, const struct bpf_xdp_attach_opts *opts)
341 return bpf_xdp_attach(ifindex, -1, flags, opts);
431 int bpf_xdp_query(int ifindex, int xdp_flags, struct bpf_xdp_query_opts *opts)
446 if (!OPTS_VALID(opts, bpf_xdp_query_opts))
465 OPTS_SET(opts, prog_id, xdp_id.info.prog_id);
466 OPTS_SET(opts, drv_prog_id, xdp_id.info.drv_prog_id);
467 OPTS_SET(opts, hw_prog_id, xdp_id.info.hw_prog_id);
468 OPTS_SET(opts, skb_prog_id, xdp_id.info.skb_prog_id);
469 OPTS_SET(opts, attach_mode, xdp_id.info.attach_mode);
471 if (!OPTS_HAS(opts, feature_flags))
477 opts->feature_flags = 0;
499 OPTS_SET(opts, feature_flags, md.flags);
500 OPTS_SET(opts, xdp_zc_max_segs, md.xdp_zc_max_segs);
508 LIBBPF_OPTS(bpf_xdp_query_opts, opts);
511 ret = bpf_xdp_query(ifindex, flags, &opts);
517 if (opts.attach_mode != XDP_ATTACHED_MULTI && !flags)
518 *prog_id = opts.prog_id;
520 *prog_id = opts.drv_prog_id;
522 *prog_id = opts.hw_prog_id;
524 *prog_id = opts.skb_prog_id;
629 const struct bpf_tc_opts *opts,
652 struct bpf_tc_opts *opts;
662 if (!info || !info->opts)
673 OPTS_SET(info->opts, prog_id, libbpf_nla_getattr_u32(tbb[TCA_BPF_ID]));
674 OPTS_SET(info->opts, handle, tc->tcm_handle);
675 OPTS_SET(info->opts, priority, TC_H_MAJ(tc->tcm_info) >> 16);
718 int bpf_tc_attach(const struct bpf_tc_hook *hook, struct bpf_tc_opts *opts)
726 if (!hook || !opts ||
728 !OPTS_VALID(opts, bpf_tc_opts))
735 handle = OPTS_GET(opts, handle, 0);
736 priority = OPTS_GET(opts, priority, 0);
737 prog_fd = OPTS_GET(opts, prog_fd, 0);
738 prog_id = OPTS_GET(opts, prog_id, 0);
739 flags = OPTS_GET(opts, flags, 0);
781 info.opts = opts;
793 const struct bpf_tc_opts *opts,
802 !OPTS_VALID(opts, bpf_tc_opts))
809 handle = OPTS_GET(opts, handle, 0);
810 priority = OPTS_GET(opts, priority, 0);
811 prog_fd = OPTS_GET(opts, prog_fd, 0);
812 prog_id = OPTS_GET(opts, prog_id, 0);
813 flags = OPTS_GET(opts, flags, 0);
854 const struct bpf_tc_opts *opts)
858 if (!opts)
861 ret = __bpf_tc_detach(hook, opts, false);
865 int bpf_tc_query(const struct bpf_tc_hook *hook, struct bpf_tc_opts *opts)
872 if (!hook || !opts ||
874 !OPTS_VALID(opts, bpf_tc_opts))
881 handle = OPTS_GET(opts, handle, 0);
882 priority = OPTS_GET(opts, priority, 0);
883 prog_fd = OPTS_GET(opts, prog_fd, 0);
884 prog_id = OPTS_GET(opts, prog_id, 0);
885 flags = OPTS_GET(opts, flags, 0);
913 info.opts = opts;