mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Breno Leitao <leitao@debian.org>,
	Tariq Toukan <tariqt@nvidia.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>, Leon Romanovsky <leon@kernel.org>
Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH 1/2] mlx4: extract GRXRINGS from .get_rxnfc
Date: Mon, 17 Nov 2025 14:31:04 +0200	[thread overview]
Message-ID: <56b75450-6c51-44f1-ba7b-92688386c4d5@gmail.com> (raw)
In-Reply-To: <20251113-mlx_grxrings-v1-1-0017f2af7dd0@debian.org>



On 13/11/2025 18:46, Breno Leitao wrote:
> Commit 84eaf4359c36 ("net: ethtool: add get_rx_ring_count callback to
> optimize RX ring queries") added specific support for GRXRINGS callback,
> simplifying .get_rxnfc.
> 
> Remove the handling of GRXRINGS in .get_rxnfc() by moving it to the new
> .get_rx_ring_count().
> 
> This simplifies the RX ring count retrieval and aligns mlx4 with the new
> ethtool API for querying RX ring parameters. This is compiled tested
> only.
> 
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>   drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> index a68cd3f0304c..ad6298456639 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
> @@ -1727,6 +1727,13 @@ static int mlx4_en_get_num_flows(struct mlx4_en_priv *priv)
>   
>   }
>   
> +static u32 mlx4_en_get_rx_ring_count(struct net_device *dev)
> +{
> +	struct mlx4_en_priv *priv = netdev_priv(dev);
> +
> +	return priv->rx_ring_num;
> +}
> +
>   static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
>   			     u32 *rule_locs)
>   {
> @@ -1743,9 +1750,6 @@ static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
>   		return -EINVAL;
>   
>   	switch (cmd->cmd) {
> -	case ETHTOOL_GRXRINGS:
> -		cmd->data = priv->rx_ring_num;
> -		break;
>   	case ETHTOOL_GRXCLSRLCNT:
>   		cmd->rule_cnt = mlx4_en_get_num_flows(priv);
>   		break;
> @@ -2154,6 +2158,7 @@ const struct ethtool_ops mlx4_en_ethtool_ops = {
>   	.set_ringparam = mlx4_en_set_ringparam,
>   	.get_rxnfc = mlx4_en_get_rxnfc,
>   	.set_rxnfc = mlx4_en_set_rxnfc,
> +	.get_rx_ring_count = mlx4_en_get_rx_ring_count,
>   	.get_rxfh_indir_size = mlx4_en_get_rxfh_indir_size,
>   	.get_rxfh_key_size = mlx4_en_get_rxfh_key_size,
>   	.get_rxfh = mlx4_en_get_rxfh,
> 

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Thanks.

  reply	other threads:[~2025-11-17 12:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 16:46 [PATCH 0/2] net: mlx: migrate to new get_rx_ring_count ethtool API Breno Leitao
2025-11-13 16:46 ` [PATCH 1/2] mlx4: extract GRXRINGS from .get_rxnfc Breno Leitao
2025-11-17 12:31   ` Tariq Toukan [this message]
2025-11-13 16:46 ` [PATCH 2/2] mlx5: " Breno Leitao
2025-11-17 13:41   ` Tariq Toukan
2025-11-13 16:48 ` [PATCH 0/2] net: mlx: migrate to new get_rx_ring_count ethtool API Breno Leitao
2025-11-14  0:35   ` Jakub Kicinski
2025-11-18  1:00 ` patchwork-bot+netdevbpf

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=56b75450-6c51-44f1-ba7b-92688386c4d5@gmail.com \
    --to=ttoukan.linux@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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

all inboxes | Powered by JetHome®