Skip to content

Commit 335d78c

Browse files
leitaokuba-moo
authored andcommitted
net: bcmgenet: extract GRXRINGS from .get_rxnfc
Commit 84eaf43 ("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 bcmgenet with the new ethtool API for querying RX ring parameters. Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20251127-grxrings_broadcom-v1-2-b0b182864950@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent bba18f3 commit 335d78c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,13 @@ static int bcmgenet_get_num_flows(struct bcmgenet_priv *priv)
16401640
return res;
16411641
}
16421642

1643+
static u32 bcmgenet_get_rx_ring_count(struct net_device *dev)
1644+
{
1645+
struct bcmgenet_priv *priv = netdev_priv(dev);
1646+
1647+
return priv->hw_params->rx_queues ?: 1;
1648+
}
1649+
16431650
static int bcmgenet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
16441651
u32 *rule_locs)
16451652
{
@@ -1649,9 +1656,6 @@ static int bcmgenet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
16491656
int i = 0;
16501657

16511658
switch (cmd->cmd) {
1652-
case ETHTOOL_GRXRINGS:
1653-
cmd->data = priv->hw_params->rx_queues ?: 1;
1654-
break;
16551659
case ETHTOOL_GRXCLSRLCNT:
16561660
cmd->rule_cnt = bcmgenet_get_num_flows(priv);
16571661
cmd->data = MAX_NUM_OF_FS_RULES | RX_CLS_LOC_SPECIAL;
@@ -1700,6 +1704,7 @@ static const struct ethtool_ops bcmgenet_ethtool_ops = {
17001704
.get_ts_info = ethtool_op_get_ts_info,
17011705
.get_rxnfc = bcmgenet_get_rxnfc,
17021706
.set_rxnfc = bcmgenet_set_rxnfc,
1707+
.get_rx_ring_count = bcmgenet_get_rx_ring_count,
17031708
.get_pauseparam = bcmgenet_get_pauseparam,
17041709
.set_pauseparam = bcmgenet_set_pauseparam,
17051710
};

0 commit comments

Comments
 (0)