Skip to content

Commit 90490ef

Browse files
BryanW11731-MCHPdavem330
authored andcommitted
lan743x: Fix TX Stall Issue
It has been observed that tx queue stalls while downloading from certain web sites (example www.speedtest.net) The cause has been tracked down to a corner case where dma descriptors where not setup properly. And there for a tx completion interrupt was not signaled. This fix corrects the problem by properly marking the end of a multi descriptor transmission. Fixes: 23f0703 ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Bryan Whitehead <Bryan.Whitehead@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d25ed41 commit 90490ef

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drivers/net/ethernet/microchip/lan743x_main.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,8 @@ static int lan743x_tx_frame_start(struct lan743x_tx *tx,
14001400
}
14011401

14021402
static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,
1403-
unsigned int frame_length)
1403+
unsigned int frame_length,
1404+
int nr_frags)
14041405
{
14051406
/* called only from within lan743x_tx_xmit_frame.
14061407
* assuming tx->ring_lock has already been acquired.
@@ -1410,6 +1411,10 @@ static void lan743x_tx_frame_add_lso(struct lan743x_tx *tx,
14101411

14111412
/* wrap up previous descriptor */
14121413
tx->frame_data0 |= TX_DESC_DATA0_EXT_;
1414+
if (nr_frags <= 0) {
1415+
tx->frame_data0 |= TX_DESC_DATA0_LS_;
1416+
tx->frame_data0 |= TX_DESC_DATA0_IOC_;
1417+
}
14131418
tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail];
14141419
tx_descriptor->data0 = tx->frame_data0;
14151420

@@ -1514,8 +1519,11 @@ static void lan743x_tx_frame_end(struct lan743x_tx *tx,
15141519
u32 tx_tail_flags = 0;
15151520

15161521
/* wrap up previous descriptor */
1517-
tx->frame_data0 |= TX_DESC_DATA0_LS_;
1518-
tx->frame_data0 |= TX_DESC_DATA0_IOC_;
1522+
if ((tx->frame_data0 & TX_DESC_DATA0_DTYPE_MASK_) ==
1523+
TX_DESC_DATA0_DTYPE_DATA_) {
1524+
tx->frame_data0 |= TX_DESC_DATA0_LS_;
1525+
tx->frame_data0 |= TX_DESC_DATA0_IOC_;
1526+
}
15191527

15201528
tx_descriptor = &tx->ring_cpu_ptr[tx->frame_tail];
15211529
buffer_info = &tx->buffer_info[tx->frame_tail];
@@ -1600,7 +1608,7 @@ static netdev_tx_t lan743x_tx_xmit_frame(struct lan743x_tx *tx,
16001608
}
16011609

16021610
if (gso)
1603-
lan743x_tx_frame_add_lso(tx, frame_length);
1611+
lan743x_tx_frame_add_lso(tx, frame_length, nr_frags);
16041612

16051613
if (nr_frags <= 0)
16061614
goto finish;

0 commit comments

Comments
 (0)