Skip to content

Commit 774268f

Browse files
atenartdavem330
authored andcommitted
net: mvpp2: fix a txq_done race condition
When no Tx IRQ is available, the txq_done() routine (called from tx_done()) shouldn't be called from the polling function, as in such case it is already called in the Tx path thanks to an hrtimer. This mostly occurred when using PPv2.1, as the engine then do not have Tx IRQs. Fixes: edc660f ("net: mvpp2: replace TX coalescing interrupts with hrtimer") Reported-by: Stefan Chulski <[email protected]> Signed-off-by: Antoine Tenart <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 81d0b75 commit 774268f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,10 +3055,12 @@ static int mvpp2_poll(struct napi_struct *napi, int budget)
30553055
cause_rx_tx & ~MVPP2_CAUSE_MISC_SUM_MASK);
30563056
}
30573057

3058-
cause_tx = cause_rx_tx & MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_MASK;
3059-
if (cause_tx) {
3060-
cause_tx >>= MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_OFFSET;
3061-
mvpp2_tx_done(port, cause_tx, qv->sw_thread_id);
3058+
if (port->has_tx_irqs) {
3059+
cause_tx = cause_rx_tx & MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_MASK;
3060+
if (cause_tx) {
3061+
cause_tx >>= MVPP2_CAUSE_TXQ_OCCUP_DESC_ALL_OFFSET;
3062+
mvpp2_tx_done(port, cause_tx, qv->sw_thread_id);
3063+
}
30623064
}
30633065

30643066
/* Process RX packets */

0 commit comments

Comments
 (0)