netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Dmytro Linkin <dmitrolin@mellanox.com>,
	Gavi Teitz <gavi@mellanox.com>, Roi Dayan <roid@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net 08/11] net/mlx5e: Add missing ethtool driver info for representors
Date: Fri, 17 May 2019 20:19:56 +0000	[thread overview]
Message-ID: <20190517201910.32216-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20190517201910.32216-1-saeedm@mellanox.com>

From: Dmytro Linkin <dmitrolin@mellanox.com>

For all representors added firmware version info to show in
ethtool driver info.
For uplink representor, because only it is tied to the pci device
sysfs, added pci bus info.

Fixes: ff9b85de5d5d ("net/mlx5e: Add some ethtool port control entries to the uplink rep netdev")
Signed-off-by: Dmytro Linkin <dmitrolin@mellanox.com>
Reviewed-by: Gavi Teitz <gavi@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 .../net/ethernet/mellanox/mlx5/core/en_rep.c  | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
index 91e24f1cead8..5283e16c69e4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
@@ -65,9 +65,26 @@ static void mlx5e_rep_indr_unregister_block(struct mlx5e_rep_priv *rpriv,
 static void mlx5e_rep_get_drvinfo(struct net_device *dev,
 				  struct ethtool_drvinfo *drvinfo)
 {
+	struct mlx5e_priv *priv = netdev_priv(dev);
+	struct mlx5_core_dev *mdev = priv->mdev;
+
 	strlcpy(drvinfo->driver, mlx5e_rep_driver_name,
 		sizeof(drvinfo->driver));
 	strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
+	snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
+		 "%d.%d.%04d (%.16s)",
+		 fw_rev_maj(mdev), fw_rev_min(mdev),
+		 fw_rev_sub(mdev), mdev->board_id);
+}
+
+static void mlx5e_uplink_rep_get_drvinfo(struct net_device *dev,
+					 struct ethtool_drvinfo *drvinfo)
+{
+	struct mlx5e_priv *priv = netdev_priv(dev);
+
+	mlx5e_rep_get_drvinfo(dev, drvinfo);
+	strlcpy(drvinfo->bus_info, pci_name(priv->mdev->pdev),
+		sizeof(drvinfo->bus_info));
 }
 
 static const struct counter_desc sw_rep_stats_desc[] = {
@@ -363,7 +380,7 @@ static const struct ethtool_ops mlx5e_vf_rep_ethtool_ops = {
 };
 
 static const struct ethtool_ops mlx5e_uplink_rep_ethtool_ops = {
-	.get_drvinfo	   = mlx5e_rep_get_drvinfo,
+	.get_drvinfo	   = mlx5e_uplink_rep_get_drvinfo,
 	.get_link	   = ethtool_op_get_link,
 	.get_strings       = mlx5e_rep_get_strings,
 	.get_sset_count    = mlx5e_rep_get_sset_count,
-- 
2.21.0


  parent reply	other threads:[~2019-05-17 20:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 20:19 [pull request][net 00/11] Mellanox, mlx5 fixes 2019-05-17 Saeed Mahameed
2019-05-17 20:19 ` [net 01/11] net/mlx5: Imply MLXFW in mlx5_core Saeed Mahameed
2019-05-17 20:19 ` [net 02/11] net/mlx5: Add meaningful return codes to status_to_err function Saeed Mahameed
2019-05-17 20:19 ` [net 03/11] net/mlx5: E-Switch, Correct type to u16 for vport_num and int for vport_index Saeed Mahameed
2019-05-17 20:19 ` [net 04/11] net/mlx5: Fix peer pf disable hca command Saeed Mahameed
2019-05-17 20:19 ` [net 05/11] net/mlx5e: Fix wrong xmit_more application Saeed Mahameed
2019-05-17 20:19 ` [net 06/11] net/mlx5e: Fix ethtool rxfh commands when CONFIG_MLX5_EN_RXNFC is disabled Saeed Mahameed
2019-05-17 20:19 ` [net 07/11] net/mlx5e: Fix number of vports for ingress ACL configuration Saeed Mahameed
2019-05-17 20:19 ` Saeed Mahameed [this message]
2019-05-17 20:19 ` [net 09/11] net/mlx5e: Additional check for flow destination comparison Saeed Mahameed
2019-05-17 20:20 ` [net 10/11] net/mlx5e: Fix no rewrite fields with the same match Saeed Mahameed
2019-05-17 20:20 ` [net 11/11] net/mlx5e: Fix possible modify header actions memory leak Saeed Mahameed
2019-05-17 22:19 ` [pull request][net 00/11] Mellanox, mlx5 fixes 2019-05-17 David Miller

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=20190517201910.32216-9-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dmitrolin@mellanox.com \
    --cc=gavi@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=roid@mellanox.com \
    /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;
as well as URLs for NNTP newsgroup(s).