aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@mellanox.com>2017-10-10 09:54:30 -0400
committerSaeed Mahameed <saeedm@mellanox.com>2018-01-11 19:01:49 -0500
commit4b7d4363f14a0398eca48c7e96e46120c5eb6a96 (patch)
tree9c55eb549f8728730ce2b9250ecb21be0ff2921c
parent97c8c3aa48ca8eb85d1806e08f882f90d78b1856 (diff)
net/mlx5e: Check support before TC swap in ETS init
Should not do the following swap between TCs 0 and 1 when max num of TCs is 1: tclass[prio=0]=1, tclass[prio=1]=0, tclass[prio=i]=i (for i>1) Fixes: 08fb1dacdd76 ("net/mlx5e: Support DCBNL IEEE ETS") Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
index a5c5134f5cb2..3d46ef48d5b8 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
@@ -937,9 +937,11 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv)
937 ets.prio_tc[i] = i; 937 ets.prio_tc[i] = i;
938 } 938 }
939 939
940 /* tclass[prio=0]=1, tclass[prio=1]=0, tclass[prio=i]=i (for i>1) */ 940 if (ets.ets_cap > 1) {
941 ets.prio_tc[0] = 1; 941 /* tclass[prio=0]=1, tclass[prio=1]=0, tclass[prio=i]=i (for i>1) */
942 ets.prio_tc[1] = 0; 942 ets.prio_tc[0] = 1;
943 ets.prio_tc[1] = 0;
944 }
943 945
944 err = mlx5e_dcbnl_ieee_setets_core(priv, &ets); 946 err = mlx5e_dcbnl_ieee_setets_core(priv, &ets);
945 if (err) 947 if (err)