mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
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: Subbaraya Sundeep <sbhatta@marvell.com> Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Link: https://patch.msgid.link/20260122-grxring_big_v4-v2-3-94dbe4dcaa10@debian.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
489a5b81ab
commit
46f4ad5560
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user