From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Moshe Shemesh <moshe@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 8/8] net/mlx5e: Check ets capability before ets query FW command
Date: Fri, 27 Jan 2017 22:38:43 +0200 [thread overview]
Message-ID: <20170127203843.3206-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20170127203843.3206-1-saeedm@mellanox.com>
From: Moshe Shemesh <moshe@mellanox.com>
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.
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 5 +++++
1 file changed, 5 insertions(+)
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__);
--
2.11.0
next prev parent reply other threads:[~2017-01-27 20:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 20:38 [pull request][net 0/8] Mellanox mlx5 fixes 2017-01-27 Saeed Mahameed
2017-01-27 20:38 ` [net 1/8] net/mlx5: Change ENOTSUPP to EOPNOTSUPP Saeed Mahameed
2017-01-27 20:38 ` [net 2/8] net/mlx5: Return EOPNOTSUPP when failing to get steering name-space Saeed Mahameed
2017-01-27 20:38 ` [net 3/8] net/mlx5: E-Switch, Err when retrieving steering name-space fails Saeed Mahameed
2017-01-27 20:38 ` [net 4/8] net/mlx5: E-Switch, Re-enable RoCE on mode change only after FDB destroy Saeed Mahameed
2017-01-27 20:38 ` [net 5/8] net/mlx5e: Support TC encapsulation offloads with upper devices Saeed Mahameed
2017-01-27 20:38 ` [net 6/8] net/mlx5e: Modify TIRs hash only when it's needed Saeed Mahameed
2017-01-27 20:38 ` [net 7/8] net/mlx5e: Fix update of hash function/key via ethtool Saeed Mahameed
2017-01-27 21:50 ` Tom Herbert
2017-01-28 11:06 ` Saeed Mahameed
2017-01-27 20:38 ` Saeed Mahameed [this message]
2017-01-29 20:57 ` [pull request][net 0/8] Mellanox mlx5 fixes 2017-01-27 Saeed Mahameed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170127203843.3206-9-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=moshe@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox