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

net: sfc: falcon: 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: 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-9-94dbe4dcaa10@debian.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c9e4688b
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -974,6 +974,13 @@ ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
	return 0;
}

static u32 ef4_ethtool_get_rx_ring_count(struct net_device *net_dev)
{
	struct ef4_nic *efx = netdev_priv(net_dev);

	return efx->n_rx_channels;
}

static int
ef4_ethtool_get_rxnfc(struct net_device *net_dev,
		      struct ethtool_rxnfc *info, u32 *rule_locs)
@@ -981,10 +988,6 @@ ef4_ethtool_get_rxnfc(struct net_device *net_dev,
	struct ef4_nic *efx = netdev_priv(net_dev);

	switch (info->cmd) {
	case ETHTOOL_GRXRINGS:
		info->data = efx->n_rx_channels;
		return 0;

	case ETHTOOL_GRXCLSRLCNT:
		info->data = ef4_filter_get_rx_id_limit(efx);
		if (info->data == 0)
@@ -1348,6 +1351,7 @@ const struct ethtool_ops ef4_ethtool_ops = {
	.reset			= ef4_ethtool_reset,
	.get_rxnfc		= ef4_ethtool_get_rxnfc,
	.set_rxnfc		= ef4_ethtool_set_rxnfc,
	.get_rx_ring_count	= ef4_ethtool_get_rx_ring_count,
	.get_rxfh_indir_size	= ef4_ethtool_get_rxfh_indir_size,
	.get_rxfh		= ef4_ethtool_get_rxfh,
	.set_rxfh		= ef4_ethtool_set_rxfh,