The received packet priority for CPDMA host port receive packets is determined as follows:
- If the first packet LTYPE = VLAN_LTYPE_SEL then the received packet priority is the packet priority (VLAN tagged and priority tagged packets).
- Else if the first packet LTYPE = 0x0800 and byte 14 (following the LTYPE) is equal to 0x4X, and DSCP_IPV4_EN is set in CPSW_P0_CONTROL_REG, then the received packet priority is the 6-bit TOS field in byte 15 (upper 6 bits) mapped through the port’s DSCP priority mapping registers (IPv4 packet).
- Else if the first packet LTYPE = 0x86DD and the most significant nibble of byte 14 (following the LTYPE) is equal to 0x6, and DSCP_IPV6_EN is set in CPSW_P0_CONTROL_REG, then the received packet priority is the 6-bit priority (in the 6-bits following the upper nibble 0x6) mapped through the port’s DSCP priority mapping registers (IPv6 packet).
- Else the received packet priority is the source (ingress) port priority taken from the port's P0_PORT_VLAN register.
The packet priority is mapped through the receive ports associated packet-priority-to-header-packet-priority-mapping register (CPSW_P0_RX_PRI_MAP_REG) to obtain the header packet priority. The header packet priority is then used as the actual transmit packet priority if the VLAN information is to be sent on egress.
For CPDMA host port receive packets, the destination port hardware switch priority is the below selected value remapped through CPSW_P0_RX_PRI_MAP_REG:
- If the receive packet is priority or VLAN tagged:
- If CPSW_P0_RX_REMAP_VLAN_REG is clear then the destination hardware switch priority is the host receive channel number.
- If CPSW_P0_RX_REMAP_VLAN_REG is set then the destination hardware switch priority is the packet priority value. Port transmit remapping (ENET_PN_TX_PRI_MAP should remain the default value) is not compatible with this bit being set, but remapping can be configured on port 0 receive.
- Else if the receive packet has the first packet LTYPE = 0x0800 and byte 14 (following the LTYPE) is equal to 0x4X, and DSCP_IPV4_EN is set in CPSW_P0_CONTROL_REG:
- If P0_RX_REMAP_DSCP_IPV4 is clear then the destination hardware switch priority is the host receive priority.
- If P0_RX_REMAP_DSCP_IPV4 is set then the destination hardware switch priority is the 6-bit TOS field in byte 15 (upper 6 bits) mapped through the port's DSCP priority mapping registers (IPV4 packet). Port transmit remapping (ENET_PN_TX_PRI_MAP should remain the default value) is not compatible with this bit being set, but remapping can be configured on port 0 receive.
- Else if the receive packet has the first packet LTYPE = 0x86DD and the most significant nibble of byte 14 (following the LTYPE) is equal to 0x6, and DSCP_IPV6_EN is set in CPSW_P0_CONTROL_REG:
- If P0_RX_REMAP_DSCP_IPV6 is clear then the destination hardware switch priority is the host receive priority.
- If P0_RX_REMAP_DSCP_IPV6 is set then the destination hardware switch priority is the 6-bit priority (in the 6 bits following the upper nibble 0x6) mapped through the port's DSCP priority mapping registers (IPV6 packet). Port transmit remapping (ENET_PN_TX_PRI_MAP should remain the default value) is not compatible with this bit being set, but remapping can be configured on port 0 receive.
- Else the receive packet is non-tagged and the destination hardware switch priority is the host receive channel number.