]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: move first xmit descriptor SARC and TBS config
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 20 Mar 2026 16:47:17 +0000 (16:47 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 24 Mar 2026 11:08:25 +0000 (12:08 +0100)
Move the first transmit descriptor's SARC and TBS configuration
alongside the code which populates the first descriptor, which helps
to keep all the code specific to that descriptor together.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1w3d0H-0000000DfLp-0gIx@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 fb9719820b93d2d5beeaeb84dfd68e9cf563307f..8741513b152db5c4bdfe13374cfdda70862595a1 100644 (file)
@@ -4792,6 +4792,16 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
                                       0, last_segment, skb->len);
        }
 
+       if (priv->sarc_type)
+               stmmac_set_desc_sarc(priv, first_desc, priv->sarc_type);
+
+       if (tx_q->tbs & STMMAC_TBS_EN) {
+               struct timespec64 ts = ns_to_timespec64(skb->tstamp);
+
+               tbs_desc = &tx_q->dma_entx[first_entry];
+               stmmac_set_desc_tbs(priv, tbs_desc, ts.tv_sec, ts.tv_nsec);
+       }
+
        for (i = 0; i < nfrags; i++) {
                const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
                unsigned int frag_size = skb_frag_size(frag);
@@ -4878,16 +4888,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
                u64_stats_inc(&txq_stats->q.tx_set_ic_bit);
        u64_stats_update_end(&txq_stats->q_syncp);
 
-       if (priv->sarc_type)
-               stmmac_set_desc_sarc(priv, first_desc, priv->sarc_type);
-
-       if (tx_q->tbs & STMMAC_TBS_EN) {
-               struct timespec64 ts = ns_to_timespec64(skb->tstamp);
-
-               tbs_desc = &tx_q->dma_entx[first_entry];
-               stmmac_set_desc_tbs(priv, tbs_desc, ts.tv_sec, ts.tv_nsec);
-       }
-
        /* Set the OWN bit on the first descriptor now that all descriptors
         * for this skb are populated.
         */