Skip to content

Commit 4525a45

Browse files
Huy Nguyendavem330
authored andcommitted
net/mlx5e: Check ets capability before initializing ets settings
During the initial setup, the ets command is sent to firmware without checking if the HCA supports ets. This causes the invalid command error. Add the ets capiblity check before sending firmware command to initialize ets settings. Fixes: e207b7e ("net/mlx5e: ConnectX-4 firmware support for DCBX") Signed-off-by: Huy Nguyen <huyn@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1efbd20 commit 4525a45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,9 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv)
723723
int i;
724724
struct ieee_ets ets;
725725

726+
if (!MLX5_CAP_GEN(priv->mdev, ets))
727+
return;
728+
726729
memset(&ets, 0, sizeof(ets));
727730
ets.ets_cap = mlx5_max_tc(priv->mdev) + 1;
728731
for (i = 0; i < ets.ets_cap; i++) {

0 commit comments

Comments
 (0)