[PATCH net 02/13] net: stmmac: Omit last desc flag for non-linear jumbos in chain-mode
From: Serge Semin
Date: Mon Mar 13 2023 - 18:43:06 EST
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@xxxxxxxxxxxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
}
}
--
2.39.2