[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWtt8hlsqWVF1tYz@shell.armlinux.org.uk>
Date: Sat, 17 Jan 2026 11:09:38 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Tao Wang <tao03.wang@...izon.auto>
Cc: alexandre.torgue@...s.st.com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, horms@...nel.org,
kuba@...nel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, maxime.chevallier@...tlin.com,
mcoquelin.stm32@...il.com, netdev@...r.kernel.org,
pabeni@...hat.com
Subject: Re: [PATCH net v3] net: stmmac: fix transmit queue timed out after
resume for tso
On Sat, Jan 17, 2026 at 03:59:22PM +0800, Tao Wang wrote:
> > Rather than using tx_q->tx_skbuff_dma[].last_segment to determine
> > whether the first descriptor entry is the only segment, calculate the
> > number of descriptor entries used. If there is only one descriptor,
> > then the first is also the last, so mark it as such.
>
> This is a good idea. tx_q->tx_skbuff_dma[].last_segment no longer carries
> much meaning and can indeed be removed altogether.
>
> > + is_last_segment = ((tx_q->cur_tx - first_entry) &
> > + (priv->dma_conf.dma_tx_size - 1)) == 1;
>
> Since tx_q->cur_tx may wrap around and become smaller than first_entry,
> the following statement is more concise:
> is_last_segment = (tx_q->cur_tx == first_entry);
That's incorrect. We advance tx_q->cur_tx by at least one by this
point:
first_entry = tx_q->cur_tx;
... fill descriptors ...
/* We've used all descriptors we need for this skb, however,
* advance cur_tx so that it references a fresh descriptor.
* ndo_start_xmit will fill this descriptor the next time it's
* called and stmmac_tx_clean may clean up to this descriptor.
*/
tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx, priv->dma_conf.dma_tx_size);
...
/* If we only have one entry used, then the first entry is the last
* segment.
*/
is_last_segment = ((tx_q->cur_tx - first_entry) &
(priv->dma_conf.dma_tx_size - 1)) == 1;
So, replacing this with a check for tx_q->cur_tx == first_entry
would always be false here, unless we completely filled the ring
with a single TSO.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists