Lines Matching +full:port +full:- +full:mapping
1 // SPDX-License-Identifier: GPL-2.0+
51 switch (app->selector) { in sparx5_dcb_app_validate()
54 if (app->protocol != 0) in sparx5_dcb_app_validate()
55 err = -EINVAL; in sparx5_dcb_app_validate()
56 else if (app->priority >= SPX5_PRIOS) in sparx5_dcb_app_validate()
57 err = -ERANGE; in sparx5_dcb_app_validate()
61 if (app->protocol >= SPARX5_PORT_QOS_DSCP_COUNT) in sparx5_dcb_app_validate()
62 err = -EINVAL; in sparx5_dcb_app_validate()
63 else if (app->priority >= SPX5_PRIOS) in sparx5_dcb_app_validate()
64 err = -ERANGE; in sparx5_dcb_app_validate()
68 if (app->protocol >= SPARX5_PORT_QOS_PCP_DEI_COUNT) in sparx5_dcb_app_validate()
69 err = -EINVAL; in sparx5_dcb_app_validate()
70 else if (app->priority >= SPX5_PRIOS) in sparx5_dcb_app_validate()
71 err = -ERANGE; in sparx5_dcb_app_validate()
74 err = -EINVAL; in sparx5_dcb_app_validate()
79 netdev_err(dev, "Invalid entry: %d:%d\n", app->protocol, in sparx5_dcb_app_validate()
80 app->priority); in sparx5_dcb_app_validate()
116 *err = -EOPNOTSUPP; in sparx5_dcb_apptrust_validate()
127 for (i = 0; i < conf->nselectors; i++) in sparx5_dcb_apptrust_contains()
128 if (conf->selectors[i] == selector) in sparx5_dcb_apptrust_contains()
138 struct sparx5_port *port = netdev_priv(dev); in sparx5_dcb_app_update() local
143 int portno = port->portno; in sparx5_dcb_app_update()
155 qos.default_prio = fls(qos.default_prio) - 1; in sparx5_dcb_app_update()
157 /* Get dscp ingress mapping */ in sparx5_dcb_app_update()
158 for (i = 0; i < ARRAY_SIZE(dscp_map->map); i++) { in sparx5_dcb_app_update()
161 dscp_map->map[i] = dcb_getapp(dev, &app_itr); in sparx5_dcb_app_update()
164 /* Get pcp ingress mapping */ in sparx5_dcb_app_update()
165 for (i = 0; i < ARRAY_SIZE(pcp_map->map); i++) { in sparx5_dcb_app_update()
168 pcp_map->map[i] = dcb_getapp(dev, &app_itr); in sparx5_dcb_app_update()
171 /* Get pcp rewrite mapping */ in sparx5_dcb_app_update()
177 qos.pcp_rewr.map.map[i] = fls(pcp_rewr_map.map[i]) - 1; in sparx5_dcb_app_update()
180 /* Get dscp rewrite mapping */ in sparx5_dcb_app_update()
193 dscp = fls64(dscp_rewr_map.map[i]) - 1; in sparx5_dcb_app_update()
223 return sparx5_port_qos_set(port, &qos); in sparx5_dcb_app_update()
228 * DSCP mapping is global for all ports, so set and delete app entries are
229 * replicated for each port.
236 struct sparx5_port *port = netdev_priv(dev); in sparx5_dcb_ieee_dscp_setdel() local
241 port_itr = port->sparx5->ports[i]; in sparx5_dcb_ieee_dscp_setdel()
244 err = setdel(port_itr->ndev, app); in sparx5_dcb_ieee_dscp_setdel()
256 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in sparx5_dcb_ieee_delapp()
277 /* Delete current mapping, if it exists */ in sparx5_dcb_ieee_setapp()
285 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in sparx5_dcb_ieee_setapp()
302 struct sparx5_port *port = netdev_priv(dev); in sparx5_dcb_setapptrust() local
309 sparx5_port_apptrust[port->portno] = &sparx5_dcb_apptrust_policies[idx]; in sparx5_dcb_setapptrust()
317 struct sparx5_port *port = netdev_priv(dev); in sparx5_dcb_getapptrust() local
320 trust = sparx5_port_apptrust[port->portno]; in sparx5_dcb_getapptrust()
322 memcpy(selectors, trust->selectors, trust->nselectors); in sparx5_dcb_getapptrust()
323 *nselectors = trust->nselectors; in sparx5_dcb_getapptrust()
332 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in sparx5_dcb_delrewr()
353 /* Delete current mapping, if it exists. */ in sparx5_dcb_setrewr()
361 if (app->selector == IEEE_8021QAZ_APP_SEL_DSCP) in sparx5_dcb_setrewr()
386 struct sparx5_port *port; in sparx5_dcb_init() local
390 port = sparx5->ports[i]; in sparx5_dcb_init()
391 if (!port) in sparx5_dcb_init()
393 port->ndev->dcbnl_ops = &sparx5_dcbnl_ops; in sparx5_dcb_init()
395 sparx5_port_apptrust[port->portno] = in sparx5_dcb_init()
402 sparx5_port_qos_dscp_rewr_mode_set(port, in sparx5_dcb_init()