Skip to content

Commit 6037d6f

Browse files
rohangt07gregkh
authored andcommitted
net: stmmac: Set CIC bit only for TX queues with COE
[ Upstream commit b1eded5 ] 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: 132c32e ("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>
1 parent 62c8b75 commit 6037d6f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,6 +2488,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
24882488
struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
24892489
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
24902490
struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
2491+
bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported;
24912492
struct xsk_buff_pool *pool = tx_q->xsk_pool;
24922493
unsigned int entry = tx_q->cur_tx;
24932494
struct dma_desc *tx_desc = NULL;
@@ -2573,7 +2574,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
25732574
}
25742575

25752576
stmmac_prepare_tx_desc(priv, tx_desc, 1, xdp_desc.len,
2576-
true, priv->mode, true, true,
2577+
csum, priv->mode, true, true,
25772578
xdp_desc.len);
25782579

25792580
stmmac_enable_dma_transmission(priv, priv->ioaddr, queue);
@@ -4902,6 +4903,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
49024903
{
49034904
struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
49044905
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
4906+
bool csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported;
49054907
unsigned int entry = tx_q->cur_tx;
49064908
struct dma_desc *tx_desc;
49074909
dma_addr_t dma_addr;
@@ -4953,7 +4955,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
49534955
stmmac_set_desc_addr(priv, tx_desc, dma_addr);
49544956

49554957
stmmac_prepare_tx_desc(priv, tx_desc, 1, xdpf->len,
4956-
true, priv->mode, true, true,
4958+
csum, priv->mode, true, true,
49574959
xdpf->len);
49584960

49594961
tx_q->tx_count_frames++;

0 commit comments

Comments
 (0)