Skip to content

Commit 58f2ce6

Browse files
aakoskindavem330
authored andcommitted
net: stmmac: fix jumbo frame sending with non-linear skbs
When sending non-linear skbs with jumbo frames, we set up the non-paged data and mark that as a last segment, although the paged fragments are also prepared. This will stall the TX queue and trigger a watchdog warning (a simple reproducer is to run an iperf client mode TCP test with a large MTU - networking fails instantly). Fix by checking if the skb is non-linear. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Acked-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 80acbed commit 58f2ce6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/net/ethernet/stmicro/stmmac/ring_mode.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
7979

8080
desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
8181
stmmac_prepare_tx_desc(priv, desc, 0, len, csum,
82-
STMMAC_RING_MODE, 1, true, skb->len);
82+
STMMAC_RING_MODE, 1, !skb_is_nonlinear(skb),
83+
skb->len);
8384
} else {
8485
des2 = dma_map_single(priv->device, skb->data,
8586
nopaged_len, DMA_TO_DEVICE);
@@ -91,7 +92,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
9192
tx_q->tx_skbuff_dma[entry].is_jumbo = true;
9293
desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
9394
stmmac_prepare_tx_desc(priv, desc, 1, nopaged_len, csum,
94-
STMMAC_RING_MODE, 0, true, skb->len);
95+
STMMAC_RING_MODE, 0, !skb_is_nonlinear(skb),
96+
skb->len);
9597
}
9698

9799
tx_q->cur_tx = entry;

0 commit comments

Comments
 (0)