Skip to content

Commit 9809f2c

Browse files
rohangt07NipaLocal
authored andcommitted
net: stmmac: est: Drop frames causing HLBS error
Drop those frames causing HLBS error to avoid HLBS interrupt flooding and netdev watchdog timeouts due to blocked packets. Also add HLBS frame drops to taprio stats. Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com> Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 5bfabf0 commit 9809f2c

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

drivers/net/ethernet/stmicro/stmmac/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ struct stmmac_extra_stats {
228228
unsigned long mtl_est_btrlm;
229229
unsigned long max_sdu_txq_drop[MTL_MAX_TX_QUEUES];
230230
unsigned long mtl_est_txq_hlbf[MTL_MAX_TX_QUEUES];
231+
unsigned long mtl_est_txq_hlbs[MTL_MAX_TX_QUEUES];
231232
/* per queue statistics */
232233
struct stmmac_txq_stats txq_stats[MTL_MAX_TX_QUEUES];
233234
struct stmmac_rxq_stats rxq_stats[MTL_MAX_RX_QUEUES];

drivers/net/ethernet/stmicro/stmmac/stmmac_est.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static int est_configure(struct stmmac_priv *priv, struct stmmac_est *cfg,
6363
EST_GMAC5_PTOV_SHIFT;
6464
}
6565
if (cfg->enable)
66-
ctrl |= EST_EEST | EST_SSWL;
66+
ctrl |= EST_EEST | EST_SSWL | EST_DFBS;
6767
else
6868
ctrl &= ~EST_EEST;
6969

@@ -109,6 +109,10 @@ static void est_irq_status(struct stmmac_priv *priv, struct net_device *dev,
109109

110110
x->mtl_est_hlbs++;
111111

112+
for (i = 0; i < txqcnt; i++)
113+
if (value & BIT(i))
114+
x->mtl_est_txq_hlbs[i]++;
115+
112116
/* Clear Interrupt */
113117
writel(value, est_addr + EST_SCH_ERR);
114118

@@ -131,10 +135,9 @@ static void est_irq_status(struct stmmac_priv *priv, struct net_device *dev,
131135

132136
x->mtl_est_hlbf++;
133137

134-
for (i = 0; i < txqcnt; i++) {
138+
for (i = 0; i < txqcnt; i++)
135139
if (feqn & BIT(i))
136140
x->mtl_est_txq_hlbf[i]++;
137-
}
138141

139142
/* Clear Interrupt */
140143
writel(feqn, est_addr + EST_FRM_SZ_ERR);

drivers/net/ethernet/stmicro/stmmac/stmmac_est.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define EST_XGMAC_PTOV_MUL 9
1717
#define EST_SSWL BIT(1)
1818
#define EST_EEST BIT(0)
19+
#define EST_DFBS BIT(5)
1920

2021
#define EST_STATUS 0x00000008
2122
#define EST_GMAC5_BTRL GENMASK(11, 8)

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ static int tc_taprio_configure(struct stmmac_priv *priv,
10801080
for (i = 0; i < priv->plat->tx_queues_to_use; i++) {
10811081
priv->xstats.max_sdu_txq_drop[i] = 0;
10821082
priv->xstats.mtl_est_txq_hlbf[i] = 0;
1083+
priv->xstats.mtl_est_txq_hlbs[i] = 0;
10831084
}
10841085
mutex_unlock(&priv->est_lock);
10851086
}
@@ -1097,7 +1098,8 @@ static void tc_taprio_stats(struct stmmac_priv *priv,
10971098

10981099
for (i = 0; i < priv->plat->tx_queues_to_use; i++)
10991100
window_drops += priv->xstats.max_sdu_txq_drop[i] +
1100-
priv->xstats.mtl_est_txq_hlbf[i];
1101+
priv->xstats.mtl_est_txq_hlbf[i] +
1102+
priv->xstats.mtl_est_txq_hlbs[i];
11011103
qopt->stats.window_drops = window_drops;
11021104

11031105
/* Transmission overrun doesn't happen for stmmac, hence always 0 */
@@ -1111,7 +1113,8 @@ static void tc_taprio_queue_stats(struct stmmac_priv *priv,
11111113
int queue = qopt->queue_stats.queue;
11121114

11131115
q_stats->stats.window_drops = priv->xstats.max_sdu_txq_drop[queue] +
1114-
priv->xstats.mtl_est_txq_hlbf[queue];
1116+
priv->xstats.mtl_est_txq_hlbf[queue] +
1117+
priv->xstats.mtl_est_txq_hlbs[queue];
11151118

11161119
/* Transmission overrun doesn't happen for stmmac, hence always 0 */
11171120
q_stats->stats.tx_overruns = 0;

0 commit comments

Comments
 (0)