aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-10-31 05:56:44 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-31 15:56:58 -0400
commit0fe64023162aef123de2f1993ba13a35a786e1de (patch)
treeab0d7a698d6ae0b408409944061bffc5ac1435dd
parent8b931821aa04823e2e5df0ae93937baabbd23286 (diff)
mlxsw: spectrum: Set minimum shaper on MC TCs
An MC-aware mode was introduced in commit 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports"). In MC-aware mode, BUM traffic gets a special treatment by being assigned to a separate set of traffic classes 8..15. Pairs of TCs 0 and 8, 1 and 9, etc., are then configured to strictly prioritize the lower-numbered ones. The intention is to prevent BUM traffic from flooding the switch and push out all UC traffic, which would otherwise happen, and instead give UC traffic precedence. However strictly prioritizing UC traffic has the effect that UC overload pushes out all BUM traffic, such as legitimate ARP queries. These packets are kept in queues for a while, but under sustained UC overload, their lifetime eventually expires and these packets are dropped. That is detrimental to network performance as well. Therefore configure the MC TCs (8..15) with minimum shaper of 200Mbps (a minimum permitted value) to allow a trickle of necessary control traffic to get through. Fixes: 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports") 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>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 8a4983adae94..a2df12b79f8e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -2740,6 +2740,21 @@ int mlxsw_sp_port_ets_maxrate_set(struct mlxsw_sp_port *mlxsw_sp_port,
2740 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl); 2740 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl);
2741} 2741}
2742 2742
2743static int mlxsw_sp_port_min_bw_set(struct mlxsw_sp_port *mlxsw_sp_port,
2744 enum mlxsw_reg_qeec_hr hr, u8 index,
2745 u8 next_index, u32 minrate)
2746{
2747 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
2748 char qeec_pl[MLXSW_REG_QEEC_LEN];
2749
2750 mlxsw_reg_qeec_pack(qeec_pl, mlxsw_sp_port->local_port, hr, index,
2751 next_index);
2752 mlxsw_reg_qeec_mise_set(qeec_pl, true);
2753 mlxsw_reg_qeec_min_shaper_rate_set(qeec_pl, minrate);
2754
2755 return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(qeec), qeec_pl);
2756}
2757
2743int mlxsw_sp_port_prio_tc_set(struct mlxsw_sp_port *mlxsw_sp_port, 2758int mlxsw_sp_port_prio_tc_set(struct mlxsw_sp_port *mlxsw_sp_port,
2744 u8 switch_prio, u8 tclass) 2759 u8 switch_prio, u8 tclass)
2745{ 2760{
@@ -2817,6 +2832,16 @@ static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port)
2817 return err; 2832 return err;
2818 } 2833 }
2819 2834
2835 /* Configure the min shaper for multicast TCs. */
2836 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
2837 err = mlxsw_sp_port_min_bw_set(mlxsw_sp_port,
2838 MLXSW_REG_QEEC_HIERARCY_TC,
2839 i + 8, i,
2840 MLXSW_REG_QEEC_MIS_MIN);
2841 if (err)
2842 return err;
2843 }
2844
2820 /* Map all priorities to traffic class 0. */ 2845 /* Map all priorities to traffic class 0. */
2821 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { 2846 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
2822 err = mlxsw_sp_port_prio_tc_set(mlxsw_sp_port, i, 0); 2847 err = mlxsw_sp_port_prio_tc_set(mlxsw_sp_port, i, 0);