Home
last modified time | relevance | path

Searched refs:bpf (Results 1 – 22 of 22) sorted by relevance

/drivers/net/ethernet/netronome/nfp/bpf/
Dmain.c27 struct nfp_app_bpf *bpf = nn->app->priv; in nfp_net_ebpf_capable() local
30 bpf->abi_version && in nfp_net_ebpf_capable()
31 nn_readb(nn, NFP_NET_CFG_BPF_ABI) == bpf->abi_version; in nfp_net_ebpf_capable()
206 nfp_bpf_parse_cap_adjust_head(struct nfp_app_bpf *bpf, void __iomem *value, in nfp_bpf_parse_cap_adjust_head() argument
210 struct nfp_cpp *cpp = bpf->app->pf->cpp; in nfp_bpf_parse_cap_adjust_head()
217 bpf->adjust_head.flags = readl(&cap->flags); in nfp_bpf_parse_cap_adjust_head()
218 bpf->adjust_head.off_min = readl(&cap->off_min); in nfp_bpf_parse_cap_adjust_head()
219 bpf->adjust_head.off_max = readl(&cap->off_max); in nfp_bpf_parse_cap_adjust_head()
220 bpf->adjust_head.guaranteed_sub = readl(&cap->guaranteed_sub); in nfp_bpf_parse_cap_adjust_head()
221 bpf->adjust_head.guaranteed_add = readl(&cap->guaranteed_add); in nfp_bpf_parse_cap_adjust_head()
[all …]
Dcmsg.c18 nfp_bpf_cmsg_alloc(struct nfp_app_bpf *bpf, unsigned int size) in nfp_bpf_cmsg_alloc() argument
22 skb = nfp_app_ctrl_msg_alloc(bpf->app, size, GFP_KERNEL); in nfp_bpf_cmsg_alloc()
29 nfp_bpf_cmsg_map_req_size(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_req_size() argument
34 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_req_size()
40 nfp_bpf_cmsg_map_req_alloc(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_req_alloc() argument
42 return nfp_bpf_cmsg_alloc(bpf, nfp_bpf_cmsg_map_req_size(bpf, n)); in nfp_bpf_cmsg_map_req_alloc()
46 nfp_bpf_cmsg_map_reply_size(struct nfp_app_bpf *bpf, unsigned int n) in nfp_bpf_cmsg_map_reply_size() argument
51 size += (bpf->cmsg_key_sz + bpf->cmsg_val_sz) * n; in nfp_bpf_cmsg_map_reply_size()
57 nfp_bpf_ctrl_rc_to_errno(struct nfp_app_bpf *bpf, in nfp_bpf_ctrl_rc_to_errno() argument
74 cmsg_warn(bpf, "FW responded with invalid status: %u\n", rc); in nfp_bpf_ctrl_rc_to_errno()
[all …]
Doffload.c31 nfp_map_ptr_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, in nfp_map_ptr_record() argument
38 record = rhashtable_lookup_fast(&bpf->maps_neutral, &map->id, in nfp_map_ptr_record()
61 err = rhashtable_insert_fast(&bpf->maps_neutral, &record->l, in nfp_map_ptr_record()
78 nfp_map_ptrs_forget(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog) in nfp_map_ptrs_forget() argument
89 WARN_ON(rhashtable_remove_fast(&bpf->maps_neutral, in nfp_map_ptrs_forget()
111 nfp_map_ptrs_record(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, in nfp_map_ptrs_record() argument
136 err = nfp_map_ptr_record(bpf, nfp_prog, in nfp_map_ptrs_record()
139 nfp_map_ptrs_forget(bpf, nfp_prog); in nfp_map_ptrs_record()
203 nfp_prog->bpf = bpf_offload_dev_priv(prog->aux->offload->offdev); in nfp_bpf_verifier_prep()
244 return nfp_map_ptrs_record(nfp_prog->bpf, nfp_prog, prog); in nfp_bpf_translate()
[all …]
Dmain.h21 #define cmsg_warn(bpf, msg...) nn_dp_warn(&(bpf)->app->ctrl->dp, msg) argument
211 struct nfp_app_bpf *bpf; member
514 struct nfp_app_bpf *bpf; member
581 struct netdev_bpf *bpf);
591 unsigned int nfp_bpf_ctrl_cmsg_min_mtu(struct nfp_app_bpf *bpf);
592 unsigned int nfp_bpf_ctrl_cmsg_mtu(struct nfp_app_bpf *bpf);
593 unsigned int nfp_bpf_ctrl_cmsg_cache_cnt(struct nfp_app_bpf *bpf);
595 nfp_bpf_ctrl_alloc_map(struct nfp_app_bpf *bpf, struct bpf_map *map);
597 nfp_bpf_ctrl_free_map(struct nfp_app_bpf *bpf, struct nfp_bpf_map *nfp_map);
608 int nfp_bpf_event_output(struct nfp_app_bpf *bpf, const void *data,
Dverifier.c48 nfp_record_adjust_head(struct nfp_app_bpf *bpf, struct nfp_prog *nfp_prog, in nfp_record_adjust_head() argument
65 if (imm > (int)bpf->adjust_head.guaranteed_add || in nfp_record_adjust_head()
66 imm < -bpf->adjust_head.guaranteed_sub) in nfp_record_adjust_head()
177 struct nfp_app_bpf *bpf = nfp_prog->bpf; in nfp_bpf_check_helper_call() local
182 if (!bpf->adjust_head.off_max) { in nfp_bpf_check_helper_call()
186 if (!(bpf->adjust_head.flags & NFP_BPF_ADJUST_HEAD_NO_META)) { in nfp_bpf_check_helper_call()
191 nfp_record_adjust_head(bpf, nfp_prog, meta, reg2); in nfp_bpf_check_helper_call()
195 if (!bpf->adjust_tail) { in nfp_bpf_check_helper_call()
203 bpf->helpers.map_lookup, reg1) || in nfp_bpf_check_helper_call()
211 bpf->helpers.map_update, reg1) || in nfp_bpf_check_helper_call()
[all …]
Djit.c1606 adjust_head = &nfp_prog->bpf->adjust_head; in adjust_head()
4585 val = nfp_prog->bpf->helpers.map_lookup; in nfp_bpf_relo_for_vnic()
4588 val = nfp_prog->bpf->helpers.map_update; in nfp_bpf_relo_for_vnic()
4591 val = nfp_prog->bpf->helpers.map_delete; in nfp_bpf_relo_for_vnic()
4594 val = nfp_prog->bpf->helpers.perf_event_output; in nfp_bpf_relo_for_vnic()
/drivers/net/netdevsim/
Dbpf.c180 static int nsim_xdp_offload_prog(struct netdevsim *ns, struct netdev_bpf *bpf) in nsim_xdp_offload_prog() argument
182 if (!nsim_xdp_offload_active(ns) && !bpf->prog) in nsim_xdp_offload_prog()
184 if (!nsim_xdp_offload_active(ns) && bpf->prog && ns->bpf_offloaded) { in nsim_xdp_offload_prog()
185 NSIM_EA(bpf->extack, "TC program is already loaded"); in nsim_xdp_offload_prog()
189 return nsim_bpf_offload(ns, bpf->prog, nsim_xdp_offload_active(ns)); in nsim_xdp_offload_prog()
193 nsim_xdp_set_prog(struct netdevsim *ns, struct netdev_bpf *bpf, in nsim_xdp_set_prog() argument
198 if (bpf->command == XDP_SETUP_PROG && !ns->bpf_xdpdrv_accept) { in nsim_xdp_set_prog()
199 NSIM_EA(bpf->extack, "driver XDP disabled in DebugFS"); in nsim_xdp_set_prog()
202 if (bpf->command == XDP_SETUP_PROG_HW && !ns->bpf_xdpoffload_accept) { in nsim_xdp_set_prog()
203 NSIM_EA(bpf->extack, "XDP offload disabled in DebugFS"); in nsim_xdp_set_prog()
[all …]
Dnetdevsim.h112 int nsim_bpf(struct net_device *dev, struct netdev_bpf *bpf);
135 static inline int nsim_bpf(struct net_device *dev, struct netdev_bpf *bpf) in nsim_bpf() argument
DMakefile10 bpf.o
/drivers/net/ethernet/netronome/nfp/
DMakefile59 bpf/cmsg.o \
60 bpf/main.o \
61 bpf/offload.o \
62 bpf/verifier.o \
63 bpf/jit.o
Dnfp_app.h135 int (*bpf)(struct nfp_app *app, struct nfp_net *nn, member
321 struct netdev_bpf *bpf) in nfp_app_bpf() argument
323 if (!app || !app->type->bpf) in nfp_app_bpf()
325 return app->type->bpf(app, nn, bpf); in nfp_app_bpf()
Dnfp_net_common.c3559 static int nfp_net_xdp_setup_drv(struct nfp_net *nn, struct netdev_bpf *bpf) in nfp_net_xdp_setup_drv() argument
3561 struct bpf_prog *prog = bpf->prog; in nfp_net_xdp_setup_drv()
3567 xdp_attachment_setup(&nn->xdp, bpf); in nfp_net_xdp_setup_drv()
3581 err = nfp_net_ring_reconfig(nn, dp, bpf->extack); in nfp_net_xdp_setup_drv()
3585 xdp_attachment_setup(&nn->xdp, bpf); in nfp_net_xdp_setup_drv()
3589 static int nfp_net_xdp_setup_hw(struct nfp_net *nn, struct netdev_bpf *bpf) in nfp_net_xdp_setup_hw() argument
3593 err = nfp_app_xdp_offload(nn->app, nn, bpf->prog, bpf->extack); in nfp_net_xdp_setup_hw()
3597 xdp_attachment_setup(&nn->xdp_hw, bpf); in nfp_net_xdp_setup_hw()
/drivers/net/hyperv/
Dnetvsc_bpf.c166 int netvsc_bpf(struct net_device *dev, struct netdev_bpf *bpf) in netvsc_bpf() argument
171 struct netlink_ext_ack *extack = bpf->extack; in netvsc_bpf()
178 switch (bpf->command) { in netvsc_bpf()
180 ret = netvsc_xdp_set(dev, bpf->prog, extack, nvdev); in netvsc_bpf()
185 ret = netvsc_vf_setxdp(vf_netdev, bpf->prog); in netvsc_bpf()
Dhyperv_net.h212 int netvsc_bpf(struct net_device *dev, struct netdev_bpf *bpf);
/drivers/net/ethernet/ti/
Dcpsw_priv.c1261 static int cpsw_xdp_prog_setup(struct cpsw_priv *priv, struct netdev_bpf *bpf) in cpsw_xdp_prog_setup() argument
1263 struct bpf_prog *prog = bpf->prog; in cpsw_xdp_prog_setup()
1270 xdp_attachment_setup(&priv->xdpi, bpf); in cpsw_xdp_prog_setup()
1275 int cpsw_ndo_bpf(struct net_device *ndev, struct netdev_bpf *bpf) in cpsw_ndo_bpf() argument
1279 switch (bpf->command) { in cpsw_ndo_bpf()
1281 return cpsw_xdp_prog_setup(priv, bpf); in cpsw_ndo_bpf()
Dcpsw_priv.h439 int cpsw_ndo_bpf(struct net_device *ndev, struct netdev_bpf *bpf);
/drivers/media/rc/
DMakefile9 rc-core-$(CONFIG_BPF_LIRC_MODE2) += bpf-lirc.o
DKconfig35 Allow attaching eBPF programs to a lirc device using the bpf(2)
/drivers/net/ethernet/amazon/ena/
Dena_netdev.c504 static int ena_xdp_set(struct net_device *netdev, struct netdev_bpf *bpf) in ena_xdp_set() argument
507 struct bpf_prog *prog = bpf->prog; in ena_xdp_set()
548 NL_SET_ERR_MSG_MOD(bpf->extack, in ena_xdp_set()
555 NL_SET_ERR_MSG_MOD(bpf->extack, in ena_xdp_set()
566 static int ena_xdp(struct net_device *netdev, struct netdev_bpf *bpf) in ena_xdp() argument
568 switch (bpf->command) { in ena_xdp()
570 return ena_xdp_set(netdev, bpf); in ena_xdp()
/drivers/media/pci/bt8xx/
Dbttv-risc.c709 int bpf = bpl * (buf->vb.height >> 1); in bttv_buffer_risc() local
736 bpf,bpl,0,0,buf->vb.height >> 1); in bttv_buffer_risc()
/drivers/net/ethernet/marvell/mvpp2/
Dmvpp2_main.c4966 static int mvpp2_xdp_setup(struct mvpp2_port *port, struct netdev_bpf *bpf) in mvpp2_xdp_setup() argument
4968 struct bpf_prog *prog = bpf->prog, *old_prog; in mvpp2_xdp_setup()
4973 NL_SET_ERR_MSG_MOD(bpf->extack, "MTU too large for XDP"); in mvpp2_xdp_setup()
4978 NL_SET_ERR_MSG_MOD(bpf->extack, "Per CPU Pools required for XDP"); in mvpp2_xdp_setup()
4983 NL_SET_ERR_MSG_MOD(bpf->extack, "XDP_TX needs two TX queues per CPU"); in mvpp2_xdp_setup()
/drivers/net/ethernet/intel/igb/
Digb_main.c2840 static int igb_xdp_setup(struct net_device *dev, struct netdev_bpf *bpf) in igb_xdp_setup() argument
2844 struct bpf_prog *prog = bpf->prog, *old_prog; in igb_xdp_setup()
2853 NL_SET_ERR_MSG_MOD(bpf->extack, in igb_xdp_setup()