public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback
@ 2025-11-25 10:19 Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 1/8] i40e: extract GRXRINGS from .get_rxnfc Breno Leitao
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

This series migrates Intel network drivers to use the new .get_rx_ring_count()
ethtool callback introduced in commit 84eaf4359c36 ("net: ethtool: add
get_rx_ring_count callback to optimize RX ring queries").

The new callback simplifies the .get_rxnfc() implementation by removing
ETHTOOL_GRXRINGS handling and moving it to a dedicated callback. This provides
a cleaner separation of concerns and aligns these drivers with the modern
ethtool API.

The series updates the following Intel drivers:
  - idpf
  - igb
  - igc
  - ixgbevf
  - fm10k

PS: These changes were compile-tested only.

---
Changes in v2:
- Fixed the kdoc for the new functions (Jakub)
- Fixed a typo in a git summary (Aleksandr Loktionov)
- Appended the SoB in all the patches
- Link to v1: https://patch.msgid.link/20251124-gxring_intel-v1-0-89be18d2a744@debian.org

---
Breno Leitao (8):
      i40e: extract GRXRINGS from .get_rxnfc
      iavf: extract GRXRINGS from .get_rxnfc
      ice: extract GRXRINGS from .get_rxnfc
      idpf: extract GRXRINGS from .get_rxnfc
      igb: extract GRXRINGS from .get_rxnfc
      igc: extract GRXRINGS from .get_rxnfc
      ixgbevf: extract GRXRINGS from .get_rxnfc
      fm10k: extract GRXRINGS from .get_rxnfc

 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 17 +++--------------
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c   | 19 +++++++++++++++----
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c   | 18 ++++++++++++++----
 drivers/net/ethernet/intel/ice/ice_ethtool.c     | 19 +++++++++++++++----
 drivers/net/ethernet/intel/idpf/idpf_ethtool.c   | 23 ++++++++++++++++++++---
 drivers/net/ethernet/intel/igb/igb_ethtool.c     | 12 ++++++++----
 drivers/net/ethernet/intel/igc/igc_ethtool.c     | 11 ++++++++---
 drivers/net/ethernet/intel/ixgbevf/ethtool.c     | 14 +++-----------
 8 files changed, 86 insertions(+), 47 deletions(-)
---
base-commit: e05021a829b834fecbd42b173e55382416571b2c
change-id: 20251124-gxring_intel-e1a94c484b78

Best regards,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 1/8] i40e: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 2/8] iavf: " Breno Leitao
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 86c72596617a..f2c2646ea298 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -3521,6 +3521,20 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,
 	return 0;
 }
 
+/**
+ * i40e_get_rx_ring_count - get RX ring count
+ * @netdev: network interface device structure
+ *
+ * Return: number of RX rings.
+ **/
+static u32 i40e_get_rx_ring_count(struct net_device *netdev)
+{
+	struct i40e_netdev_priv *np = netdev_priv(netdev);
+	struct i40e_vsi *vsi = np->vsi;
+
+	return vsi->rss_size;
+}
+
 /**
  * i40e_get_rxnfc - command to get RX flow classification rules
  * @netdev: network interface device structure
@@ -3538,10 +3552,6 @@ static int i40e_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
 	int ret = -EOPNOTSUPP;
 
 	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = vsi->rss_size;
-		ret = 0;
-		break;
 	case ETHTOOL_GRXCLSRLCNT:
 		cmd->rule_cnt = pf->fdir_pf_active_filters;
 		/* report total rule count */
@@ -5819,6 +5829,7 @@ static const struct ethtool_ops i40e_ethtool_ops = {
 	.set_msglevel		= i40e_set_msglevel,
 	.get_rxnfc		= i40e_get_rxnfc,
 	.set_rxnfc		= i40e_set_rxnfc,
+	.get_rx_ring_count	= i40e_get_rx_ring_count,
 	.self_test		= i40e_diag_test,
 	.get_strings		= i40e_get_strings,
 	.get_eee		= i40e_get_eee,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 2/8] iavf: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 1/8] i40e: extract GRXRINGS from .get_rxnfc Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 3/8] ice: " Breno Leitao
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
index a3f8ced23266..2cc21289a707 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
@@ -1638,6 +1638,19 @@ static int iavf_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
 	return ret;
 }
 
+/**
+ * iavf_get_rx_ring_count - get RX ring count
+ * @netdev: network interface device structure
+ *
+ * Return: number of RX rings.
+ **/
+static u32 iavf_get_rx_ring_count(struct net_device *netdev)
+{
+	struct iavf_adapter *adapter = netdev_priv(netdev);
+
+	return adapter->num_active_queues;
+}
+
 /**
  * iavf_get_rxnfc - command to get RX flow classification rules
  * @netdev: network interface device structure
@@ -1653,10 +1666,6 @@ static int iavf_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
 	int ret = -EOPNOTSUPP;
 
 	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = adapter->num_active_queues;
-		ret = 0;
-		break;
 	case ETHTOOL_GRXCLSRLCNT:
 		if (!(adapter->flags & IAVF_FLAG_FDIR_ENABLED))
 			break;
@@ -1866,6 +1875,7 @@ static const struct ethtool_ops iavf_ethtool_ops = {
 	.set_per_queue_coalesce = iavf_set_per_queue_coalesce,
 	.set_rxnfc		= iavf_set_rxnfc,
 	.get_rxnfc		= iavf_get_rxnfc,
+	.get_rx_ring_count	= iavf_get_rx_ring_count,
 	.get_rxfh_indir_size	= iavf_get_rxfh_indir_size,
 	.get_rxfh		= iavf_get_rxfh,
 	.set_rxfh		= iavf_set_rxfh,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 3/8] ice: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 1/8] i40e: extract GRXRINGS from .get_rxnfc Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 2/8] iavf: " Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 4/8] idpf: " Breno Leitao
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index a1d9abee97e5..969d4f8f9c02 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -3083,6 +3083,20 @@ static int ice_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
 	return -EOPNOTSUPP;
 }
 
+/**
+ * ice_get_rx_ring_count - get RX ring count
+ * @netdev: network interface device structure
+ *
+ * Return: number of RX rings.
+ */
+static u32 ice_get_rx_ring_count(struct net_device *netdev)
+{
+	struct ice_netdev_priv *np = netdev_priv(netdev);
+	struct ice_vsi *vsi = np->vsi;
+
+	return vsi->rss_size;
+}
+
 /**
  * ice_get_rxnfc - command to get Rx flow classification rules
  * @netdev: network interface device structure
@@ -3103,10 +3117,6 @@ ice_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
 	hw = &vsi->back->hw;
 
 	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = vsi->rss_size;
-		ret = 0;
-		break;
 	case ETHTOOL_GRXCLSRLCNT:
 		cmd->rule_cnt = hw->fdir_active_fltr;
 		/* report total rule count */
@@ -4853,6 +4863,7 @@ static const struct ethtool_ops ice_ethtool_ops = {
 	.get_sset_count		= ice_get_sset_count,
 	.get_rxnfc		= ice_get_rxnfc,
 	.set_rxnfc		= ice_set_rxnfc,
+	.get_rx_ring_count	= ice_get_rx_ring_count,
 	.get_ringparam		= ice_get_ringparam,
 	.set_ringparam		= ice_set_ringparam,
 	.nway_reset		= ice_nway_reset,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 4/8] idpf: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
                   ` (2 preceding siblings ...)
  2025-11-25 10:19 ` [PATCH net-next v2 3/8] ice: " Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 5/8] igb: " Breno Leitao
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

I was not totally convinced I needed to have the lock, but, I decided to
be on the safe side and get the exact same behaviour it was before.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
index a5a1eec9ade8..5dd82b1349c5 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
@@ -5,6 +5,25 @@
 #include "idpf_ptp.h"
 #include "idpf_virtchnl.h"
 
+/**
+ * idpf_get_rx_ring_count - get RX ring count
+ * @netdev: network interface device structure
+ *
+ * Return: number of RX rings.
+ */
+static u32 idpf_get_rx_ring_count(struct net_device *netdev)
+{
+	struct idpf_vport *vport;
+	u32 num_rxq;
+
+	idpf_vport_ctrl_lock(netdev);
+	vport = idpf_netdev_to_vport(netdev);
+	num_rxq = vport->num_rxq;
+	idpf_vport_ctrl_unlock(netdev);
+
+	return num_rxq;
+}
+
 /**
  * idpf_get_rxnfc - command to get RX flow classification rules
  * @netdev: network interface device structure
@@ -28,9 +47,6 @@ static int idpf_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
 	user_config = &np->adapter->vport_config[np->vport_idx]->user_config;
 
 	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = vport->num_rxq;
-		break;
 	case ETHTOOL_GRXCLSRLCNT:
 		cmd->rule_cnt = user_config->num_fsteer_fltrs;
 		cmd->data = idpf_fsteer_max_rules(vport);
@@ -1757,6 +1773,7 @@ static const struct ethtool_ops idpf_ethtool_ops = {
 	.get_channels		= idpf_get_channels,
 	.get_rxnfc		= idpf_get_rxnfc,
 	.set_rxnfc		= idpf_set_rxnfc,
+	.get_rx_ring_count	= idpf_get_rx_ring_count,
 	.get_rxfh_key_size	= idpf_get_rxfh_key_size,
 	.get_rxfh_indir_size	= idpf_get_rxfh_indir_size,
 	.get_rxfh		= idpf_get_rxfh,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 5/8] igb: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
                   ` (3 preceding siblings ...)
  2025-11-25 10:19 ` [PATCH net-next v2 4/8] idpf: " Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 6/8] igc: " Breno Leitao
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 6/8] igc: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
                   ` (4 preceding siblings ...)
  2025-11-25 10:19 ` [PATCH net-next v2 5/8] igb: " Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 7/8] ixgbevf: " Breno Leitao
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index bb783042d1af..e94c1922b97a 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1091,15 +1091,19 @@ static int igc_ethtool_get_rxfh_fields(struct net_device *dev,
 	return 0;
 }
 
+static u32 igc_ethtool_get_rx_ring_count(struct net_device *dev)
+{
+	struct igc_adapter *adapter = netdev_priv(dev);
+
+	return adapter->num_rx_queues;
+}
+
 static int igc_ethtool_get_rxnfc(struct net_device *dev,
 				 struct ethtool_rxnfc *cmd, u32 *rule_locs)
 {
 	struct igc_adapter *adapter = netdev_priv(dev);
 
 	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = adapter->num_rx_queues;
-		return 0;
 	case ETHTOOL_GRXCLSRLCNT:
 		cmd->rule_cnt = adapter->nfc_rule_count;
 		return 0;
@@ -2170,6 +2174,7 @@ static const struct ethtool_ops igc_ethtool_ops = {
 	.set_coalesce		= igc_ethtool_set_coalesce,
 	.get_rxnfc		= igc_ethtool_get_rxnfc,
 	.set_rxnfc		= igc_ethtool_set_rxnfc,
+	.get_rx_ring_count	= igc_ethtool_get_rx_ring_count,
 	.get_rxfh_indir_size	= igc_ethtool_get_rxfh_indir_size,
 	.get_rxfh		= igc_ethtool_get_rxfh,
 	.set_rxfh		= igc_ethtool_set_rxfh,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 7/8] ixgbevf: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
                   ` (5 preceding siblings ...)
  2025-11-25 10:19 ` [PATCH net-next v2 6/8] igc: " Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-25 10:19 ` [PATCH net-next v2 8/8] fm10k: " Breno Leitao
  2025-11-27  1:20 ` [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ethtool.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index bebad564188e..537a60d5276f 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -867,19 +867,11 @@ static int ixgbevf_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
-static int ixgbevf_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
-			     u32 *rules __always_unused)
+static u32 ixgbevf_get_rx_ring_count(struct net_device *dev)
 {
 	struct ixgbevf_adapter *adapter = netdev_priv(dev);
 
-	switch (info->cmd) {
-	case ETHTOOL_GRXRINGS:
-		info->data = adapter->num_rx_queues;
-		return 0;
-	default:
-		hw_dbg(&adapter->hw, "Command parameters not supported\n");
-		return -EOPNOTSUPP;
-	}
+	return adapter->num_rx_queues;
 }
 
 static u32 ixgbevf_get_rxfh_indir_size(struct net_device *netdev)
@@ -987,7 +979,7 @@ static const struct ethtool_ops ixgbevf_ethtool_ops = {
 	.get_ethtool_stats	= ixgbevf_get_ethtool_stats,
 	.get_coalesce		= ixgbevf_get_coalesce,
 	.set_coalesce		= ixgbevf_set_coalesce,
-	.get_rxnfc		= ixgbevf_get_rxnfc,
+	.get_rx_ring_count	= ixgbevf_get_rx_ring_count,
 	.get_rxfh_indir_size	= ixgbevf_get_rxfh_indir_size,
 	.get_rxfh_key_size	= ixgbevf_get_rxfh_key_size,
 	.get_rxfh		= ixgbevf_get_rxfh,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next v2 8/8] fm10k: extract GRXRINGS from .get_rxnfc
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
                   ` (6 preceding siblings ...)
  2025-11-25 10:19 ` [PATCH net-next v2 7/8] ixgbevf: " Breno Leitao
@ 2025-11-25 10:19 ` Breno Leitao
  2025-11-27  1:20 ` [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: Breno Leitao @ 2025-11-25 10:19 UTC (permalink / raw)
  To: aleksander.lobakin, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: intel-wired-lan, netdev, linux-kernel, kernel-team, Breno Leitao,
	Aleksandr Loktionov

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

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
index bf2029144c1d..76e42abca965 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -734,22 +734,11 @@ static int fm10k_get_rssh_fields(struct net_device *dev,
 	return 0;
 }
 
-static int fm10k_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
-			   u32 __always_unused *rule_locs)
+static u32 fm10k_get_rx_ring_count(struct net_device *dev)
 {
 	struct fm10k_intfc *interface = netdev_priv(dev);
-	int ret = -EOPNOTSUPP;
 
-	switch (cmd->cmd) {
-	case ETHTOOL_GRXRINGS:
-		cmd->data = interface->num_rx_queues;
-		ret = 0;
-		break;
-	default:
-		break;
-	}
-
-	return ret;
+	return interface->num_rx_queues;
 }
 
 static int fm10k_set_rssh_fields(struct net_device *dev,
@@ -1160,7 +1149,7 @@ static const struct ethtool_ops fm10k_ethtool_ops = {
 	.set_ringparam		= fm10k_set_ringparam,
 	.get_coalesce		= fm10k_get_coalesce,
 	.set_coalesce		= fm10k_set_coalesce,
-	.get_rxnfc		= fm10k_get_rxnfc,
+	.get_rx_ring_count	= fm10k_get_rx_ring_count,
 	.get_regs               = fm10k_get_regs,
 	.get_regs_len           = fm10k_get_regs_len,
 	.self_test		= fm10k_self_test,

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback
  2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
                   ` (7 preceding siblings ...)
  2025-11-25 10:19 ` [PATCH net-next v2 8/8] fm10k: " Breno Leitao
@ 2025-11-27  1:20 ` patchwork-bot+netdevbpf
  8 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-27  1:20 UTC (permalink / raw)
  To: Breno Leitao
  Cc: aleksander.lobakin, anthony.l.nguyen, przemyslaw.kitszel,
	andrew+netdev, davem, edumazet, kuba, pabeni, intel-wired-lan,
	netdev, linux-kernel, kernel-team, aleksandr.loktionov

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 25 Nov 2025 02:19:43 -0800 you wrote:
> This series migrates Intel network drivers to use the new .get_rx_ring_count()
> ethtool callback introduced in commit 84eaf4359c36 ("net: ethtool: add
> get_rx_ring_count callback to optimize RX ring queries").
> 
> The new callback simplifies the .get_rxnfc() implementation by removing
> ETHTOOL_GRXRINGS handling and moving it to a dedicated callback. This provides
> a cleaner separation of concerns and aligns these drivers with the modern
> ethtool API.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/8] i40e: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/a8acbcbaf6d0
  - [net-next,v2,2/8] iavf: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/fe0a3d7d1dca
  - [net-next,v2,3/8] ice: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/8e8c00e1d213
  - [net-next,v2,4/8] idpf: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/873a1942fbc6
  - [net-next,v2,5/8] igb: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/d6c744f46816
  - [net-next,v2,6/8] igc: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/768ce58dddb2
  - [net-next,v2,7/8] ixgbevf: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/3399fd519dd4
  - [net-next,v2,8/8] fm10k: extract GRXRINGS from .get_rxnfc
    https://git.kernel.org/netdev/net-next/c/73d834cd1774

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-11-27  1:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-25 10:19 [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 1/8] i40e: extract GRXRINGS from .get_rxnfc Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 2/8] iavf: " Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 3/8] ice: " Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 4/8] idpf: " Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 5/8] igb: " Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 6/8] igc: " Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 7/8] ixgbevf: " Breno Leitao
2025-11-25 10:19 ` [PATCH net-next v2 8/8] fm10k: " Breno Leitao
2025-11-27  1:20 ` [PATCH net-next v2 0/8] net: intel: migrate to .get_rx_ring_count() ethtool callback patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox