Re: [PATCH net v3] net: stmmac: fix transmit queue timed out after resume for tso
From: Tao Wang <hidden>
Date: 2026-01-17 07:59:49
Also in:
linux-doc, lkml
From: Tao Wang <hidden>
Date: 2026-01-17 07:59:49
Also in:
linux-doc, lkml
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);