OSDN Git Service

mlxsw: spectrum: Configure MC-aware mode on mlxsw ports
authorPetr Machata <petrm@mellanox.com>
Sun, 5 Aug 2018 06:03:08 +0000 (09:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Aug 2018 00:28:21 +0000 (17:28 -0700)
commit7b819530669458c3af6d44edfc9cb34958492bca
treec191db40b820235e7cd6708608bc1de6949cdd33
parentd0a07d6ada004ddaf010888a66d72ef606336bf4
mlxsw: spectrum: Configure MC-aware mode on mlxsw ports

In order to give unicast traffic precedence over BUM traffic, configure
multicast-aware mode on all ports.

Under multicast-aware regime, when assigning traffic class to a packet,
the switch doesn't merely take the value prescribed by the QTCT
register. For BUM traffic, it instead assigns that value plus 8.

ETS elements for TCs 8..15 thus need to be configured as well. Extend
mlxsw_sp_port_ets_init() so that it maps each of them to the same
subgroup as their corresponding TC from the range 0..7, such that TCs X
and X+8 map to the same subgroup.

The existing code configures TCs with strict priority. So far this was
immaterial, because each TC had its own subgroup. Now that two TCs share
a subgroup it becomes important. TCs are prioritized in order of 7, 6,
..., 0, 15, 14, ..., 8: the higher TCs used for BUM traffic end up being
deprioritized. Since that's what's needed, keep that configuration as it
is, and configure the new TCs likewise.

Finally in mlxsw_sp_port_create(), invoke configuration of QTCTM to
enable MC-aware mode on each port.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c