Skip to content

Commit f1e668d

Browse files
vladimirolteandavem330
authored andcommitted
net: enetc: reset taprio stats when taprio is deleted
Currently, the window_drop stats persist even if an incorrect Qdisc was removed from the interface and a new one is installed. This is because the enetc driver keeps the state, and that is persistent across multiple Qdiscs. To resolve the issue, clear all win_drop counters from all TX queues when the currently active Qdisc is removed. These counters are zero by default. The counters visible in ethtool -S are also affected, but I don't care very much about preserving those enough to keep them monotonically incrementing. Fixes: 4802fca ("net: enetc: report statistics counters for taprio") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2b84960 commit f1e668d

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ static int enetc_setup_taprio(struct enetc_ndev_priv *priv,
127127
return 0;
128128
}
129129

130+
static void enetc_reset_taprio_stats(struct enetc_ndev_priv *priv)
131+
{
132+
int i;
133+
134+
for (i = 0; i < priv->num_tx_rings; i++)
135+
priv->tx_ring[i]->stats.win_drop = 0;
136+
}
137+
130138
static void enetc_reset_taprio(struct enetc_ndev_priv *priv)
131139
{
132140
struct enetc_hw *hw = &priv->si->hw;
@@ -145,6 +153,7 @@ static void enetc_taprio_destroy(struct net_device *ndev)
145153

146154
enetc_reset_taprio(priv);
147155
enetc_reset_tc_mqprio(ndev);
156+
enetc_reset_taprio_stats(priv);
148157
}
149158

150159
static void enetc_taprio_stats(struct net_device *ndev,

0 commit comments

Comments
 (0)