diff mbox series

[net,02/13] net: stmmac: Omit last desc flag for non-linear jumbos in chain-mode

Message ID 20230313224237.28757-3-Sergey.Semin@baikalelectronics.ru (mailing list archive)
State New, archived
Headers show
Series net: stmmac: Fixes bundle #1 | expand

Commit Message

Serge Semin March 13, 2023, 10:42 p.m. UTC
Indeed similar to the ring mode we need not to set the LS flag in a Tx
DMA descriptor of the last chunk of the linear jumbo-SKB data if it's
supposed to have additional fragments attached. That buffers will be
used to initialized further Tx DMA descriptors later in the common
stmmac_rx() code. The LS flag will be set for the last of them then.

A similar fix has been introduced for the ring-mode in the
commit 58f2ce6f6161 ("net: stmmac: fix jumbo frame sending with
non-linear skbs"). But for some reason it hasn't been done for the
chained descriptors.

Fixes: 58f2ce6f6161 ("net: stmmac: fix jumbo frame sending with non-linear skbs")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
index 2e8744ac6b91..60e4fa5060ce 100644
--- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
+++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
@@ -73,7 +73,8 @@  static int jumbo_frm(void *p, struct sk_buff *skb, int csum)
 			tx_q->tx_skbuff_dma[entry].len = len;
 			/* last descriptor can be set now */
 			stmmac_prepare_tx_desc(priv, desc, 0, len, csum,
-					STMMAC_CHAIN_MODE, 1, true, skb->len);
+					STMMAC_CHAIN_MODE, 1,
+					!skb_is_nonlinear(skb), skb->len);
 			len = 0;
 		}
 	}