Skip to content

Commit b2dec11

Browse files
soniczdavem330
authored andcommitted
stmmac: DMA threshold mode or SF mode can be different among multiple device instance
- In tx_hard_error_bump_tc interrupt, tc should be bumped only when current device instance is in DMA threshold mode. Check per device xstats.threshold other than global tc. - Set per device xstats.threshold to SF_DMA_MODE when current device instance is set to SF mode. v2-changes: - fix ident style Signed-off-by: Sonic Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3051fa6 commit b2dec11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
12881288
* that needs to not insert csum in the TDES.
12891289
*/
12901290
priv->hw->dma->dma_mode(priv->ioaddr, SF_DMA_MODE, SF_DMA_MODE);
1291-
tc = SF_DMA_MODE;
1291+
priv->xstats.threshold = SF_DMA_MODE;
12921292
} else
12931293
priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE);
12941294
}
@@ -1452,7 +1452,8 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)
14521452
}
14531453
if (unlikely(status & tx_hard_error_bump_tc)) {
14541454
/* Try to bump up the dma threshold on this failure */
1455-
if (unlikely(tc != SF_DMA_MODE) && (tc <= 256)) {
1455+
if (unlikely(priv->xstats.threshold != SF_DMA_MODE) &&
1456+
(tc <= 256)) {
14561457
tc += 64;
14571458
if (priv->plat->force_thresh_dma_mode)
14581459
priv->hw->dma->dma_mode(priv->ioaddr, tc, tc);

0 commit comments

Comments
 (0)