Netdev List
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Or Gerlitz <ogerlitz@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [net-next 08/13] net/mlx5e: Expose ethtool rss key size / indirection table functions
Date: Mon,  1 Oct 2018 11:56:56 -0700	[thread overview]
Message-ID: <20181001185701.2944-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20181001185701.2944-1-saeedm@mellanox.com>

From: Or Gerlitz <ogerlitz@mellanox.com>

Towards enabling RSS for the vport representors, expose the functions for
querying the rss hash key size and indirection table size via ethtool.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en.h     |  2 ++
 .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 16 ++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
index 98390a5b106a..b3bd79833517 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
@@ -951,6 +951,8 @@ int mlx5e_ethtool_get_coalesce(struct mlx5e_priv *priv,
 			       struct ethtool_coalesce *coal);
 int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
 			       struct ethtool_coalesce *coal);
+u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv);
+u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv);
 int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv,
 			      struct ethtool_ts_info *info);
 int mlx5e_ethtool_flash_device(struct mlx5e_priv *priv,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index 8cd338ceb237..33dafd8638b1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -859,18 +859,30 @@ static int mlx5e_set_link_ksettings(struct net_device *netdev,
 	return err;
 }
 
+u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv)
+{
+	return sizeof(priv->channels.params.toeplitz_hash_key);
+}
+
 static u32 mlx5e_get_rxfh_key_size(struct net_device *netdev)
 {
 	struct mlx5e_priv *priv = netdev_priv(netdev);
 
-	return sizeof(priv->channels.params.toeplitz_hash_key);
+	return mlx5e_ethtool_get_rxfh_key_size(priv);
 }
 
-static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
+u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv)
 {
 	return MLX5E_INDIR_RQT_SIZE;
 }
 
+static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev)
+{
+	struct mlx5e_priv *priv = netdev_priv(netdev);
+
+	return mlx5e_ethtool_get_rxfh_indir_size(priv);
+}
+
 static int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
 			  u8 *hfunc)
 {
-- 
2.17.1

  parent reply	other threads:[~2018-10-02  1:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 18:56 [pull request][net-next 00/13] Mellanox, mlx5e updates 2018-10-01 Saeed Mahameed
2018-10-01 18:56 ` [net-next 01/13] net/mlx5e: Ethtool steering, Support masks for l3/l4 filters Saeed Mahameed
2018-10-01 18:56 ` [net-next 02/13] net/mlx5e: Change VF representors' RQ type Saeed Mahameed
2018-10-01 18:56 ` [net-next 03/13] net/mlx5e: Enable stateless offloads for VF representor netdevs Saeed Mahameed
2018-10-01 18:56 ` [net-next 04/13] net/mlx5e: Extract creation of rep's default flow rule Saeed Mahameed
2018-10-01 18:56 ` [net-next 05/13] net/mlx5: E-Switch, Provide flow dest when creating vport rx rule Saeed Mahameed
2018-10-01 18:56 ` [net-next 06/13] net/mlx5e: Provide explicit directive if to create inner indirect tirs Saeed Mahameed
2018-10-01 18:56 ` [net-next 07/13] net/mlx5e: Expose function for building RSS params Saeed Mahameed
2018-10-01 18:56 ` Saeed Mahameed [this message]
2018-10-01 18:56 ` [net-next 09/13] net/mlx5e: Enable multi-queue and RSS for VF representors Saeed Mahameed
2018-10-01 18:56 ` [net-next 10/13] net/mlx5e: Add ethtool control of ring params to " Saeed Mahameed
2018-10-01 18:56 ` [net-next 11/13] net/mlx5e: Enable reporting checksum unnecessary also for L3 packets Saeed Mahameed
2018-10-01 18:57 ` [net-next 12/13] net/mlx5e: Allow reporting of checksum unnecessary Saeed Mahameed
2018-10-01 18:57 ` [net-next 13/13] net/mlx5: Cache the system image guid Saeed Mahameed
2018-10-01 22:49 ` [pull request][net-next 00/13] Mellanox, mlx5e updates 2018-10-01 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=20181001185701.2944-9-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@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