Skip to content

Commit 44d5531

Browse files
msanallaSaeed Mahameed
authored andcommitted
net/mlx5: Read the TC mapping of all priorities on ETS query
When ETS configurations are queried by the user to get the mapping assignment between packet priority and traffic class, only priorities up to maximum TCs are queried from QTCT register in FW to retrieve their assigned TC, leaving the rest of the priorities mapped to the default TC #0 which might be misleading. Fix by querying the TC mapping of all priorities on each ETS query, regardless of the maximum number of TCs configured in FW. Fixes: 820c2c5 ("net/mlx5e: Read ETS settings directly from firmware") Signed-off-by: Maher Sanalla <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 7e3fce8 commit 44d5531

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,14 @@ static int mlx5e_dcbnl_ieee_getets(struct net_device *netdev,
117117
if (!MLX5_CAP_GEN(priv->mdev, ets))
118118
return -EOPNOTSUPP;
119119

120-
ets->ets_cap = mlx5_max_tc(priv->mdev) + 1;
121-
for (i = 0; i < ets->ets_cap; i++) {
120+
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
122121
err = mlx5_query_port_prio_tc(mdev, i, &ets->prio_tc[i]);
123122
if (err)
124123
return err;
124+
}
125125

126+
ets->ets_cap = mlx5_max_tc(priv->mdev) + 1;
127+
for (i = 0; i < ets->ets_cap; i++) {
126128
err = mlx5_query_port_tc_group(mdev, i, &tc_group[i]);
127129
if (err)
128130
return err;

0 commit comments

Comments
 (0)