summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
diff options
context:
space:
mode:
authorMoshe Shemesh2017-01-19 13:53:07 +0100
committerSaeed Mahameed2017-01-29 22:31:26 +0100
commitd15118af268324ecfc968dd90396e966f4f9b3ff (patch)
tree0cd5f5b66688fc23634a6e89f848d80f64b66dc7 /drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
parentnet/mlx5e: Fix update of hash function/key via ethtool (diff)
downloadkernel-qcow2-linux-d15118af268324ecfc968dd90396e966f4f9b3ff.tar.gz
kernel-qcow2-linux-d15118af268324ecfc968dd90396e966f4f9b3ff.tar.xz
kernel-qcow2-linux-d15118af268324ecfc968dd90396e966f4f9b3ff.zip
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: 3a6a931dfb8e ("net/mlx5e: Support DCBX CEE API") Signed-off-by: Moshe Shemesh <moshe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c5
1 files changed, 5 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 35f9ae037ba0..0523ed47f597 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
@@ -511,6 +511,11 @@ static void mlx5e_dcbnl_getpgtccfgtx(struct net_device *netdev,
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
+ if (!MLX5_CAP_GEN(priv->mdev, ets)) {
+ netdev_err(netdev, "%s, ets is not supported\n", __func__);
+ return;
+ }
+
if (priority >= CEE_DCBX_MAX_PRIO) {
netdev_err(netdev,
"%s, priority is out of range\n", __func__);