mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: bnxt: extract GRXRINGS from .get_rxnfc
Commit 84eaf4359c ("net: ethtool: add get_rx_ring_count callback to
optimize RX ring queries") added specific support for GRXRINGS callback,
simplifying .get_rxnfc.
Remove the handling of GRXRINGS in .get_rxnfc() by moving it to the new
.get_rx_ring_count().
This simplifies the RX ring count retrieval and aligns bnxt with the new
ethtool API for querying RX ring parameters.
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251127-grxrings_broadcom-v1-1-b0b182864950@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
2ce992a1a4
commit
bba18f3ba7
@@ -1770,6 +1770,13 @@ static int bnxt_set_rxfh_fields(struct net_device *dev,
|
||||
return rc;
|
||||
}
|
||||
|
||||
static u32 bnxt_get_rx_ring_count(struct net_device *dev)
|
||||
{
|
||||
struct bnxt *bp = netdev_priv(dev);
|
||||
|
||||
return bp->rx_nr_rings;
|
||||
}
|
||||
|
||||
static int bnxt_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
|
||||
u32 *rule_locs)
|
||||
{
|
||||
@@ -1777,10 +1784,6 @@ static int bnxt_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
|
||||
int rc = 0;
|
||||
|
||||
switch (cmd->cmd) {
|
||||
case ETHTOOL_GRXRINGS:
|
||||
cmd->data = bp->rx_nr_rings;
|
||||
break;
|
||||
|
||||
case ETHTOOL_GRXCLSRLCNT:
|
||||
cmd->rule_cnt = bp->ntp_fltr_count;
|
||||
cmd->data = bp->max_fltr | RX_CLS_LOC_SPECIAL;
|
||||
@@ -5616,6 +5619,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
|
||||
.set_channels = bnxt_set_channels,
|
||||
.get_rxnfc = bnxt_get_rxnfc,
|
||||
.set_rxnfc = bnxt_set_rxnfc,
|
||||
.get_rx_ring_count = bnxt_get_rx_ring_count,
|
||||
.get_rxfh_indir_size = bnxt_get_rxfh_indir_size,
|
||||
.get_rxfh_key_size = bnxt_get_rxfh_key_size,
|
||||
.get_rxfh = bnxt_get_rxfh,
|
||||
|
||||
Reference in New Issue
Block a user