[PATCH net-next 3/3] net: stmmac: Set CIC bit only for TX queues with COE
G Thomas, Rohan
rohan.g.thomas at altera.com
Tue Jul 15 06:44:21 PDT 2025
Hi Simon,
Thanks for reviewing the patch.
On 7/14/2025 7:10 PM, Simon Horman wrote:
> On Mon, Jul 14, 2025 at 03:59:19PM +0800, Rohan G Thomas via B4 Relay wrote:
>> From: Rohan G Thomas <rohan.g.thomas at altera.com>
>>
>> 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.
>>
>> Signed-off-by: Rohan G Thomas <rohan.g.thomas at altera.com>
>> Reviewed-by: Matthew Gerlach <matthew.gerlach at altera.com>
>
> Hi Rohan,
>
> I notice that stmmac_xmit() handles a few other cases where
> checksum offload should not be requested via stmmac_prepare_tx_desc:
>
> 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
> * support tx coe needs to fallback to software checksum calculation.
> *
> * Packets that won't trigger the COE e.g. most DSA-tagged packets will
> * also have to be checksummed in software.
> */
> if (csum_insertion &&
> (priv->plat->tx_queues_cfg[queue].coe_unsupported ||
> !stmmac_has_ip_ethertype(skb))) {
> if (unlikely(skb_checksum_help(skb)))
> goto dma_map_err;
> csum_insertion = !csum_insertion;
> }
>
> Do we need to care about them in stmmac_xdp_xmit_zc()
> and stmmac_xdp_xmit_xdpf() too?
This patch only addresses avoiding the TX DMA hang by ensuring the CIC
bit is only set when the queue supports checksum offload. For DSA tagged
packets checksum offloading is not supported by the DWMAC IPs but no TX
DMA hang. AFAIK, currently AF_XDP paths don't have equivalent handling
like skb_checksum_help(), since they operate on xdp buffers. So this
patch doesn't attempt to implement a sw fallback but just avoids DMA
stall.
>
> ...
Best Regards,
Rohan
More information about the linux-arm-kernel
mailing list