mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
net: tsnep: 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 <leitao@debian.org> Link: https://patch.msgid.link/20260115-grxring_big_v2-v1-2-b3e1b58bced5@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
aa5baafd33
commit
efa375c440
|
|
@ -257,15 +257,19 @@ static int tsnep_ethtool_get_sset_count(struct net_device *netdev, int sset)
|
|||
}
|
||||
}
|
||||
|
||||
static u32 tsnep_ethtool_get_rx_ring_count(struct net_device *netdev)
|
||||
{
|
||||
struct tsnep_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
return adapter->num_rx_queues;
|
||||
}
|
||||
|
||||
static int tsnep_ethtool_get_rxnfc(struct net_device *netdev,
|
||||
struct ethtool_rxnfc *cmd, u32 *rule_locs)
|
||||
{
|
||||
struct tsnep_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
switch (cmd->cmd) {
|
||||
case ETHTOOL_GRXRINGS:
|
||||
cmd->data = adapter->num_rx_queues;
|
||||
return 0;
|
||||
case ETHTOOL_GRXCLSRLCNT:
|
||||
cmd->rule_cnt = adapter->rxnfc_count;
|
||||
cmd->data = adapter->rxnfc_max;
|
||||
|
|
@ -469,6 +473,7 @@ const struct ethtool_ops tsnep_ethtool_ops = {
|
|||
.get_sset_count = tsnep_ethtool_get_sset_count,
|
||||
.get_rxnfc = tsnep_ethtool_get_rxnfc,
|
||||
.set_rxnfc = tsnep_ethtool_set_rxnfc,
|
||||
.get_rx_ring_count = tsnep_ethtool_get_rx_ring_count,
|
||||
.get_channels = tsnep_ethtool_get_channels,
|
||||
.get_ts_info = tsnep_ethtool_get_ts_info,
|
||||
.get_coalesce = tsnep_ethtool_get_coalesce,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user