Lines Matching +full:port +full:- +full:mapping
1 // SPDX-License-Identifier: GPL-2.0+
40 for (int i = 0; i < conf->nselectors; i++) in lan966x_dcb_apptrust_contains()
41 if (conf->selectors[i] == selector) in lan966x_dcb_apptrust_contains()
51 struct lan966x_port *port = netdev_priv(dev); in lan966x_dcb_app_update() local
57 /* Get pcp ingress mapping */ in lan966x_dcb_app_update()
64 /* Get dscp ingress mapping */ in lan966x_dcb_app_update()
74 qos.default_prio = fls(qos.default_prio) - 1; in lan966x_dcb_app_update()
76 /* Get pcp rewrite mapping */ in lan966x_dcb_app_update()
83 qos.pcp_rewr.map[i] = fls(pcp_rewr_map.map[i]) - 1; in lan966x_dcb_app_update()
86 /* Get dscp rewrite mapping */ in lan966x_dcb_app_update()
93 qos.dscp_rewr.map[i] = fls64(dscp_rewr_map.map[i]) - 1; in lan966x_dcb_app_update()
97 if (lan966x_dcb_apptrust_contains(port->chip_port, DCB_APP_SEL_PCP)) { in lan966x_dcb_app_update()
105 if (lan966x_dcb_apptrust_contains(port->chip_port, IEEE_8021QAZ_APP_SEL_DSCP)) { in lan966x_dcb_app_update()
112 lan966x_port_qos_set(port, &qos); in lan966x_dcb_app_update()
115 /* DSCP mapping is global for all ports, so set and delete app entries are
116 * replicated for each port.
123 struct lan966x_port *port = netdev_priv(dev); in lan966x_dcb_ieee_dscp_setdel() local
124 struct lan966x *lan966x = port->lan966x; in lan966x_dcb_ieee_dscp_setdel()
128 port = lan966x->ports[i]; in lan966x_dcb_ieee_dscp_setdel()
129 if (!port) in lan966x_dcb_ieee_dscp_setdel()
132 err = setdel(port->dev, app); in lan966x_dcb_ieee_dscp_setdel()
145 switch (app->selector) { in lan966x_dcb_app_validate()
148 if (app->protocol) in lan966x_dcb_app_validate()
149 err = -EINVAL; in lan966x_dcb_app_validate()
150 else if (app->priority >= NUM_PRIO_QUEUES) in lan966x_dcb_app_validate()
151 err = -ERANGE; in lan966x_dcb_app_validate()
155 if (app->protocol >= LAN966X_PORT_QOS_DSCP_COUNT) in lan966x_dcb_app_validate()
156 err = -EINVAL; in lan966x_dcb_app_validate()
157 else if (app->priority >= NUM_PRIO_QUEUES) in lan966x_dcb_app_validate()
158 err = -ERANGE; in lan966x_dcb_app_validate()
162 if (app->protocol >= LAN966X_PORT_QOS_PCP_DEI_COUNT) in lan966x_dcb_app_validate()
163 err = -EINVAL; in lan966x_dcb_app_validate()
164 else if (app->priority >= NUM_PRIO_QUEUES) in lan966x_dcb_app_validate()
165 err = -ERANGE; in lan966x_dcb_app_validate()
168 err = -EINVAL; in lan966x_dcb_app_validate()
173 netdev_err(dev, "Invalid entry: %d:%d\n", app->protocol, in lan966x_dcb_app_validate()
174 app->priority); in lan966x_dcb_app_validate()
183 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in lan966x_dcb_ieee_delapp()
206 /* Delete current mapping, if it exists */ in lan966x_dcb_ieee_setapp()
214 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in lan966x_dcb_ieee_setapp()
253 return -EOPNOTSUPP; in lan966x_dcb_apptrust_validate()
260 struct lan966x_port *port = netdev_priv(dev); in lan966x_dcb_setapptrust() local
267 lan966x_port_apptrust[port->chip_port] = &lan966x_dcb_apptrust_policies[idx]; in lan966x_dcb_setapptrust()
276 struct lan966x_port *port = netdev_priv(dev); in lan966x_dcb_getapptrust() local
279 trust = lan966x_port_apptrust[port->chip_port]; in lan966x_dcb_getapptrust()
281 memcpy(selectors, trust->selectors, trust->nselectors); in lan966x_dcb_getapptrust()
282 *nselectors = trust->nselectors; in lan966x_dcb_getapptrust()
291 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in lan966x_dcb_delrewr()
314 /* Delete current mapping, if it exists. */ in lan966x_dcb_setrewr()
322 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in lan966x_dcb_setrewr()
347 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_dcb_init()
348 struct lan966x_port *port; in lan966x_dcb_init() local
350 port = lan966x->ports[p]; in lan966x_dcb_init()
351 if (!port) in lan966x_dcb_init()
354 port->dev->dcbnl_ops = &lan966x_dcbnl_ops; in lan966x_dcb_init()
356 lan966x_port_apptrust[port->chip_port] = in lan966x_dcb_init()
362 lan966x_port_qos_dscp_rewr_mode_set(port, in lan966x_dcb_init()