From 623b213825fdee1a3047774593f2fa2435947756 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:52 -0800 Subject: [PATCH 1/8] net: octeontx2: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-1-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- .../ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c index b6449f0a9e7d..8918be3ce45e 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c @@ -568,6 +568,13 @@ static int otx2_set_coalesce(struct net_device *netdev, return 0; } +static u32 otx2_get_rx_ring_count(struct net_device *dev) +{ + struct otx2_nic *pfvf = netdev_priv(dev); + + return pfvf->hw.rx_queues; +} + static int otx2_get_rss_hash_opts(struct net_device *dev, struct ethtool_rxfh_fields *nfc) { @@ -742,10 +749,6 @@ static int otx2_get_rxnfc(struct net_device *dev, int ret = -EOPNOTSUPP; switch (nfc->cmd) { - case ETHTOOL_GRXRINGS: - nfc->data = pfvf->hw.rx_queues; - ret = 0; - break; case ETHTOOL_GRXCLSRLCNT: if (netif_running(dev) && ntuple) { nfc->rule_cnt = pfvf->flow_cfg->nr_flows; @@ -1344,6 +1347,7 @@ static const struct ethtool_ops otx2_ethtool_ops = { .set_coalesce = otx2_set_coalesce, .get_rxnfc = otx2_get_rxnfc, .set_rxnfc = otx2_set_rxnfc, + .get_rx_ring_count = otx2_get_rx_ring_count, .get_rxfh_key_size = otx2_get_rxfh_key_size, .get_rxfh_indir_size = otx2_get_rxfh_indir_size, .get_rxfh = otx2_get_rxfh, @@ -1462,6 +1466,7 @@ static const struct ethtool_ops otx2vf_ethtool_ops = { .get_channels = otx2_get_channels, .get_rxnfc = otx2_get_rxnfc, .set_rxnfc = otx2_set_rxnfc, + .get_rx_ring_count = otx2_get_rx_ring_count, .get_rxfh_key_size = otx2_get_rxfh_key_size, .get_rxfh_indir_size = otx2_get_rxfh_indir_size, .get_rxfh = otx2_get_rxfh, From 08cbb4a3de08e17df3ad00ad7ee02345cb90dd3d Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:53 -0800 Subject: [PATCH 2/8] net: hinic: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-2-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- .../net/ethernet/huawei/hinic/hinic_ethtool.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c index e9f338e9dbe7..f28528df5aac 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c @@ -1101,22 +1101,11 @@ static int __set_rss_rxfh(struct net_device *netdev, return 0; } -static int hinic_get_rxnfc(struct net_device *netdev, - struct ethtool_rxnfc *cmd, u32 *rule_locs) +static u32 hinic_get_rx_ring_count(struct net_device *netdev) { struct hinic_dev *nic_dev = netdev_priv(netdev); - int err = 0; - switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = nic_dev->num_qps; - break; - default: - err = -EOPNOTSUPP; - break; - } - - return err; + return nic_dev->num_qps; } static int hinic_get_rxfh(struct net_device *netdev, @@ -1779,7 +1768,7 @@ static const struct ethtool_ops hinic_ethtool_ops = { .set_pauseparam = hinic_set_pauseparam, .get_channels = hinic_get_channels, .set_channels = hinic_set_channels, - .get_rxnfc = hinic_get_rxnfc, + .get_rx_ring_count = hinic_get_rx_ring_count, .get_rxfh_key_size = hinic_get_rxfh_key_size, .get_rxfh_indir_size = hinic_get_rxfh_indir_size, .get_rxfh = hinic_get_rxfh, @@ -1812,7 +1801,7 @@ static const struct ethtool_ops hinicvf_ethtool_ops = { .set_per_queue_coalesce = hinic_set_per_queue_coalesce, .get_channels = hinic_get_channels, .set_channels = hinic_set_channels, - .get_rxnfc = hinic_get_rxnfc, + .get_rx_ring_count = hinic_get_rx_ring_count, .get_rxfh_key_size = hinic_get_rxfh_key_size, .get_rxfh_indir_size = hinic_get_rxfh_indir_size, .get_rxfh = hinic_get_rxfh, From 415a9d10d1802123249fffc3a553b8c813a2af88 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:54 -0800 Subject: [PATCH 3/8] net: enic: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-3-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/cisco/enic/enic_ethtool.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c index a50f5dad34d5..471613899ec0 100644 --- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c +++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c @@ -573,6 +573,13 @@ static int enic_get_rx_flow_hash(struct net_device *dev, return 0; } +static u32 enic_get_rx_ring_count(struct net_device *dev) +{ + struct enic *enic = netdev_priv(dev); + + return enic->rq_count; +} + static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, u32 *rule_locs) { @@ -580,9 +587,6 @@ static int enic_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, int ret = 0; switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = enic->rq_count; - break; case ETHTOOL_GRXCLSRLCNT: spin_lock_bh(&enic->rfs_h.lock); cmd->rule_cnt = enic->rfs_h.max - enic->rfs_h.free; @@ -689,6 +693,7 @@ static const struct ethtool_ops enic_ethtool_ops = { .get_coalesce = enic_get_coalesce, .set_coalesce = enic_set_coalesce, .get_rxnfc = enic_get_rxnfc, + .get_rx_ring_count = enic_get_rx_ring_count, .get_rxfh_key_size = enic_get_rxfh_key_size, .get_rxfh = enic_get_rxfh, .set_rxfh = enic_set_rxfh, From 983d4b8ec519bf10cb174b8aefd0257b46cf4396 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:55 -0800 Subject: [PATCH 4/8] net: funeth: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-4-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- .../net/ethernet/fungible/funeth/funeth_ethtool.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/fungible/funeth/funeth_ethtool.c b/drivers/net/ethernet/fungible/funeth/funeth_ethtool.c index 1966dba512f8..106adf7a870f 100644 --- a/drivers/net/ethernet/fungible/funeth/funeth_ethtool.c +++ b/drivers/net/ethernet/fungible/funeth/funeth_ethtool.c @@ -946,17 +946,9 @@ static void fun_get_fec_stats(struct net_device *netdev, #undef TX_STAT #undef FEC_STAT -static int fun_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, - u32 *rule_locs) +static u32 fun_get_rx_ring_count(struct net_device *netdev) { - switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = netdev->real_num_rx_queues; - return 0; - default: - break; - } - return -EOPNOTSUPP; + return netdev->real_num_rx_queues; } static int fun_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info) @@ -1169,8 +1161,8 @@ static const struct ethtool_ops fun_ethtool_ops = { .get_sset_count = fun_get_sset_count, .get_strings = fun_get_strings, .get_ethtool_stats = fun_get_ethtool_stats, - .get_rxnfc = fun_get_rxnfc, .set_rxnfc = fun_set_rxnfc, + .get_rx_ring_count = fun_get_rx_ring_count, .get_rxfh_indir_size = fun_get_rxfh_indir_size, .get_rxfh_key_size = fun_get_rxfh_key_size, .get_rxfh = fun_get_rxfh, From 5baf736ba4f3cd64d3a664c2c5c259375418d424 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:56 -0800 Subject: [PATCH 5/8] net: niu: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-5-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/sun/niu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 893216b0e08d..f035e3bbbef8 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -7302,6 +7302,13 @@ static int niu_get_ethtool_tcam_all(struct niu *np, return ret; } +static u32 niu_get_rx_ring_count(struct net_device *dev) +{ + struct niu *np = netdev_priv(dev); + + return np->num_rx_rings; +} + static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, u32 *rule_locs) { @@ -7309,9 +7316,6 @@ static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, int ret = 0; switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = np->num_rx_rings; - break; case ETHTOOL_GRXCLSRLCNT: cmd->rule_cnt = tcam_get_valid_entry_cnt(np); break; @@ -7928,6 +7932,7 @@ static const struct ethtool_ops niu_ethtool_ops = { .set_phys_id = niu_set_phys_id, .get_rxnfc = niu_get_nfc, .set_rxnfc = niu_set_nfc, + .get_rx_ring_count = niu_get_rx_ring_count, .get_rxfh_fields = niu_get_rxfh_fields, .set_rxfh_fields = niu_set_rxfh_fields, .get_link_ksettings = niu_get_link_ksettings, From a64f302022ba2f7e7b1cc185cbc95b454ae4ae8f Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:57 -0800 Subject: [PATCH 6/8] net: qede: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-6-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c index 23982704273c..647f30a16a94 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c +++ b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c @@ -1199,6 +1199,13 @@ static int qede_get_rxfh_fields(struct net_device *dev, return 0; } +static u32 qede_get_rx_ring_count(struct net_device *dev) +{ + struct qede_dev *edev = netdev_priv(dev); + + return QEDE_RSS_COUNT(edev); +} + static int qede_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, u32 *rule_locs) { @@ -1206,9 +1213,6 @@ static int qede_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, int rc = 0; switch (info->cmd) { - case ETHTOOL_GRXRINGS: - info->data = QEDE_RSS_COUNT(edev); - break; case ETHTOOL_GRXCLSRLCNT: info->rule_cnt = qede_get_arfs_filter_count(edev); info->data = QEDE_RFS_MAX_FLTR; @@ -2289,6 +2293,7 @@ static const struct ethtool_ops qede_ethtool_ops = { .get_sset_count = qede_get_sset_count, .get_rxnfc = qede_get_rxnfc, .set_rxnfc = qede_set_rxnfc, + .get_rx_ring_count = qede_get_rx_ring_count, .get_rxfh_indir_size = qede_get_rxfh_indir_size, .get_rxfh_key_size = qede_get_rxfh_key_size, .get_rxfh = qede_get_rxfh, @@ -2333,6 +2338,7 @@ static const struct ethtool_ops qede_vf_ethtool_ops = { .get_sset_count = qede_get_sset_count, .get_rxnfc = qede_get_rxnfc, .set_rxnfc = qede_set_rxnfc, + .get_rx_ring_count = qede_get_rx_ring_count, .get_rxfh_indir_size = qede_get_rxfh_indir_size, .get_rxfh_key_size = qede_get_rxfh_key_size, .get_rxfh = qede_get_rxfh, From 2103a5ed1b5b83f708da3dd9c2e5c8ddbd3ea7ce Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:58 -0800 Subject: [PATCH 7/8] net: hns: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-7-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c index 60a586a951a0..23b295dedaef 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c @@ -1230,21 +1230,11 @@ hns_set_rss(struct net_device *netdev, struct ethtool_rxfh_param *rxfh, rxfh->indir, rxfh->key, rxfh->hfunc); } -static int hns_get_rxnfc(struct net_device *netdev, - struct ethtool_rxnfc *cmd, - u32 *rule_locs) +static u32 hns_get_rx_ring_count(struct net_device *netdev) { struct hns_nic_priv *priv = netdev_priv(netdev); - switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = priv->ae_handle->q_num; - break; - default: - return -EOPNOTSUPP; - } - - return 0; + return priv->ae_handle->q_num; } static const struct ethtool_ops hns_ethtool_ops = { @@ -1273,7 +1263,7 @@ static const struct ethtool_ops hns_ethtool_ops = { .get_rxfh_indir_size = hns_get_rss_indir_size, .get_rxfh = hns_get_rss, .set_rxfh = hns_set_rss, - .get_rxnfc = hns_get_rxnfc, + .get_rx_ring_count = hns_get_rx_ring_count, .get_link_ksettings = hns_nic_get_link_ksettings, .set_link_ksettings = hns_nic_set_link_ksettings, }; From cf8c4e1f08ec6c5dac24916378b8e006b30582ff Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Fri, 9 Jan 2026 09:40:59 -0800 Subject: [PATCH 8/8] net: hns3: convert to use .get_rx_ring_count Use the newly introduced .get_rx_ring_count ethtool ops callback instead of handling ETHTOOL_GRXRINGS directly in .get_rxnfc(). Signed-off-by: Breno Leitao Link: https://patch.msgid.link/20260109-grxring_big_v1-v1-8-a0f77f732006@debian.org Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index a5eefa28454c..6d746a9fb687 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -988,6 +988,13 @@ static int hns3_get_rxfh_fields(struct net_device *netdev, return -EOPNOTSUPP; } +static u32 hns3_get_rx_ring_count(struct net_device *netdev) +{ + struct hnae3_handle *h = hns3_get_handle(netdev); + + return h->kinfo.num_tqps; +} + static int hns3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd, u32 *rule_locs) @@ -995,9 +1002,6 @@ static int hns3_get_rxnfc(struct net_device *netdev, struct hnae3_handle *h = hns3_get_handle(netdev); switch (cmd->cmd) { - case ETHTOOL_GRXRINGS: - cmd->data = h->kinfo.num_tqps; - return 0; case ETHTOOL_GRXCLSRLCNT: if (h->ae_algo->ops->get_fd_rule_cnt) return h->ae_algo->ops->get_fd_rule_cnt(h, cmd); @@ -2148,6 +2152,7 @@ static const struct ethtool_ops hns3vf_ethtool_ops = { .get_sset_count = hns3_get_sset_count, .get_rxnfc = hns3_get_rxnfc, .set_rxnfc = hns3_set_rxnfc, + .get_rx_ring_count = hns3_get_rx_ring_count, .get_rxfh_key_size = hns3_get_rss_key_size, .get_rxfh_indir_size = hns3_get_rss_indir_size, .get_rxfh = hns3_get_rss, @@ -2187,6 +2192,7 @@ static const struct ethtool_ops hns3_ethtool_ops = { .get_sset_count = hns3_get_sset_count, .get_rxnfc = hns3_get_rxnfc, .set_rxnfc = hns3_set_rxnfc, + .get_rx_ring_count = hns3_get_rx_ring_count, .get_rxfh_key_size = hns3_get_rss_key_size, .get_rxfh_indir_size = hns3_get_rss_indir_size, .get_rxfh = hns3_get_rss,