Skip to content

Commit c79493c

Browse files
vladimirolteankuba-moo
authored andcommitted
net: enetc: fix aggregate RMON counters not showing the ranges
When running "ethtool -S eno0 --groups rmon" without an explicit "--src emac|pmac" argument, the kernel will not report rx-rmon-etherStatsPkts64to64Octets, rx-rmon-etherStatsPkts65to127Octets, etc. This is because on ETHTOOL_MAC_STATS_SRC_AGGREGATE, we do not populate the "ranges" argument. ocelot_port_get_rmon_stats() does things differently and things work there. I had forgotten to make sure that the code is structured the same way in both drivers, so do that now. Fixes: cf52bd2 ("net: enetc: add support for MAC Merge statistics counters") Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bb765a7 commit c79493c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,7 @@ static const struct ethtool_rmon_hist_range enetc_rmon_ranges[] = {
370370
};
371371

372372
static void enetc_rmon_stats(struct enetc_hw *hw, int mac,
373-
struct ethtool_rmon_stats *s,
374-
const struct ethtool_rmon_hist_range **ranges)
373+
struct ethtool_rmon_stats *s)
375374
{
376375
s->undersize_pkts = enetc_port_rd(hw, ENETC_PM_RUND(mac));
377376
s->oversize_pkts = enetc_port_rd(hw, ENETC_PM_ROVR(mac));
@@ -393,8 +392,6 @@ static void enetc_rmon_stats(struct enetc_hw *hw, int mac,
393392
s->hist_tx[4] = enetc_port_rd(hw, ENETC_PM_T1023(mac));
394393
s->hist_tx[5] = enetc_port_rd(hw, ENETC_PM_T1522(mac));
395394
s->hist_tx[6] = enetc_port_rd(hw, ENETC_PM_T1523X(mac));
396-
397-
*ranges = enetc_rmon_ranges;
398395
}
399396

400397
static void enetc_get_eth_mac_stats(struct net_device *ndev,
@@ -447,13 +444,15 @@ static void enetc_get_rmon_stats(struct net_device *ndev,
447444
struct enetc_hw *hw = &priv->si->hw;
448445
struct enetc_si *si = priv->si;
449446

447+
*ranges = enetc_rmon_ranges;
448+
450449
switch (rmon_stats->src) {
451450
case ETHTOOL_MAC_STATS_SRC_EMAC:
452-
enetc_rmon_stats(hw, 0, rmon_stats, ranges);
451+
enetc_rmon_stats(hw, 0, rmon_stats);
453452
break;
454453
case ETHTOOL_MAC_STATS_SRC_PMAC:
455454
if (si->hw_features & ENETC_SI_F_QBU)
456-
enetc_rmon_stats(hw, 1, rmon_stats, ranges);
455+
enetc_rmon_stats(hw, 1, rmon_stats);
457456
break;
458457
case ETHTOOL_MAC_STATS_SRC_AGGREGATE:
459458
ethtool_aggregate_rmon_stats(ndev, rmon_stats);

0 commit comments

Comments
 (0)