• Ido Schimmel's avatar
    mlxsw: spectrum: Prevent invalid ingress buffer mapping · 11719a58
    Ido Schimmel authored
    Packets entering the switch are mapped to a Switch Priority (SP)
    according to their PCP value (untagged frames are mapped to SP 0).
    
    The packets are classified to a priority group (PG) buffer in the port's
    headroom according to their SP.
    
    The switch maintains another mapping (SP to IEEE priority), which is
    used to generate PFC frames for lossless PGs. This mapping is
    initialized to IEEE = SP % 8.
    
    Therefore, when mapping SP 'x' to PG 'y' we create a situation in which
    an IEEE priority is mapped to two different PGs:
    
    IEEE 'x' ---> SP 'x' ---> PG 'y'
    IEEE 'x' ---> SP 'x + 8' ---> PG '0' (default)
    
    Which is invalid, as a flow can use only one PG buffer.
    
    Fix this by mapping both SP 'x' and 'x + 8' to the same PG buffer.
    
    Fixes: 8e8dfe9f ("mlxsw: spectrum: Add IEEE 802.1Qaz ETS support")
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    11719a58
spectrum_buffers.c 27.7 KB