Lines Matching +full:lan966x +full:- +full:switch

1 // SPDX-License-Identifier: GPL-2.0+
12 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_setup() local
17 if (!lan966x->fdma) { in lan966x_xdp_setup()
18 NL_SET_ERR_MSG_MOD(xdp->extack, in lan966x_xdp_setup()
20 return -EOPNOTSUPP; in lan966x_xdp_setup()
23 old_xdp = lan966x_xdp_present(lan966x); in lan966x_xdp_setup()
24 old_prog = xchg(&port->xdp_prog, xdp->prog); in lan966x_xdp_setup()
25 new_xdp = lan966x_xdp_present(lan966x); in lan966x_xdp_setup()
30 err = lan966x_fdma_reload_page_pool(lan966x); in lan966x_xdp_setup()
32 xchg(&port->xdp_prog, old_prog); in lan966x_xdp_setup()
45 switch (xdp->command) { in lan966x_xdp()
49 return -EINVAL; in lan966x_xdp()
77 struct bpf_prog *xdp_prog = port->xdp_prog; in lan966x_xdp_run()
78 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_run() local
82 xdp_init_buff(&xdp, PAGE_SIZE << lan966x->rx.page_order, in lan966x_xdp_run()
83 &port->xdp_rxq); in lan966x_xdp_run()
86 data_len - IFH_LEN_BYTES, false); in lan966x_xdp_run()
88 switch (act) { in lan966x_xdp_run()
93 data_len - IFH_LEN_BYTES) ? in lan966x_xdp_run()
96 if (xdp_do_redirect(port->dev, &xdp, xdp_prog)) in lan966x_xdp_run()
101 bpf_warn_invalid_xdp_action(port->dev, xdp_prog, act); in lan966x_xdp_run()
104 trace_xdp_exception(port->dev, xdp_prog, act); in lan966x_xdp_run()
111 bool lan966x_xdp_present(struct lan966x *lan966x) in lan966x_xdp_present() argument
113 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_xdp_present()
114 if (!lan966x->ports[p]) in lan966x_xdp_present()
117 if (lan966x_xdp_port_present(lan966x->ports[p])) in lan966x_xdp_present()
126 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_port_init() local
128 return xdp_rxq_info_reg(&port->xdp_rxq, port->dev, 0, in lan966x_xdp_port_init()
129 lan966x->napi.napi_id); in lan966x_xdp_port_init()
134 if (xdp_rxq_info_is_reg(&port->xdp_rxq)) in lan966x_xdp_port_deinit()
135 xdp_rxq_info_unreg(&port->xdp_rxq); in lan966x_xdp_port_deinit()