]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: Set CIC bit only for TX queues with COE
authorRohan G Thomas <rohan.g.thomas@altera.com>
Mon, 25 Aug 2025 04:36:54 +0000 (12:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Sep 2025 13:30:25 +0000 (15:30 +0200)
[ Upstream commit b1eded580ab28119de0b0f21efe37ee2b4419144 ]

Currently, in the AF_XDP transmit paths, the CIC bit of
TX Desc3 is set for all packets. Setting this bit for
packets transmitting through queues that don't support
checksum offloading causes the TX DMA to get stuck after
transmitting some packets. This patch ensures the CIC bit
of TX Desc3 is set only if the TX queue supports checksum
offloading.

Fixes: 132c32ee5bc0 ("net: stmmac: Add TX via XDP zero-copy socket")
Signed-off-by: Rohan G Thomas <rohan.g.thomas@altera.com>
Reviewed-by: Matthew Gerlach <matthew.gerlach@altera.com>
Link: https://patch.msgid.link/20250825-xgmac-minor-fixes-v3-3-c225fe4444c0@altera.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index fa8ee0624f2f22d0a49596ce4cfb5a4bc734c792..ff5389a8efc33a08c1abd7aa32b02d0e037d9027 100644 (file)
@@ -2426,6 +2426,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
        struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
        struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
        struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
+       bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported;
        struct xsk_buff_pool *pool = tx_q->xsk_pool;
        unsigned int entry = tx_q->cur_tx;
        struct dma_desc *tx_desc = NULL;
@@ -2496,7 +2497,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
                }
 
                stmmac_prepare_tx_desc(priv, tx_desc, 1, xdp_desc.len,
-                                      true, priv->mode, true, true,
+                                      csum, priv->mode, true, true,
                                       xdp_desc.len);
 
                stmmac_enable_dma_transmission(priv, priv->ioaddr);
@@ -4789,6 +4790,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
 {
        struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
        struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
+       bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported;
        unsigned int entry = tx_q->cur_tx;
        struct dma_desc *tx_desc;
        dma_addr_t dma_addr;
@@ -4833,7 +4835,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
        stmmac_set_desc_addr(priv, tx_desc, dma_addr);
 
        stmmac_prepare_tx_desc(priv, tx_desc, 1, xdpf->len,
-                              true, priv->mode, true, true,
+                              csum, priv->mode, true, true,
                               xdpf->len);
 
        tx_q->tx_count_frames++;