]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: move stmmac_xmit() first entry index code
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 20 Mar 2026 16:47:22 +0000 (16:47 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 24 Mar 2026 11:08:25 +0000 (12:08 +0100)
The handling of the first descriptor index/pointer is split around
the checksum handling which makes no sense. Group this code together.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1w3d0M-0000000DfLv-1C6S@rmk-PC.armlinux.org.uk
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 8741513b152db5c4bdfe13374cfdda70862595a1..84de1134d5817afd311a58d48852ee4689988a40 100644 (file)
@@ -4728,10 +4728,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Check if VLAN can be inserted by HW */
        has_vlan = stmmac_vlan_insert(priv, skb, tx_q);
 
-       entry = tx_q->cur_tx;
-       first_entry = entry;
-       WARN_ON(tx_q->tx_skbuff[first_entry]);
-
        csum_insertion = (skb->ip_summed == CHECKSUM_PARTIAL);
        /* DWMAC IPs can be synthesized to support tx coe only for a few tx
         * queues. In that case, checksum offloading for those queues that don't
@@ -4748,6 +4744,10 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
                csum_insertion = !csum_insertion;
        }
 
+       entry = tx_q->cur_tx;
+       first_entry = entry;
+       WARN_ON(tx_q->tx_skbuff[first_entry]);
+
        desc = stmmac_get_tx_desc(priv, tx_q, entry);
        first_desc = desc;