Lines Matching full:dscp

6 #include <net/dscp.h>
68 * The priority sources, including Tail Tag, ACL, VLAN PCP and DSCP are ordered
73 * 1. Tail Tag - Highest priority, overrides ACL, VLAN PCP, and DSCP priorities.
74 * 2. ACL - Overrides VLAN PCP and DSCP priorities.
75 * 3. VLAN PCP - Overrides DSCP priority.
76 * 4. DSCP - Lowest priority, does not override any other priority source.
91 "empty", "dscp", "pcp", "dscp pcp"
109 * ksz_get_dscp_prio_reg - Retrieves the DSCP-to-priority-mapping register
112 * @per_reg: Pointer to the number of DSCP values per register
115 * This function retrieves the DSCP to priority mapping register, the number of
116 * DSCP values per register, and the mask to be set.
216 * ksz_port_get_dscp_prio - Retrieves the priority for a DSCP value on a KSZ
220 * @dscp: DSCP value for which to get the priority
222 * This function fetches the priority value from switch global DSCP-to-priorty
223 * mapping table for the specified DSCP value.
225 * Return: The priority value for the DSCP on success, or a negative error
228 int ksz_port_get_dscp_prio(struct dsa_switch *ds, int port, u8 dscp) in ksz_port_get_dscp_prio() argument
236 /* If DSCP remapping is disabled, DSCP bits 3-5 are used as Internal in ksz_port_get_dscp_prio()
244 /* If DSCP remapping is disabled, DSCP bits 3-5 are used as in ksz_port_get_dscp_prio()
249 dscp); in ksz_port_get_dscp_prio()
252 /* In case DSCP remapping is enabled, we need to write the DSCP to in ksz_port_get_dscp_prio()
255 reg += dscp / per_reg; in ksz_port_get_dscp_prio()
260 shift = (dscp % per_reg) * (8 / per_reg); in ksz_port_get_dscp_prio()
266 * ksz_set_global_dscp_entry - Sets the global DSCP-to-priority mapping entry
268 * @dscp: DSCP value for which to set the priority
271 * This function sets the global DSCP-to-priority mapping entry for the
272 * specified DSCP value.
276 static int ksz_set_global_dscp_entry(struct ksz_device *dev, u8 dscp, u8 ipm) in ksz_set_global_dscp_entry() argument
283 shift = (dscp % per_reg) * (8 / per_reg); in ksz_set_global_dscp_entry()
285 return ksz_rmw8(dev, reg + (dscp / per_reg), mask << shift, in ksz_set_global_dscp_entry()
290 * ksz_init_global_dscp_map - Initializes the global DSCP-to-priority mapping
293 * This function initializes the global DSCP-to-priority mapping table for the
300 int ret, dscp; in ksz_init_global_dscp_map() local
302 /* On KSZ9xxx variants, DSCP remapping is disabled by default. in ksz_init_global_dscp_map()
314 for (dscp = 0; dscp < DSCP_MAX; dscp++) { in ksz_init_global_dscp_map()
317 /* Map DSCP to Traffic Type, which is corresponding to the in ksz_init_global_dscp_map()
321 ipm = ietf_dscp_to_ieee8021q_tt(dscp); in ksz_init_global_dscp_map()
324 * remapping table. We need to convert DSCP to Traffic in ksz_init_global_dscp_map()
327 tt = ietf_dscp_to_ieee8021q_tt(dscp); in ksz_init_global_dscp_map()
337 ret = ksz_set_global_dscp_entry(dev, dscp, ipm); in ksz_init_global_dscp_map()
344 * ksz_port_add_dscp_prio - Adds a DSCP-to-priority mapping entry for a port on
347 * @port: Port number for which to add the DSCP-to-priority mapping entry
348 * @dscp: DSCP value for which to add the priority
353 int ksz_port_add_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio) in ksz_port_add_dscp_prio() argument
360 return ksz_set_global_dscp_entry(dev, dscp, prio); in ksz_port_add_dscp_prio()
364 * ksz_port_del_dscp_prio - Deletes a DSCP-to-priority mapping entry for a port
367 * @port: Port number for which to delete the DSCP-to-priority mapping entry
368 * @dscp: DSCP value for which to delete the priority
373 int ksz_port_del_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio) in ksz_port_del_dscp_prio() argument
378 if (ksz_port_get_dscp_prio(ds, port, dscp) != prio) in ksz_port_del_dscp_prio()
390 return ksz_set_global_dscp_entry(dev, dscp, ipm); in ksz_port_del_dscp_prio()
597 * DSCP-to-priority mapping table is initialized.