Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vladimir Oltean" <vladimir.oltean@nxp.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v2 net 3/4] net: enetc: fall back to software TX csum for too long L3 headers
Date: Thu, 19 Nov 2026 23:51:28 +0000	[thread overview]
Message-ID: <sashiko-outbox-224217@kernel.org> (raw)
In-Reply-To: <20261118235055.1225115-4-vladimir.oltean@nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] net: enetc: L4 offset check in enetc_features_check() misses
  CHECKSUM_NONE GSO
--

commit fa5d065143358009cbf7f50513adc4fbbbf2eadd
Author: Vladimir Oltean <vladimir.oltean@nxp.com>

net: enetc: fall back to software TX csum for too long L3 headers

This commit clears NETIF_F_CSUM_MASK and NETIF_F_GSO_MASK in
enetc_features_check() when hardware TX checksum offload is enabled and
the L4 header offset reaches 127 bytes.

> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index 7f089a84d9a65..6cc519eea5bd3 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -1114,6 +1114,16 @@ netdev_tx_t enetc_xmit(struct sk_buff *skb, struct net_device *ndev)
>  }
>  EXPORT_SYMBOL_GPL(enetc_xmit);
>  
> +static bool enetc_skb_l4_too_deep(const struct sk_buff *skb)
> +{
> +	unsigned int l4_offset = skb_checksum_start_offset(skb);
> +
> +	if (skb_vlan_tag_present(skb))
> +		l4_offset += VLAN_HLEN;
> +
> +	return l4_offset >= ENETC_TX_CSUM_MAX_L4_OFFSET;
> +}
> +
>  netdev_features_t enetc_features_check(struct sk_buff *skb,
>  				       struct net_device *ndev,
>  				       netdev_features_t features)
> @@ -1122,6 +1132,12 @@ netdev_features_t enetc_features_check(struct sk_buff *skb,
>  
>  	features = vlan_features_check(skb, features);
>  
> +	if (priv->active_offloads & ENETC_F_TXCSUM &&
> +	    skb->ip_summed == CHECKSUM_PARTIAL && enetc_skb_l4_too_deep(skb)) {
> +		features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
> +		return features;
> +	}

[Severity: Medium]
Does gating enetc_skb_l4_too_deep() on skb->ip_summed == CHECKSUM_PARTIAL
miss GSO packets that enter validate_xmit_skb() with CHECKSUM_NONE?

When GRO-coalesced TCPv6 packets carrying extension headers are forwarded,
validate_xmit_skb() converts skb->ip_summed from CHECKSUM_UNNECESSARY to
CHECKSUM_NONE right before calling netif_skb_features().  Because
skb->ip_summed is not CHECKSUM_PARTIAL (and skb->csum_start is not yet
initialized), enetc_features_check() leaves NETIF_F_TSO6 set.
tcp6_gso_segment() then promotes skb->ip_summed to CHECKSUM_PARTIAL, sees
that skb_gso_ok() succeeds, and passes the unsegmented skb to
enetc_lso_hw_offload() with an L4 offset >= 127 bytes, where the hardware
drops the frame with a TX BD programming error.

Also check skb_is_gso(skb) in enetc_features_check(), using
skb_transport_offset(skb) in enetc_skb_l4_too_deep() when skb->ip_summed
is not CHECKSUM_PARTIAL.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118235055.1225115-1-vladimir.oltean@nxp.com?part=3

  reply	other threads:[~2026-11-19 23:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 23:50 [PATCH v2 net 0/4] ENETC GSO fixes Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 1/4] net: enetc: let core segment GSO skb when TSO would not fit the TX ring Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 2/4] net: enetc: reserve VLAN extension BDs for software TSO Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 3/4] net: enetc: fall back to software TX csum for too long L3 headers Vladimir Oltean
2026-11-19 23:51   ` sashiko-bot [this message]
2026-11-18 23:50 ` [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE Vladimir Oltean
2026-11-19  0:03   ` Eric Dumazet
2026-11-19  8:44     ` Vladimir Oltean
2026-11-19  9:38       ` Eric Dumazet
2026-11-19  9:43         ` Vladimir Oltean
2026-11-19  9:42 ` [PATCH v2 net 0/4] ENETC GSO fixes Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-224217@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox