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.
Fixes: be8b38a722e6 ("net: stmmac: Add support for XDP_TX action")
Signed-off-by: Lorenzo Bianconi <redacted>
---
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;
--
2.56.0