Commit 4525a45b authored by Huy Nguyen's avatar Huy Nguyen Committed by David S. Miller

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: e207b7e9 ("net/mlx5e: ConnectX-4 firmware support for DCBX")
Signed-off-by: default avatarHuy Nguyen <huyn@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1efbd205
...@@ -723,6 +723,9 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv) ...@@ -723,6 +723,9 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv)
int i; int i;
struct ieee_ets ets; struct ieee_ets ets;
if (!MLX5_CAP_GEN(priv->mdev, ets))
return;
memset(&ets, 0, sizeof(ets)); memset(&ets, 0, sizeof(ets));
ets.ets_cap = mlx5_max_tc(priv->mdev) + 1; ets.ets_cap = mlx5_max_tc(priv->mdev) + 1;
for (i = 0; i < ets.ets_cap; i++) { for (i = 0; i < ets.ets_cap; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment