Skip to content

Commit 426849e

Browse files
Niklas Casseldavem330
authored andcommitted
net: stmmac: fix completely hung TX when using TSO
stmmac_tso_allocator can fail to set the Last Descriptor bit on a descriptor that actually was the last descriptor. This happens when the buffer of the last descriptor ends up having a size of exactly TSO_MAX_BUFF_SIZE. When the IP eventually reaches the next last descriptor, which actually has the bit set, the DMA will hang. When the DMA hangs, we get a tx timeout, however, since stmmac does not do a complete reset of the IP in stmmac_tx_timeout, we end up in a state with completely hung TX. Signed-off-by: Niklas Cassel <[email protected]> Acked-by: Giuseppe Cavallaro <[email protected]> Acked-by: Alexandre TORGUE <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d220b94 commit 426849e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2724,7 +2724,7 @@ static void stmmac_tso_allocator(struct stmmac_priv *priv, unsigned int des,
27242724

27252725
priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size,
27262726
0, 1,
2727-
(last_segment) && (buff_size < TSO_MAX_BUFF_SIZE),
2727+
(last_segment) && (tmp_len <= TSO_MAX_BUFF_SIZE),
27282728
0, 0);
27292729

27302730
tmp_len -= TSO_MAX_BUFF_SIZE;

0 commit comments

Comments
 (0)