]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: helpers for filling tx_q->tx_skbuff_dma
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 14 Mar 2026 09:42:30 +0000 (09:42 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Mar 2026 03:32:07 +0000 (20:32 -0700)
commita4b1590ee0f09b20cc8551b0c81f38e4739e93f2
tree9d81e9d27a5be7fbf1aba1db1a7d2864c6cc74ad
parent12b4b16c0c7ed6a4b98cfbec7c4ee69e94973334
net: stmmac: helpers for filling tx_q->tx_skbuff_dma

Add helpers to fill in the transmit queue metadata to ensure that all
entries are initialised when preparing to transmit. This avoids clean
up code running into surprises.

For example, stmmac_clean_desc3() (which calls clean_desc3() in
chain_mode.c or ring_mode.c) looks at the .last_segment, and in the
latter case, .is_jumbo members.

AI believes that there is a missing .buf_type assignment in
stmmac_tso_xmit(), but this is a mis-analysis. AI believes that
stmmac_tso_allocator() which would increment tx_q->cur_tx will be
called within the loop when nfrags is zero, but it's failing to
realise that none of the code within the for() loop will be
executed. In any case, at the point where the loop exits,
tx_q->tx_skbuff_dma[tx_q->cur_tx].buf_type has been correctly set
via the call to stmmac_set_tx_skb_dma_entry() - either the one
before the loop, or the one at the end of the loop block.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1w1LVu-0000000DGRr-0Ni3@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c