Netdev List
 help / color / mirror / Atom feed
From: Gal Pressman <galp@mellanox.com>
To: netdev@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	Vidya Sagar Ravipati <vidya@cumulusnetworks.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Cc: David Decotigny <decot@googlers.com>,
	Ben Hutchings <ben@decadent.org.uk>,
	Gal Pressman <galp@mellanox.com>
Subject: [PATCH RFC 2/2] net/mlx5e: Add support for ethtool get actual speed callback
Date: Wed,  2 Nov 2016 17:35:14 +0200	[thread overview]
Message-ID: <1478100914-23610-3-git-send-email-galp@mellanox.com> (raw)
In-Reply-To: <1478100914-23610-1-git-send-email-galp@mellanox.com>

ethtool DEVNAME will now show actual port speed in addition
to physical port speed.

Signed-off-by: Gal Pressman <galp@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 27ff401..933b687 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1504,9 +1504,16 @@ static int mlx5e_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
 	return err;
 }
 
+static int mlx5e_get_actual_speed(struct net_device *netdev)
+{
+	/* TODO: FW command to query the actual speed */
+	return SPEED_25000;
+}
+
 const struct ethtool_ops mlx5e_ethtool_ops = {
 	.get_drvinfo       = mlx5e_get_drvinfo,
 	.get_link          = ethtool_op_get_link,
+	.get_actual_speed  = mlx5e_get_actual_speed,
 	.get_strings       = mlx5e_get_strings,
 	.get_sset_count    = mlx5e_get_sset_count,
 	.get_ethtool_stats = mlx5e_get_ethtool_stats,
-- 
2.7.4

  parent reply	other threads:[~2016-11-02 15:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 15:35 [PATCH RFC 0/2] ethtool: Add actual port speed reporting Gal Pressman
2016-11-02 15:35 ` [PATCH RFC 1/2] ethtool: Add get actual port speed Gal Pressman
2016-11-02 15:35 ` Gal Pressman [this message]
2016-11-02 15:50 ` [PATCH RFC 0/2] ethtool: Add actual port speed reporting Mintz, Yuval
2016-11-03 16:59   ` Gal Pressman
2016-11-03 17:09     ` Rick Jones
2016-11-09  9:32   ` Saeed Mahameed
2016-11-03  7:02 ` Or Gerlitz

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=1478100914-23610-3-git-send-email-galp@mellanox.com \
    --to=galp@mellanox.com \
    --cc=ben@decadent.org.uk \
    --cc=decot@googlers.com \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=vidya@cumulusnetworks.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