mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: aleksander.lobakin@intel.com,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	 Przemek Kitszel <przemyslaw.kitszel@intel.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>
Cc: michal.swiatkowski@linux.intel.com, michal.kubiak@intel.com,
	 maciej.fijalkowski@intel.com, intel-wired-lan@lists.osuosl.org,
	 netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@meta.com,  Breno Leitao <leitao@debian.org>
Subject: [PATCH net-next 5/8] igb: extract GRXRINGS from .get_rxnfc
Date: Mon, 24 Nov 2025 10:19:09 -0800	[thread overview]
Message-ID: <20251124-gxring_intel-v1-5-89be18d2a744@debian.org> (raw)
In-Reply-To: <20251124-gxring_intel-v1-0-89be18d2a744@debian.org>

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 igb with the new
ethtool API for querying RX ring parameters.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/net/ethernet/intel/igb/igb_ethtool.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 10e2445e0ded..b507576b28b2 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2541,6 +2541,13 @@ static int igb_get_rxfh_fields(struct net_device *dev,
 	return 0;
 }
 
+static u32 igb_get_rx_ring_count(struct net_device *dev)
+{
+	struct igb_adapter *adapter = netdev_priv(dev);
+
+	return adapter->num_rx_queues;
+}
+
 static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
 			 u32 *rule_locs)
 {
@@ -2548,10 +2555,6 @@ static int igb_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
 	int ret = -EOPNOTSUPP;
 
 	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = adapter->num_rx_queues;
-		ret = 0;
-		break;
 	case ETHTOOL_GRXCLSRLCNT:
 		cmd->rule_cnt = adapter->nfc_filter_count;
 		ret = 0;
@@ -3473,6 +3476,7 @@ static const struct ethtool_ops igb_ethtool_ops = {
 	.get_ts_info		= igb_get_ts_info,
 	.get_rxnfc		= igb_get_rxnfc,
 	.set_rxnfc		= igb_set_rxnfc,
+	.get_rx_ring_count	= igb_get_rx_ring_count,
 	.get_eee		= igb_get_eee,
 	.set_eee		= igb_set_eee,
 	.get_module_info	= igb_get_module_info,

-- 
2.47.3


  parent reply	other threads:[~2025-11-24 18:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 18:19 [PATCH net-next 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
2025-11-24 18:19 ` [PATCH net-next 1/8] i40e: extract GRXRINGS from .get_rxnfc Breno Leitao
2025-11-25  3:48   ` Jakub Kicinski
2025-11-25  9:21     ` Breno Leitao
2025-11-25  6:50   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-24 18:19 ` [PATCH net-next 2/8] iavf: " Breno Leitao
2025-11-25  6:50   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-24 18:19 ` [PATCH net-next 3/8] ice: " Breno Leitao
2025-11-25  6:49   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-24 18:19 ` [PATCH net-next 4/8] idpf: " Breno Leitao
2025-11-25  6:48   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-25  9:22     ` Breno Leitao
2025-11-25  6:49   ` Loktionov, Aleksandr
2025-11-24 18:19 ` Breno Leitao [this message]
2025-11-25  6:49   ` [Intel-wired-lan] [PATCH net-next 5/8] igb: " Loktionov, Aleksandr
2025-11-24 18:19 ` [PATCH net-next 6/8] igc: " Breno Leitao
2025-11-25  6:49   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-24 18:19 ` [PATCH net-next 7/8] ixgbevf: " Breno Leitao
2025-11-25  6:48   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-11-24 18:19 ` [PATCH net-next 8/8] fm10k: " Breno Leitao
2025-11-25  6:49   ` [Intel-wired-lan] " Loktionov, Aleksandr

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=20251124-gxring_intel-v1-5-89be18d2a744@debian.org \
    --to=leitao@debian.org \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=michal.kubiak@intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.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®