Home
last modified time | relevance | path

Searched refs:prog (Results 1 – 19 of 19) sorted by relevance

/net/sched/
Dcls_bpf.c85 struct cls_bpf_prog *prog; in cls_bpf_classify() local
90 list_for_each_entry_rcu(prog, &head->plist, link) { in cls_bpf_classify()
93 qdisc_skb_cb(skb)->tc_classid = prog->res.classid; in cls_bpf_classify()
95 if (tc_skip_sw(prog->gen_flags)) { in cls_bpf_classify()
96 filter_res = prog->exts_integrated ? TC_ACT_UNSPEC : 0; in cls_bpf_classify()
101 filter_res = BPF_PROG_RUN(prog->filter, skb); in cls_bpf_classify()
105 filter_res = BPF_PROG_RUN(prog->filter, skb); in cls_bpf_classify()
108 if (prog->exts_integrated) { in cls_bpf_classify()
110 res->classid = TC_H_MAJ(prog->res.classid) | in cls_bpf_classify()
125 *res = prog->res; in cls_bpf_classify()
[all …]
Dact_bpf.c38 struct tcf_bpf *prog = to_bpf(act); in tcf_bpf_act() local
42 tcf_lastuse_update(&prog->tcf_tm); in tcf_bpf_act()
43 bstats_cpu_update(this_cpu_ptr(prog->common.cpu_bstats), skb); in tcf_bpf_act()
46 filter = rcu_dereference(prog->filter); in tcf_bpf_act()
77 qstats_drop_inc(this_cpu_ptr(prog->common.cpu_qstats)); in tcf_bpf_act()
80 action = prog->tcf_action; in tcf_bpf_act()
90 static bool tcf_bpf_is_ebpf(const struct tcf_bpf *prog) in tcf_bpf_is_ebpf() argument
92 return !prog->bpf_ops; in tcf_bpf_is_ebpf()
95 static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog, in tcf_bpf_dump_bpf_info() argument
100 if (nla_put_u16(skb, TCA_ACT_BPF_OPS_LEN, prog->bpf_num_ops)) in tcf_bpf_dump_bpf_info()
[all …]
/net/core/
Dsock_reuseport.c51 RCU_INIT_POINTER(reuse->prog, NULL); in __reuseport_alloc()
112 more_reuse->prog = reuse->prog; in reuseport_grow()
138 sk_reuseport_prog_free(rcu_dereference_protected(reuse->prog, 1)); in reuseport_free_rcu()
227 struct bpf_prog *prog, struct sk_buff *skb, in run_bpf_filter() argument
245 index = bpf_prog_run_save_cb(prog, skb); in run_bpf_filter()
272 struct bpf_prog *prog; in reuseport_select_sock() local
283 prog = rcu_dereference(reuse->prog); in reuseport_select_sock()
289 if (!prog || !skb) in reuseport_select_sock()
292 if (prog->type == BPF_PROG_TYPE_SK_REUSEPORT) in reuseport_select_sock()
293 sk2 = bpf_run_sk_reuseport(reuse, sk, prog, skb, hash); in reuseport_select_sock()
[all …]
Dlwt_bpf.c16 struct bpf_prog *prog; member
48 ret = bpf_prog_run_save_cb(lwt->prog, skb); in run_lwt_bpf()
121 if (bpf->in.prog) { in bpf_input()
144 if (bpf->out.prog) { in bpf_output()
272 if (bpf->xmit.prog) { in bpf_xmit()
308 static void bpf_lwt_prog_destroy(struct bpf_lwt_prog *prog) in bpf_lwt_prog_destroy() argument
310 if (prog->prog) in bpf_lwt_prog_destroy()
311 bpf_prog_put(prog->prog); in bpf_lwt_prog_destroy()
313 kfree(prog->name); in bpf_lwt_prog_destroy()
331 static int bpf_parse_prog(struct nlattr *attr, struct bpf_lwt_prog *prog, in bpf_parse_prog() argument
[all …]
Dskmsg.c684 struct bpf_prog *prog; in sk_psock_msg_verdict() local
689 prog = READ_ONCE(psock->progs.msg_parser); in sk_psock_msg_verdict()
690 if (unlikely(!prog)) { in sk_psock_msg_verdict()
697 ret = BPF_PROG_RUN(prog, msg); in sk_psock_msg_verdict()
717 static int sk_psock_bpf_run(struct sk_psock *psock, struct bpf_prog *prog, in sk_psock_bpf_run() argument
725 ret = BPF_PROG_RUN(prog, skb); in sk_psock_bpf_run()
792 struct bpf_prog *prog; in sk_psock_tls_strp_read() local
796 prog = READ_ONCE(psock->progs.skb_verdict); in sk_psock_tls_strp_read()
797 if (likely(prog)) { in sk_psock_tls_strp_read()
799 ret = sk_psock_bpf_run(psock, prog, skb); in sk_psock_tls_strp_read()
[all …]
Dfilter.c119 pkt_len = bpf_prog_run_save_cb(filter->prog, skb); in sk_filter_trim_cap()
536 static int bpf_convert_filter(struct sock_filter *prog, int len, in bpf_convert_filter() argument
562 fp = prog; in bpf_convert_filter()
1143 static void __bpf_prog_release(struct bpf_prog *prog) in __bpf_prog_release() argument
1145 if (prog->type == BPF_PROG_TYPE_SOCKET_FILTER) { in __bpf_prog_release()
1146 bpf_prog_put(prog); in __bpf_prog_release()
1148 bpf_release_orig_filter(prog); in __bpf_prog_release()
1149 bpf_prog_free(prog); in __bpf_prog_release()
1155 __bpf_prog_release(fp->prog); in __sk_filter_release()
1184 u32 filter_size = bpf_prog_size(fp->prog->len); in sk_filter_uncharge()
[all …]
Dxdp.c439 bpf->prog_id = info->prog ? info->prog->aux->id : 0; in xdp_attachment_query()
440 bpf->prog_flags = info->prog ? info->flags : 0; in xdp_attachment_query()
448 if (info->prog && (bpf->flags ^ info->flags) & XDP_FLAGS_MODES) { in xdp_attachment_flags_ok()
460 if (info->prog) in xdp_attachment_setup()
461 bpf_prog_put(info->prog); in xdp_attachment_setup()
462 info->prog = bpf->prog; in xdp_attachment_setup()
Dsock_map.c63 int sock_map_get_from_fd(const union bpf_attr *attr, struct bpf_prog *prog) in sock_map_get_from_fd() argument
74 ret = sock_map_prog_update(map, prog, NULL, attr->attach_type); in sock_map_get_from_fd()
82 struct bpf_prog *prog; in sock_map_prog_detach() local
95 prog = bpf_prog_get(attr->attach_bpf_fd); in sock_map_prog_detach()
96 if (IS_ERR(prog)) { in sock_map_prog_detach()
97 ret = PTR_ERR(prog); in sock_map_prog_detach()
101 if (prog->type != ptype) { in sock_map_prog_detach()
106 ret = sock_map_prog_update(map, NULL, prog, attr->attach_type); in sock_map_prog_detach()
108 bpf_prog_put(prog); in sock_map_prog_detach()
1058 int sock_map_prog_update(struct bpf_map *map, struct bpf_prog *prog, in sock_map_prog_update() argument
[all …]
Dflow_dissector.c113 struct bpf_prog *prog) in skb_flow_dissector_bpf_prog_attach() argument
127 rcu_assign_pointer(net->flow_dissector_prog, prog); in skb_flow_dissector_bpf_prog_attach()
845 bool bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx, in bpf_flow_dissect() argument
866 result = BPF_PROG_RUN(prog, ctx); in bpf_flow_dissect()
Dsock_diag.c89 fprog = filter->prog->orig_prog; in sock_diag_put_filterinfo()
Ddev.c5124 struct bpf_prog *new = xdp->prog; in generic_xdp_install()
8430 struct bpf_prog *prog) in dev_xdp_install() argument
8441 xdp.prog = prog; in dev_xdp_install()
8488 struct bpf_prog *prog = NULL; in dev_change_xdp_fd() local
8522 prog = bpf_prog_get_type_dev(fd, BPF_PROG_TYPE_XDP, in dev_change_xdp_fd()
8524 if (IS_ERR(prog)) in dev_change_xdp_fd()
8525 return PTR_ERR(prog); in dev_change_xdp_fd()
8527 if (!offload && bpf_prog_is_dev_bound(prog->aux)) { in dev_change_xdp_fd()
8529 bpf_prog_put(prog); in dev_change_xdp_fd()
8534 if (prog->aux->id && prog->aux->id == prog_id) { in dev_change_xdp_fd()
[all …]
/net/netfilter/
Dxt_bpf.c45 struct bpf_prog *prog; in __bpf_mt_check_fd() local
47 prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_SOCKET_FILTER); in __bpf_mt_check_fd()
48 if (IS_ERR(prog)) in __bpf_mt_check_fd()
49 return PTR_ERR(prog); in __bpf_mt_check_fd()
51 *ret = prog; in __bpf_mt_check_fd()
/net/bpf/
Dtest_run.c17 static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, in bpf_test_run() argument
27 storage[stype] = bpf_cgroup_storage_alloc(prog, stype); in bpf_test_run()
44 *retval = BPF_PROG_RUN(prog, ctx); in bpf_test_run()
242 int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr, in bpf_prog_test_run_skb() argument
267 switch (prog->type) { in bpf_prog_test_run_skb()
311 ret = bpf_test_run(prog, skb, repeat, &retval, &duration); in bpf_prog_test_run_skb()
343 int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, in bpf_prog_test_run_xdp() argument
369 ret = bpf_test_run(prog, &xdp, repeat, &retval, &duration); in bpf_prog_test_run_xdp()
397 int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, in bpf_prog_test_run_flow_dissector() argument
414 if (prog->type != BPF_PROG_TYPE_FLOW_DISSECTOR) in bpf_prog_test_run_flow_dissector()
[all …]
/net/sunrpc/
Dsvc.c424 __svc_create(struct svc_program *prog, unsigned int bufsize, int npools, in __svc_create() argument
434 serv->sv_name = prog->pg_name; in __svc_create()
435 serv->sv_program = prog; in __svc_create()
437 serv->sv_stats = prog->pg_stats; in __svc_create()
444 while (prog) { in __svc_create()
445 prog->pg_lovers = prog->pg_nvers-1; in __svc_create()
446 for (vers=0; vers<prog->pg_nvers ; vers++) in __svc_create()
447 if (prog->pg_vers[vers]) { in __svc_create()
448 prog->pg_hivers = vers; in __svc_create()
449 if (prog->pg_lovers > vers) in __svc_create()
[all …]
Dstats.c39 const struct rpc_program *prog = statp->program; in rpc_proc_show() local
54 for (i = 0; i < prog->nrvers; i++) { in rpc_proc_show()
55 const struct rpc_version *vers = prog->version[i]; in rpc_proc_show()
85 const struct svc_program *prog = statp->program; in svc_seq_show() local
103 for (i = 0; i < prog->pg_nvers; i++) { in svc_seq_show()
104 vers = prog->pg_vers[i]; in svc_seq_show()
Drpcb_clnt.c450 int rpcb_register(struct net *net, u32 prog, u32 vers, int prot, unsigned short port) in rpcb_register() argument
453 .r_prog = prog, in rpcb_register()
466 prog, vers, prot, port); in rpcb_register()
/net/ipv6/
Dseg6_local.c44 struct bpf_prog *prog; member
516 ret = bpf_prog_run_save_cb(slwt->bpf.prog, skb); in input_action_end_bpf()
852 slwt->bpf.prog = p; in parse_nla_bpf()
860 if (!slwt->bpf.prog) in put_nla_bpf()
867 if (nla_put_u32(skb, SEG6_LOCAL_BPF_PROG, slwt->bpf.prog->aux->id)) in put_nla_bpf()
1011 bpf_prog_put(slwt->bpf.prog); in seg6_local_destroy_state()
/net/kcm/
Dkcmsock.c385 struct bpf_prog *prog = psock->bpf_prog; in kcm_parse_func_strparser() local
389 res = BPF_PROG_RUN(prog, skb); in kcm_parse_func_strparser()
1338 struct bpf_prog *prog) in kcm_attach() argument
1380 psock->bpf_prog = prog; in kcm_attach()
1443 struct bpf_prog *prog; in kcm_attach_ioctl() local
1450 prog = bpf_prog_get_type(info->bpf_fd, BPF_PROG_TYPE_SOCKET_FILTER); in kcm_attach_ioctl()
1451 if (IS_ERR(prog)) { in kcm_attach_ioctl()
1452 err = PTR_ERR(prog); in kcm_attach_ioctl()
1456 err = kcm_attach(sock, csock, prog); in kcm_attach_ioctl()
1458 bpf_prog_put(prog); in kcm_attach_ioctl()
/net/packet/
Daf_packet.c1404 struct bpf_prog *prog; in fanout_demux_bpf() local
1408 prog = rcu_dereference(f->bpf_prog); in fanout_demux_bpf()
1409 if (prog) in fanout_demux_bpf()
1410 ret = bpf_prog_run_clear_cb(prog, skb) % num; in fanout_demux_bpf()
2029 res = bpf_prog_run_clear_cb(filter->prog, skb); in run_filter()