[PATCH net-next 2/2] net: stmmac: disable TX checksum offload for jumbo frames on bugged cores

Jisheng Zhang jszhang at kernel.org
Mon Oct 19 17:57:55 PDT 2026


On Fri, Oct 16, 2026 at 04:18:06PM +0200, Maxime Chevallier wrote:
> Hi Lorenzo,
> 
> On 10/12/26 17:24, Lorenzo Bianconi wrote:
> > stmmac_xdp_xmit_xdpf() decides TX checksum insertion from the queue COE
> > capability only:
> > 
> > 	csum = !priv->plat->tx_queues_cfg[queue].coe_unsupported;
> > 
> > and lets the enhanced descriptor set TX_CIC_FULL accordingly. On the
> > bugged_jumbo cores (snps,dwmac-3.40a, snps,dwmac-3.610 and
> > snps,dwmac-3.710) hardware checksum insertion is broken for jumbo
> > frames; the skb path works around it by clearing NETIF_F_CSUM_MASK in
> > stmmac_fix_features() when the MTU exceeds ETH_DATA_LEN, so skbs are
> > never marked CHECKSUM_PARTIAL and no checksum is inserted. The XDP TX
> > path bypasses that workaround, so once XDP is allowed at MTU >
> > ETH_DATA_LEN, jumbo frames sent via XDP_TX or redirected into the
> > device would leave the interface with a full checksum insertion enabled
> > on those cores - exactly what the workaround is meant to avoid.
> > 
> > Disable checksum insertion for oversized frames on bugged_jumbo cores in
> > the XDP TX path too.

Here I want to query a generic rule from netdev maintainers:
can XDP frame enable HW checksum on dwmac IP? Per my understanding, the
dwmac can only do HW checksum for normal particular packets layouts, such as
TCP, UDP. What about if XDP transmits a non-IP frame?

Correct me if I misunderstood something.

Thanks
> > 
> > Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action")
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at oss.qualcomm.com>
> 
> Looks cleaner to me than the alternative patch from Jisheng :
> 
> https://lore.kernel.org/netdev/20260929121025.20821-1-jszhang@kernel.org/
> 
> It sure seems there're a lot of people interested in getting XDP/XSK
> working properly on stmmac :)
> 
> Reviewed-by: Maxime Chevallier <maxime.chevallier at bootlin.com>
> 
> Maxime
> 
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index ca61ab449e32..0e29c5d04714 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > @@ -5276,6 +5276,14 @@ static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
> >  		return STMMAC_XDP_CONSUMED;
> >  	}
> >  
> > +	/* Disable TX checksum offload for jumbo frames on cores where
> > +	 * checksum insertion is broken for oversized frames, matching the
> > +	 * stmmac_fix_features() workaround used by the skb path.
> > +	 */
> > +	if (priv->plat->bugged_jumbo &&
> > +	    xdp_get_frame_len(xdpf) > ETH_FRAME_LEN)
> > +		csum = false;
> > +
> >  	while (true) {
> >  		skb_frag_t *frag = i ? &sinfo->frags[i - 1] : NULL;
> >  		int len = frag ? skb_frag_size(frag) : xdpf->len;
> > 
> 



More information about the linux-arm-kernel mailing list