From nobody Fri Oct 3 21:37:38 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10B5028151E; Mon, 25 Aug 2025 04:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756096630; cv=none; b=DxGZnOyOLbAJ0vXBDK2EHhdZ/pUnHy24p1Wgyh1VBjAoSBDOxTq7JWQ98g3VQWQVjLVl9kEr8zadPZ+1E2jZ94OcQMpn2niTX52HOaLnkc6nydvH2QzEyNz0gZk5mGb7zuDsmj6Ng0V9cqp0hdG270FhzPW1skfTQGKg4xxUV9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756096630; c=relaxed/simple; bh=wwBDo6blRSFBdQltLRz6YF2EM5a8biOLLNX0om5ESo8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VNYpN5togGrRoclL3qWGW0mE+PnPiRhaUDMAMfyWWDps3c5S2IeE947ugHIl4F+Cx9TCJsc0SE23XyQ/XjDhODeMRlBMh38SEanuzxp9jZlNW8qn5R3TngGxAxoYl2VMBzji8jGeRpF7da6fn1RbI9cbX0/TOjKJQk5B++ZPFow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ingqzI70; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ingqzI70" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9EA11C19421; Mon, 25 Aug 2025 04:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756096629; bh=wwBDo6blRSFBdQltLRz6YF2EM5a8biOLLNX0om5ESo8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ingqzI70i6HXHgnFLwoVGatOuF3KLFBApNL2jOz7nyXw3URUo7qLEAapFvxs7HezL UobJM/jjX1HbxOwIZHqs9VoIPGy7RkNqUw8szQwDGBtXnDvP1ySSO1BQa7MymOSbfu gasDZdY50aT3n951/cf2YTgfQq91vIev3QpgUKDoDSOrRezbE6TUC+dlvcorn0vmWM CMYyzuyyNzSIFzHMmvtwnCUof8uveJPsvx7BzJuvCfr4cDddG7BsOMDrP6HPO3o7Dh cCjH+0mjuOdCFsMOEzLWkWlpWWo3i57Nqb1nWCKpTzBJOxRVDsV/G0yngMRJW1e9Nd q2ypFskKkk5pA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C3E6CA0EED; Mon, 25 Aug 2025 04:37:09 +0000 (UTC) From: Rohan G Thomas via B4 Relay Date: Mon, 25 Aug 2025 12:36:54 +0800 Subject: [PATCH net v3 3/3] net: stmmac: Set CIC bit only for TX queues with COE Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250825-xgmac-minor-fixes-v3-3-c225fe4444c0@altera.com> References: <20250825-xgmac-minor-fixes-v3-0-c225fe4444c0@altera.com> In-Reply-To: <20250825-xgmac-minor-fixes-v3-0-c225fe4444c0@altera.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Jose Abreu , Romain Gantois , Serge Semin , Ong Boon Leong Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rohan G Thomas , Matthew Gerlach X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1756096627; l=2589; i=rohan.g.thomas@altera.com; s=20250815; h=from:subject:message-id; bh=ufHiTveJv2qBm24xiMB0gFsw0pu0zMd7hgFCJ9lPQkI=; b=J9xTvnesrv2sisMNAGCxcdrQoTHV2SLh3+3iW7faARF6ra+9ADLML6lJxH36GguS6UndD/PB5 eTShfFdRmoiBgCrCLRf6pVPz270nXnPUja344HDqgLcK5teGx39zsAD X-Developer-Key: i=rohan.g.thomas@altera.com; a=ed25519; pk=5yZXkXswhfUILKAQwoIn7m6uSblwgV5oppxqde4g4TY= X-Endpoint-Received: by B4 Relay for rohan.g.thomas@altera.com/20250815 with auth_id=494 X-Original-From: Rohan G Thomas Reply-To: rohan.g.thomas@altera.com From: Rohan G Thomas 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 Reviewed-by: Matthew Gerlach --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_main.c index fa3d26c285025d01c72cef51add534fc722552b8..143e68639548f390e97b5a8dd09= f3f4af12cec43 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2585,6 +2585,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *pr= iv, u32 queue, u32 budget) struct netdev_queue *nq =3D netdev_get_tx_queue(priv->dev, queue); struct stmmac_tx_queue *tx_q =3D &priv->dma_conf.tx_queue[queue]; struct stmmac_txq_stats *txq_stats =3D &priv->xstats.txq_stats[queue]; + bool csum =3D !priv->plat->tx_queues_cfg[queue].coe_unsupported; struct xsk_buff_pool *pool =3D tx_q->xsk_pool; unsigned int entry =3D tx_q->cur_tx; struct dma_desc *tx_desc =3D NULL; @@ -2672,7 +2673,7 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *pr= iv, u32 queue, u32 budget) } =20 stmmac_prepare_tx_desc(priv, tx_desc, 1, xdp_desc.len, - true, priv->mode, true, true, + csum, priv->mode, true, true, xdp_desc.len); =20 stmmac_enable_dma_transmission(priv, priv->ioaddr, queue); @@ -4987,6 +4988,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *p= riv, int queue, { struct stmmac_txq_stats *txq_stats =3D &priv->xstats.txq_stats[queue]; struct stmmac_tx_queue *tx_q =3D &priv->dma_conf.tx_queue[queue]; + bool csum =3D !priv->plat->tx_queues_cfg[queue].coe_unsupported; unsigned int entry =3D tx_q->cur_tx; struct dma_desc *tx_desc; dma_addr_t dma_addr; @@ -5038,7 +5040,7 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *p= riv, int queue, stmmac_set_desc_addr(priv, tx_desc, dma_addr); =20 stmmac_prepare_tx_desc(priv, tx_desc, 1, xdpf->len, - true, priv->mode, true, true, + csum, priv->mode, true, true, xdpf->len); =20 tx_q->tx_count_frames++; --=20 2.25.1