Skip to content

Commit d15118a

Browse files
Moshe ShemeshSaeed Mahameed
authored andcommitted
net/mlx5e: Check ets capability before ets query FW command
On dcbnl callback getpgtccfgtx, the driver should check the ets capability before ets query command is sent to firmware. It is valid to return from this void function without changing in/out parameters, as these parameters are initialized to DCB_ATTR_VALUE_UNDEFINED. Fixes: 3a6a931 ("net/mlx5e: Support DCBX CEE API") Signed-off-by: Moshe Shemesh <moshe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent a100ff3 commit d15118a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,11 @@ static void mlx5e_dcbnl_getpgtccfgtx(struct net_device *netdev,
511511
struct mlx5e_priv *priv = netdev_priv(netdev);
512512
struct mlx5_core_dev *mdev = priv->mdev;
513513

514+
if (!MLX5_CAP_GEN(priv->mdev, ets)) {
515+
netdev_err(netdev, "%s, ets is not supported\n", __func__);
516+
return;
517+
}
518+
514519
if (priority >= CEE_DCBX_MAX_PRIO) {
515520
netdev_err(netdev,
516521
"%s, priority is out of range\n", __func__);

0 commit comments

Comments
 (0)