[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_22959DC8315158E23D77C14B9B33C97EA60A@qq.com>
Date: Mon, 1 Dec 2025 10:57:01 +0800
From: 2694439648@...com
To: andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com,
hailong.fan@...ngine.com
Cc: netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
inux-kernel@...r.kernel.org
Subject: [PATCH] net: stmmac: Modify the judgment condition of "tx_avail" from 1 to 2
From: "hailong.fan" <hailong.fan@...ngine.com>
Under certain conditions, a WARN_ON will be triggered
if avail equals 1.
For example, when a VLAN packet is to send,
stmmac_vlan_insert consumes one unit of space,
and the data itself consumes another.
actually requiring 2 units of space in total.
Signed-off-by: hailong.fan <hailong.fan@...ngine.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 7b90ecd3a..b575384cd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4529,7 +4529,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
}
}
- if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) {
+ if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 2)) {
if (!netif_tx_queue_stopped(netdev_get_tx_queue(dev, queue))) {
netif_tx_stop_queue(netdev_get_tx_queue(priv->dev,
queue));
--
2.34.1
Powered by blists - more mailing lists