[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190315103532.6303-2-aaro.koskinen@iki.fi>
Date: Fri, 15 Mar 2019 12:35:32 +0200
From: Aaro Koskinen <aaro.koskinen@....fi>
To: "David S. Miller" <davem@...emloft.net>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...com>,
Jose Abreu <joabreu@...opsys.com>,
Thor Thayer <thor.thayer@...ux.intel.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Aaro Koskinen <aaro.koskinen@...ia.com>
Subject: [PATCH v2 2/2] net: stmmac: fix jumbo frame sending with non-linear skbs
From: Aaro Koskinen <aaro.koskinen@...ia.com>
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@...ia.com>
Acked-by: Jose Abreu <joabreu@...opsys.com>
---
v2: Add Acked-by.
v1: https://patchwork.ozlabs.org/patch/1056685/
drivers/net/ethernet/stmicro/stmmac/ring_mode.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
index bc83ced94e1b..f936166d8910 100644
--- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
@@ -79,7 +79,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
stmmac_prepare_tx_desc(priv, desc, 0, len, csum,
- STMMAC_RING_MODE, 1, true, skb->len);
+ STMMAC_RING_MODE, 1, !skb_is_nonlinear(skb),
+ skb->len);
} else {
des2 = dma_map_single(priv->device, skb->data,
nopaged_len, DMA_TO_DEVICE);
@@ -91,7 +92,8 @@ static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
tx_q->tx_skbuff_dma[entry].is_jumbo = true;
desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB);
stmmac_prepare_tx_desc(priv, desc, 1, nopaged_len, csum,
- STMMAC_RING_MODE, 0, true, skb->len);
+ STMMAC_RING_MODE, 0, !skb_is_nonlinear(skb),
+ skb->len);
}
tx_q->cur_tx = entry;
--
2.17.0
Powered by blists - more mailing lists