diff options
author | Huy Nguyen <huyn@mellanox.com> | 2016-12-28 15:58:40 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-28 22:36:53 +0300 |
commit | 4525a45bfad55a00ef218c5fbe5d98a3d8170bf5 (patch) | |
tree | 98c82fc485103ee2b3b0372c3a9fe0ac1e96c3b8 /drivers/net | |
parent | 1efbd205b3cc5882a8c386c58a57134044e9d5ba (diff) | |
download | linux-4525a45bfad55a00ef218c5fbe5d98a3d8170bf5.tar.xz |
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: e207b7e99176 ("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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c index 7f6c225666c1..f0b460f47f29 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c @@ -723,6 +723,9 @@ static void mlx5e_ets_init(struct mlx5e_priv *priv) int i; struct ieee_ets ets; + if (!MLX5_CAP_GEN(priv->mdev, ets)) + return; + memset(&ets, 0, sizeof(ets)); ets.ets_cap = mlx5_max_tc(priv->mdev) + 1; for (i = 0; i < ets.ets_cap; i++) { |