net: thunder: convert to use .get_rx_ring_count
Convert the Cavium Thunder NIC VF driver to use the new .get_rx_ring_count ethtool operation instead of implementing .get_rxnfc solely for handling ETHTOOL_GRXRINGS command. This simplifies the code by removing the switch statement and replacing it with a direct return of the queue count. The new callback provides the same functionality in a more direct way, following the ongoing ethtool API modernization. Signed-off-by: Breno Leitao <leitao@debian.org> Link: https://patch.msgid.link/20251126-gxring_cavium-v1-1-a066c0c9e0c6@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>pull/1354/merge
parent
8048168df5
commit
73880e66b7
|
|
@ -541,21 +541,11 @@ static int nicvf_get_rxfh_fields(struct net_device *dev,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nicvf_get_rxnfc(struct net_device *dev,
|
static u32 nicvf_get_rx_ring_count(struct net_device *dev)
|
||||||
struct ethtool_rxnfc *info, u32 *rules)
|
|
||||||
{
|
{
|
||||||
struct nicvf *nic = netdev_priv(dev);
|
struct nicvf *nic = netdev_priv(dev);
|
||||||
int ret = -EOPNOTSUPP;
|
|
||||||
|
|
||||||
switch (info->cmd) {
|
return nic->rx_queues;
|
||||||
case ETHTOOL_GRXRINGS:
|
|
||||||
info->data = nic->rx_queues;
|
|
||||||
ret = 0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int nicvf_set_rxfh_fields(struct net_device *dev,
|
static int nicvf_set_rxfh_fields(struct net_device *dev,
|
||||||
|
|
@ -861,7 +851,7 @@ static const struct ethtool_ops nicvf_ethtool_ops = {
|
||||||
.get_coalesce = nicvf_get_coalesce,
|
.get_coalesce = nicvf_get_coalesce,
|
||||||
.get_ringparam = nicvf_get_ringparam,
|
.get_ringparam = nicvf_get_ringparam,
|
||||||
.set_ringparam = nicvf_set_ringparam,
|
.set_ringparam = nicvf_set_ringparam,
|
||||||
.get_rxnfc = nicvf_get_rxnfc,
|
.get_rx_ring_count = nicvf_get_rx_ring_count,
|
||||||
.get_rxfh_key_size = nicvf_get_rxfh_key_size,
|
.get_rxfh_key_size = nicvf_get_rxfh_key_size,
|
||||||
.get_rxfh_indir_size = nicvf_get_rxfh_indir_size,
|
.get_rxfh_indir_size = nicvf_get_rxfh_indir_size,
|
||||||
.get_rxfh = nicvf_get_rxfh,
|
.get_rxfh = nicvf_get_rxfh,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue