Commit 46f4ad55 authored by Breno Leitao's avatar Breno Leitao Committed by Jakub Kicinski
Browse files

net: nfp: 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().

Reviewed-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Reviewed-by: default avatarBrett Creeley <brett.creeley@amd.com>
Link: https://patch.msgid.link/20260122-grxring_big_v4-v2-3-94dbe4dcaa10@debian.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 489a5b81
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1435,15 +1435,19 @@ static int nfp_net_get_fs_loc(struct nfp_net *nn, u32 *rule_locs)
	return 0;
}

static u32 nfp_net_get_rx_ring_count(struct net_device *netdev)
{
	struct nfp_net *nn = netdev_priv(netdev);

	return nn->dp.num_rx_rings;
}

static int nfp_net_get_rxnfc(struct net_device *netdev,
			     struct ethtool_rxnfc *cmd, u32 *rule_locs)
{
	struct nfp_net *nn = netdev_priv(netdev);

	switch (cmd->cmd) {
	case ETHTOOL_GRXRINGS:
		cmd->data = nn->dp.num_rx_rings;
		return 0;
	case ETHTOOL_GRXCLSRLCNT:
		cmd->rule_cnt = nn->fs.count;
		return 0;
@@ -2501,6 +2505,7 @@ static const struct ethtool_ops nfp_net_ethtool_ops = {
	.get_sset_count		= nfp_net_get_sset_count,
	.get_rxnfc		= nfp_net_get_rxnfc,
	.set_rxnfc		= nfp_net_set_rxnfc,
	.get_rx_ring_count	= nfp_net_get_rx_ring_count,
	.get_rxfh_indir_size	= nfp_net_get_rxfh_indir_size,
	.get_rxfh_key_size	= nfp_net_get_rxfh_key_size,
	.get_rxfh		= nfp_net_get_rxfh,