* [PATCH v2 net 1/4] net: enetc: let core segment GSO skb when TSO would not fit the TX ring
2026-11-18 23:50 [PATCH v2 net 0/4] ENETC GSO fixes Vladimir Oltean
@ 2026-11-18 23:50 ` Vladimir Oltean
2026-11-23 0:28 ` netdev-bot+sashiko
2026-11-18 23:50 ` [PATCH v2 net 2/4] net: enetc: reserve VLAN extension BDs for software TSO Vladimir Oltean
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Vladimir Oltean @ 2026-11-18 23:50 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
For simplicity reasons, the enetc software GSO implementation waits for
the TX ring to free up sufficiently that all BDs that would be generated
by driver-level segmentation can be enqueued in one go. To pass the time,
it stops the queue and returns NETDEV_TX_BUSY for the core to requeue.
The problem is that without any limits on gso_segs, some GSO skbs can
never be sent, and the aforementioned behaviour results in the queue
stalling (there is also no ndo_tx_timeout implementation).
This was reported by Sashiko, but is a valid issue which can be easily
triggered from any source that can craft gso_segs in a way that
tso_count_descs() can exceed 2047 (the ring size minus the obligatory
free entry). Valid reproduction methods include TCP peers whose MSS is
close to tcp_min_snd_mss plus large (64KB) TSO skbs; UDP GSO using
setsockopt(UDP_SEGMENT); maybe others.
Add an ndo_features_check() that clears the GSO features for skbs that
take the software TSO path and whose descriptor estimate is larger than
the ring could ever provide. The core then segments these skbs itself
before calling ndo_start_xmit().
Capping the segment count with netif_set_tso_max_segs() would be
simpler, but its drawback is that it's static, so it would have to
assume the worst case for every skb (MAX_SKB_FRAGS, and later the
per-segment VLAN and padding BDs). This would reduce TSO sizes even for
skbs that fit.
Fixes: fb8629e2cbfc ("net: enetc: add support for software TSO")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v1->v2: dropped the word "super" from "GSO super-skb"
---
drivers/net/ethernet/freescale/enetc/enetc.c | 31 ++++++++++++++++---
drivers/net/ethernet/freescale/enetc/enetc.h | 3 ++
.../net/ethernet/freescale/enetc/enetc4_pf.c | 1 +
.../net/ethernet/freescale/enetc/enetc_pf.c | 1 +
.../net/ethernet/freescale/enetc/enetc_vf.c | 2 ++
5 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index c6571b5cc842..1606ac57016f 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -695,6 +695,14 @@ static int enetc_lso_get_hdr_len(const struct sk_buff *skb)
return hdr_len;
}
+static bool enetc_skb_uses_lso(const struct enetc_ndev_priv *priv,
+ const struct sk_buff *skb)
+{
+ /* LSO data unit lengths of up to 256KB are supported */
+ return priv->active_offloads & ENETC_F_LSO &&
+ (skb->len - enetc_lso_get_hdr_len(skb)) <= ENETC_LSO_MAX_DATA_LEN;
+}
+
static void enetc_lso_start(struct sk_buff *skb, struct enetc_lso_t *lso)
{
lso->lso_seg_size = skb_shinfo(skb)->gso_size;
@@ -1018,10 +1026,7 @@ static netdev_tx_t enetc_start_xmit(struct sk_buff *skb,
tx_ring = priv->tx_ring[skb->queue_mapping];
if (skb_is_gso(skb)) {
- /* LSO data unit lengths of up to 256KB are supported */
- if (priv->active_offloads & ENETC_F_LSO &&
- (skb->len - enetc_lso_get_hdr_len(skb)) <=
- ENETC_LSO_MAX_DATA_LEN) {
+ if (enetc_skb_uses_lso(priv, skb)) {
if (enetc_bd_unused(tx_ring) < enetc_lso_count_descs(skb)) {
netif_stop_subqueue(ndev, tx_ring->index);
return NETDEV_TX_BUSY;
@@ -1098,6 +1103,24 @@ netdev_tx_t enetc_xmit(struct sk_buff *skb, struct net_device *ndev)
}
EXPORT_SYMBOL_GPL(enetc_xmit);
+netdev_features_t enetc_features_check(struct sk_buff *skb,
+ struct net_device *ndev,
+ netdev_features_t features)
+{
+ struct enetc_ndev_priv *priv = netdev_priv(ndev);
+
+ features = vlan_features_check(skb, features);
+
+ if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
+ return features;
+
+ if (tso_count_descs(skb) >= priv->tx_bd_count)
+ features &= ~NETIF_F_GSO_MASK;
+
+ return features;
+}
+EXPORT_SYMBOL_GPL(enetc_features_check);
+
static irqreturn_t enetc_msix(int irq, void *data)
{
struct enetc_int_vector *v = data;
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
index d9e91832a9c1..1e3290d1a388 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc.h
@@ -529,6 +529,9 @@ int enetc_close(struct net_device *ndev);
void enetc_start(struct net_device *ndev);
void enetc_stop(struct net_device *ndev);
netdev_tx_t enetc_xmit(struct sk_buff *skb, struct net_device *ndev);
+netdev_features_t enetc_features_check(struct sk_buff *skb,
+ struct net_device *ndev,
+ netdev_features_t features);
struct net_device_stats *enetc_get_stats(struct net_device *ndev);
void enetc_set_features(struct net_device *ndev, netdev_features_t features);
int enetc_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd);
diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
index 71c971618388..bfe0eaf50975 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c
@@ -586,6 +586,7 @@ static const struct net_device_ops enetc4_ndev_ops = {
.ndo_open = enetc_open,
.ndo_stop = enetc_close,
.ndo_start_xmit = enetc_xmit,
+ .ndo_features_check = enetc_features_check,
.ndo_get_stats = enetc_get_stats,
.ndo_set_mac_address = enetc_pf_set_mac_addr,
.ndo_set_rx_mode_async = enetc4_pf_set_rx_mode,
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf.c b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
index d77a07cece28..86ca88196a4b 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
@@ -483,6 +483,7 @@ static const struct net_device_ops enetc_ndev_ops = {
.ndo_open = enetc_open,
.ndo_stop = enetc_close,
.ndo_start_xmit = enetc_xmit,
+ .ndo_features_check = enetc_features_check,
.ndo_get_stats = enetc_get_stats,
.ndo_set_mac_address = enetc_pf_set_mac_addr,
.ndo_set_rx_mode = enetc_pf_set_rx_mode,
diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
index f70b6d4290f2..223f974727bc 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
@@ -440,6 +440,7 @@ static const struct net_device_ops enetc_ndev_ops = {
.ndo_open = enetc_open,
.ndo_stop = enetc_close,
.ndo_start_xmit = enetc_xmit,
+ .ndo_features_check = enetc_features_check,
.ndo_get_stats = enetc_get_stats,
.ndo_set_mac_address = enetc_vf_set_mac_addr,
.ndo_set_features = enetc_vf_set_features,
@@ -453,6 +454,7 @@ static const struct net_device_ops enetc4_ndev_ops = {
.ndo_open = enetc_open,
.ndo_stop = enetc_close,
.ndo_start_xmit = enetc_xmit,
+ .ndo_features_check = enetc_features_check,
.ndo_get_stats = enetc_get_stats,
.ndo_set_mac_address = enetc_vf_set_mac_addr,
.ndo_set_features = enetc_vf_set_features,
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 net 1/4] net: enetc: let core segment GSO skb when TSO would not fit the TX ring
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-23 0:28 ` netdev-bot+sashiko
0 siblings, 0 replies; 14+ messages in thread
From: netdev-bot+sashiko @ 2026-11-23 0:28 UTC (permalink / raw)
To: vladimir.oltean
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
claudiu.manoil, wei.fang, xiaoning.wang, ioana.ciornei,
willemdebruijn.kernel, imx, linux-kernel
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 0 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] enetc_features_check()
(drivers/net/ethernet/freescale/enetc/enetc.c:1106-1122) decides…
--
net: enetc: let core segment GSO skb when TSO would not fit the TX ring
This patch adds an ndo_features_check() to enetc. For skbs that take the
software TSO path, it clears the GSO features when the descriptor estimate
is at least the TX ring size, so the core segments those skbs before
ndo_start_xmit(). The goal is to stop the TX queue from stalling on skbs
that could never fit in the ring.
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index c6571b5cc8425..1606ac57016f3 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
[ ... ]
> @@ -1098,6 +1103,24 @@ netdev_tx_t enetc_xmit(struct sk_buff *skb, struct net_device *ndev)
> }
> EXPORT_SYMBOL_GPL(enetc_xmit);
>
> +netdev_features_t enetc_features_check(struct sk_buff *skb,
> + struct net_device *ndev,
> + netdev_features_t features)
> +{
> + struct enetc_ndev_priv *priv = netdev_priv(ndev);
> +
> + features = vlan_features_check(skb, features);
> +
> + if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
> + return features;
> +
> + if (tso_count_descs(skb) >= priv->tx_bd_count)
> + features &= ~NETIF_F_GSO_MASK;
[Severity: High]
Can SKB_GSO_DODGY skbs get past this check, given that their gso_segs is
still 0 when enetc_features_check() runs?
tso_count_descs() is computed from skb_shinfo(skb)->gso_segs.
virtio_net_hdr_to_skb() clears that field for untrusted skbs, for example
those sent by af_packet with PACKET_VNET_HDR:
include/linux/virtio_net.h:virtio_net_hdr_to_skb() {
...
shinfo->gso_type |= SKB_GSO_DODGY;
shinfo->gso_segs = 0;
...
}
With PACKET_QDISC_BYPASS, nothing recomputes gso_segs before the features
check. qdisc_pkt_len_segs_init() is only called from __dev_queue_xmit():
packet_xmit()
dev_direct_xmit()
__dev_direct_xmit()
validate_xmit_skb_list()
validate_xmit_skb()
enetc_features_check() <- gso_segs == 0, GSO features kept
The estimate is therefore just nr_frags, and NETIF_F_GSO_MASK stays set.
enetc does not advertise NETIF_F_GSO_ROBUST, so the skb goes through
__skb_gso_segment(), and tcp_gso_segment() takes this branch:
net/ipv4/tcp_offload.c:tcp_gso_segment() {
...
if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
/* Packet is from an untrusted source, reset gso_segs. */
skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
...
}
This returns NULL, so the original unsegmented skb is passed on, now with
its real gso_segs. With gso_size as small as 8 and a ~64KB payload, that
is roughly 8000 segments, or about 16000 BDs for a 2048-entry ring.
enetc_bd_unused() is at most bd_count - 1, so this check in
enetc_start_xmit() can never become false:
} else {
if (enetc_bd_unused(tx_ring) < tso_count_descs(skb)) {
netif_stop_subqueue(ndev, tx_ring->index);
return NETDEV_TX_BUSY;
}
dev_direct_xmit() frees the skb, but the subqueue stays stopped. The only
place that wakes it is enetc_clean_tx_ring(), and that needs completed
frames:
if (unlikely(tx_frm_cnt && netif_carrier_ok(ndev) &&
__netif_subqueue_stopped(ndev, tx_ring->index) &&
...
netif_wake_subqueue(ndev, tx_ring->index);
If the ring is idle when this happens, and with no ndo_tx_timeout, does
that TX queue stay stopped until the interface is bounced? That would be
the same stall the commit message describes as triggerable "from any
source that can craft gso_segs".
A tc egress BPF program can probably reach the same state as well.
bpf_skb_adjust_room() and similar helpers set gso_segs = 0 together with
SKB_GSO_DODGY, and sch_handle_egress() runs after
qdisc_pkt_len_segs_init().
The af_packet UDP_L4 case does not seem to trigger this, because
virtio_net_hdr_to_skb() caps it at UDP_MAX_SEGMENTS. The TCP case does
trigger it.
Later patches in the series do not appear to change this. At the end of
the series, enetc_features_check() still goes through
enetc_tso_count_descs(), which reads skb_shinfo(skb)->gso_segs.
Would it work to derive the segment count from skb->len, the header length
and gso_size here, at least for SKB_GSO_DODGY skbs? Another option would be
for enetc_start_xmit() to drop, instead of returning NETDEV_TX_BUSY for,
any skb whose estimate is >= tx_ring->bd_count.
> +
> + return features;
> +}
> +EXPORT_SYMBOL_GPL(enetc_features_check);
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118235055.1225115-1-vladimir.oltean%40nxp.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 net 2/4] net: enetc: reserve VLAN extension BDs for software TSO
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 ` Vladimir Oltean
2026-11-23 0:28 ` netdev-bot+sashiko
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
` (2 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Vladimir Oltean @ 2026-11-18 23:50 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
enetc_start_xmit() uses tso_count_descs() to check whether the TX ring
has enough free BDs for a software TSO frame. That estimates one header
BD and one data BD per segment, plus one BD per frag. However, when the
skb carries a VLAN tag, enetc_map_tx_tso_hdr() also adds an extension
BD to every segment, which is not accounted for.
With a highly segmented VLAN TSO skb and a nearly full ring, the driver
can then write past next_to_clean and overwrite BDs still owned by the
hardware.
Add enetc_tso_count_descs() which accounts for the extension BD of each
segment when VLAN insertion is needed.
Fixes: fb8629e2cbfc ("net: enetc: add support for software TSO")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
This comes from the previous patch set:
https://lore.kernel.org/netdev/20261021145314.1435049-2-vladimir.oltean@nxp.com/
v1->v2: none
old v5->v1: also patch enetc_features_check()
old v4->old v5: patch is new
---
drivers/net/ethernet/freescale/enetc/enetc.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index 1606ac57016f..7f089a84d9a6 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -674,6 +674,17 @@ static void enetc_tso_complete_csum(struct enetc_bdr *tx_ring, struct tso_t *tso
}
}
+static int enetc_tso_count_descs(const struct sk_buff *skb)
+{
+ int count = tso_count_descs(skb);
+
+ /* Each segment also needs an extension BD for VLAN insertion */
+ if (skb_vlan_tag_present(skb))
+ count += skb_shinfo(skb)->gso_segs;
+
+ return count;
+}
+
static int enetc_lso_count_descs(const struct sk_buff *skb)
{
/* 4 BDs: 1 BD for LSO header + 1 BD for extended BD + 1 BD
@@ -1034,7 +1045,7 @@ static netdev_tx_t enetc_start_xmit(struct sk_buff *skb,
count = enetc_lso_hw_offload(tx_ring, skb);
} else {
- if (enetc_bd_unused(tx_ring) < tso_count_descs(skb)) {
+ if (enetc_bd_unused(tx_ring) < enetc_tso_count_descs(skb)) {
netif_stop_subqueue(ndev, tx_ring->index);
return NETDEV_TX_BUSY;
}
@@ -1114,7 +1125,7 @@ netdev_features_t enetc_features_check(struct sk_buff *skb,
if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
return features;
- if (tso_count_descs(skb) >= priv->tx_bd_count)
+ if (enetc_tso_count_descs(skb) >= priv->tx_bd_count)
features &= ~NETIF_F_GSO_MASK;
return features;
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 net 2/4] net: enetc: reserve VLAN extension BDs for software TSO
2026-11-18 23:50 ` [PATCH v2 net 2/4] net: enetc: reserve VLAN extension BDs for software TSO Vladimir Oltean
@ 2026-11-23 0:28 ` netdev-bot+sashiko
0 siblings, 0 replies; 14+ messages in thread
From: netdev-bot+sashiko @ 2026-11-23 0:28 UTC (permalink / raw)
To: vladimir.oltean
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
claudiu.manoil, wei.fang, xiaoning.wang, ioana.ciornei,
willemdebruijn.kernel, imx, linux-kernel
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message only describes the ring-space check in
enetc_start_xmit().
Pre-existing issues:
- [High] This problem was not introduced by this patch, but it is a high-
severity pre-existing issue: a lost wake-up race between stopping the…
--
net: enetc: reserve VLAN extension BDs for software TSO
This patch adds enetc_tso_count_descs(), which extends tso_count_descs()
with one extra extension BD per segment when the skb carries a VLAN tag.
It uses the new helper for the free-BD check in enetc_start_xmit() and
for the ring-size check in enetc_features_check().
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index 1606ac57016f3..7f089a84d9a65 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
[ ... ]
> @@ -1034,7 +1045,7 @@ static netdev_tx_t enetc_start_xmit(struct sk_buff *skb,
>
> count = enetc_lso_hw_offload(tx_ring, skb);
> } else {
> - if (enetc_bd_unused(tx_ring) < tso_count_descs(skb)) {
> + if (enetc_bd_unused(tx_ring) < enetc_tso_count_descs(skb)) {
> netif_stop_subqueue(ndev, tx_ring->index);
> return NETDEV_TX_BUSY;
> }
[Severity: High]
This isn't a bug introduced by this patch, but can this stop path lose a
wake-up from TX completion?
When the free-BD check fails, enetc_start_xmit() calls
netif_stop_subqueue() and returns NETDEV_TX_BUSY. There is no smp_mb()
and no second enetc_bd_unused() check after the stop. The LSO path, the
non-GSO path and the trailing ENETC_TXBDS_MAX_NEEDED() stop all have the
same shape.
On the completion side, enetc_clean_tx_ring() stores next_to_clean only
after its whole cleaning loop has finished. It then tests the stopped
state with no barrier in between:
drivers/net/ethernet/freescale/enetc/enetc.c:enetc_clean_tx_ring() {
...
tx_ring->next_to_clean = i;
...
if (unlikely(tx_frm_cnt && netif_carrier_ok(ndev) &&
__netif_subqueue_stopped(ndev, tx_ring->index) &&
!test_bit(ENETC_TX_DOWN, &priv->flags) &&
(enetc_bd_unused(tx_ring) >=
ENETC_TXBDS_MAX_NEEDED(priv->max_frags)))) {
netif_wake_subqueue(ndev, tx_ring->index);
}
...
}
Consider this interleaving:
CPU0 (ndo_start_xmit) CPU1 (NAPI)
enetc_bd_unused() reads old
next_to_clean, ring looks full
finishes reclaiming the last frames
tx_ring->next_to_clean = i;
__netif_subqueue_stopped() is false,
so no netif_wake_subqueue()
netif_stop_subqueue()
return NETDEV_TX_BUSY
The ring is now empty, so no later TX completion will reach this check
with tx_frm_cnt > 0. Polls driven by RX clean 0 TX frames. The driver has
no ndo_tx_timeout, and the only other wake is netif_tx_start_all_queues()
in the open path.
Would the queue stay stopped until the interface is brought down and up
again?
enetc_bd_unused() also reads next_to_clean and next_to_use with plain
loads while both contexts write them, without READ_ONCE()/WRITE_ONCE().
With this patch, VLAN TSO skbs hit the NETDEV_TX_BUSY path more often,
because the estimate now includes the per-segment extension BDs. The
synchronization is unchanged.
Would netif_txq_maybe_stop() and netif_txq_completed_wake() from
include/net/netdev_queues.h work here? Another option is an open-coded
stop, smp_mb() and re-check, paired with a barrier after next_to_clean is
updated. The later patches in this series don't seem to address this.
[ ... ]
> @@ -1114,7 +1125,7 @@ netdev_features_t enetc_features_check(struct sk_buff *skb,
> if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
> return features;
>
> - if (tso_count_descs(skb) >= priv->tx_bd_count)
> + if (enetc_tso_count_descs(skb) >= priv->tx_bd_count)
> features &= ~NETIF_F_GSO_MASK;
[Severity: Low]
This isn't a bug, but should the commit message mention this second call
site? The body only covers the free-BD check in enetc_start_xmit():
enetc_start_xmit() uses tso_count_descs() to check whether the TX ring
has enough free BDs for a software TSO frame.
This hunk changes runtime behavior. VLAN-tagged software TSO skbs whose
adjusted estimate reaches priv->tx_bd_count now lose GSO, so the core
segments them before ndo_start_xmit().
The change is also required. Without it, a VLAN skb where
tso_count_descs() < tx_bd_count <= enetc_tso_count_descs() would still
pass as GSO. Since enetc_bd_unused() is at most bd_count - 1,
enetc_start_xmit() would then return NETDEV_TX_BUSY forever.
That is the stall fixed by the previous patch, "net: enetc: let core
segment GSO skb when TSO would not fit the TX ring". That patch also added
enetc_features_check() itself.
Right now only the changelog below the '---' mentions this ("old v5->v1:
also patch enetc_features_check()"), and that text won't be kept in git.
Could the body describe the enetc_features_check() change and the
dependency on the previous patch, for stable backports?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118235055.1225115-1-vladimir.oltean%40nxp.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 net 3/4] net: enetc: fall back to software TX csum for too long L3 headers
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 ` Vladimir Oltean
2026-11-23 0:28 ` netdev-bot+sashiko
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 9:42 ` [PATCH v2 net 0/4] ENETC GSO fixes Eric Dumazet
4 siblings, 1 reply; 14+ messages in thread
From: Vladimir Oltean @ 2026-11-18 23:50 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
For L4 checksum offload, enetc_map_tx_buffs() programs the following TX
BD fields: ENETC_TX_BD_L3_START <- skb_network_offset(skb) and
ENETC_TX_BD_L3_HDR_LEN <- skb_network_header_len(skb) / 4.
These fields are passed this way so that the hardware simultaneously
knows the L3 header start (for computing the pseudo-header) and the L4
header start (by summing up L3_START + 4 x L3_HDR_SIZE) which is the
csum_start.
Section 106.3.5.1.2.1.3.5 Transmit Checksum Offload of the i.MX95 RM
has this statement:
BD[L3_START] + (BD[L3_HDR_SIZE] x 4) is set to the offset within the
packet to begin checksumming. (BD[L3_START] + (BD[L3_HDR_SIZE] x 4) +
any hardware inserted tags) must be smaller than 127 bytes.
We have no test for this condition, and with IPv6 extension headers it
is possible for that sum to actually exceed 127 bytes. For example, when
using the Segment Routing Header, 4 Segment Identifiers (SIDs) will
produce an L4 header offset of 126 bytes (OK), while 5 SIDs will produce
an L4 offset of 142 bytes (not OK).
The hardware picks up these packets from the TX ring, identifies the
incorrect header length, refuses to send them, updates the TX BD
writeback with the STATUS field set to 1, meaning:
Programming error
An error exists in either the Tx BD, the Tx ring registers, or some
combination of these which meant that this frame could not be
transmitted.
releases the buffer and updates tx_ring->stats.packets and
tx_ring->stats.bytes as if the packets were sent (but no MAC counter
updates).
This error can only be seen through manual code instrumentation, since
the driver only checks the writeback when it sets tx_swbd->check_wb, and
it does that for taprio offload and for 2-step TX timestamping.
Issue found while investigating Sashiko's question "Can a 256-byte
header still break the hardware LSO path because lso->hdr_len is a u8?":
https://lore.kernel.org/imx/sashiko-outbox-211955@kernel.org/
and was reproduced using:
https://gist.github.com/vladimiroltean/7cecf636b788b29f361a2fbdae646010
Turns out, LSO breaks sooner than the assumed 256 byte limit, because of
the checksum offload feature it depends on.
LS1028A also declares the NETIF_F_HW_CSUM feature in order for GSO to be
passed to the driver for software segmentation, but performs the
checksum in software - either through csum_partial()/csum_block_add()
for GSO, or through skb_checksum_help() for non-GSO. Point being, it
does not use the HW offload engine, does not have the limitation, and is
the reason why we need to discern using the ENETC_F_TXCSUM bit from
priv->active_offloads instead.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v1->v2: patch is new
---
drivers/net/ethernet/freescale/enetc/enetc.c | 16 ++++++++++++++++
drivers/net/ethernet/freescale/enetc/enetc.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index 7f089a84d9a6..6cc519eea5bd 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;
+ }
+
if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
return features;
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.h b/drivers/net/ethernet/freescale/enetc/enetc.h
index 1e3290d1a388..5b8cffd589c7 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.h
+++ b/drivers/net/ethernet/freescale/enetc/enetc.h
@@ -75,6 +75,7 @@ struct enetc_lso_t {
int total_len; /* total data length, not include LSO header */
};
+#define ENETC_TX_CSUM_MAX_L4_OFFSET 127
#define ENETC_LSO_MAX_DATA_LEN SZ_256K
#define ENETC_RX_MAXFRM_SIZE ENETC_MAC_MAXFRM_SIZE
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 net 3/4] net: enetc: fall back to software TX csum for too long L3 headers
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-23 0:28 ` netdev-bot+sashiko
0 siblings, 0 replies; 14+ messages in thread
From: netdev-bot+sashiko @ 2026-11-23 0:28 UTC (permalink / raw)
To: vladimir.oltean
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
claudiu.manoil, wei.fang, xiaoning.wang, ioana.ciornei,
willemdebruijn.kernel, imx, linux-kernel
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 2
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] net: enetc: L4 offset check in enetc_features_check() misses
CHECKSUM_NONE GSO
- [Low] The commit "net: enetc: fall back to software TX csum for too
long L3 headers" has no Fixes: tag, but it fixes a real bug.
- [Low] The macro's name says inclusive maximum, but its only user treats
it as an exclusive bound.
--
net: enetc: fall back to software TX csum for too long L3 headers
This patch makes enetc_features_check() strip the checksum and GSO
features from CHECKSUM_PARTIAL skbs when the hardware TX checksum engine
is in use and the L4 offset (plus any hwaccel VLAN tag) reaches 127 bytes.
The i.MX95 hardware rejects such frames as a programming error, but the
driver still counts them as sent.
> 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;
[Severity: Low]
This isn't a bug, but is the name ENETC_TX_CSUM_MAX_L4_OFFSET a bit
misleading? enetc.h defines it as:
#define ENETC_TX_CSUM_MAX_L4_OFFSET 127
This comparison treats it as an exclusive bound, so the largest L4 offset
actually allowed is 126. The ">=" matches the RM text ("must be smaller
than 127 bytes"). The "MAX" in the name, though, suggests that 127 itself
is allowed.
Someone reusing the macro could reasonably write
"> ENETC_TX_CSUM_MAX_L4_OFFSET" and let a 127 byte offset through, which
the hardware would reject. Would a name like
ENETC_TX_CSUM_L4_OFFSET_LIMIT, or a value of 126 compared with ">", make
the definition and its use agree?
The mismatch is still there at the end of the series. The later patch
"net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE"
also cites this macro in its commit message.
> +}
> +
> 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 this check catch GSO skbs that reach enetc_features_check() with
skb->ip_summed set to something other than CHECKSUM_PARTIAL?
There are at least two ways to get such an skb here:
- validate_xmit_skb() changes a non-fraglist GSO skb marked
CHECKSUM_UNNECESSARY into CHECKSUM_NONE before it calls
netif_skb_features(). One example is a TCPv6 skb with an SRH that
GRO coalesced and that is then forwarded or bridged out of the
ENETC port.
- __virtio_net_hdr_to_skb() builds CHECKSUM_NONE GSO skbs when
VIRTIO_NET_HDR_F_NEEDS_CSUM is not set. Local users of tun/tap,
macvtap, vhost-net or AF_PACKET can trigger this.
For those skbs the ip_summed test fails and enetc_skb_l4_too_deep() is
never called. NETIF_F_TSO6 and NETIF_F_HW_CSUM stay set in features.
netif_needs_gso() is then true because the skb is not
CHECKSUM_PARTIAL. validate_xmit_skb() goes through __skb_gso_segment()
into tcp6_gso_segment(), which switches the skb to CHECKSUM_PARTIAL
via __tcp_v6_send_check(). tcp_gso_segment() then returns NULL without
segmenting, because skb_gso_ok() still sees NETIF_F_TSO6 in features.
The skb reaches enetc_start_xmit() and enetc_lso_hw_offload() whole.
enetc_lso_map_hdr() then sets ENETC_TXBD_FLAGS_CSUM_LSO,
ENETC_TXBD_FLAGS_LSO and ENETC_TXBD_FLAGS_L4CS with an L4 offset of
127 bytes or more. Wouldn't the hardware reject that with the same
programming error described in the commit message? The frame would be
dropped while tx_ring->stats still counts it as sent.
At this point in the series nothing bounds the GSO header length
either. Headers of 256 bytes or more on this path also wrap the u8
lso->hdr_len and lso->l3_hdr_len fields that enetc_lso_start() fills
in.
The TSO_HEADER_SIZE - VLAN_HLEN check added later by "net: enetc: let
core segment GSO skb when headers exceed TSO_HEADER_SIZE" removes the
wrap. It does not close this hole, though. A GSO skb with an L4 offset
between 127 and 232 bytes and no more than 252 bytes of headers still
keeps NETIF_F_TSO6 at the end of the series.
csum_start is only meaningful for CHECKSUM_PARTIAL, so the ip_summed
test is needed as long as enetc_skb_l4_too_deep() uses
skb_checksum_start_offset(). Would it work to use
skb_transport_offset() for GSO skbs regardless of ip_summed, and keep
the csum_start based check for non-GSO CHECKSUM_PARTIAL skbs?
[Severity: Low]
Should this patch have a Fixes: tag? The other three patches in the
series each carry "Fixes: fb8629e2cbfc", but this one has none.
The L3_START/L3_HDR_LEN programming in enetc_map_tx_buffs() that this
check guards came from commit d9a093d2d12a ("net: enetc: add Tx checksum
offload for i.MX95 ENETC"):
temp_bd.l3_aux0 = FIELD_PREP(ENETC_TX_BD_L3_START,
skb_network_offset(skb));
temp_bd.l3_aux1 = FIELD_PREP(ENETC_TX_BD_L3_HDR_LEN,
skb_network_header_len(skb) / 4);
enetc_lso_map_hdr() has the same unbounded programming. It came from
commit 69797ff888d3 ("net: enetc: add LSO support for i.MX95 ENETC PF"),
and LSO depends on the same checksum engine:
txbd_tmp.l3_aux0 = FIELD_PREP(ENETC_TX_BD_L3_START, lso->l3_start);
/* l3_hdr_size in 32-bits (4 bytes) */
txbd_tmp.l3_aux1 = FIELD_PREP(ENETC_TX_BD_L3_HDR_LEN,
lso->l3_hdr_len / 4);
Without a tag, stable trees that contain d9a093d2d12a (December 2024 and
later) may not get this fix. Frames such as IPv6 with a 5 SID SRH would
then still be dropped silently by the hardware while being counted as
sent.
Would something like this be appropriate?
Fixes: d9a093d2d12a ("net: enetc: add Tx checksum offload for i.MX95 ENETC")
> if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
> return features;
>
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118235055.1225115-1-vladimir.oltean%40nxp.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
2026-11-18 23:50 [PATCH v2 net 0/4] ENETC GSO fixes Vladimir Oltean
` (2 preceding siblings ...)
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-18 23:50 ` Vladimir Oltean
2026-11-19 0:03 ` Eric Dumazet
2026-11-23 0:28 ` netdev-bot+sashiko
2026-11-19 9:42 ` [PATCH v2 net 0/4] ENETC GSO fixes Eric Dumazet
4 siblings, 2 replies; 14+ messages in thread
From: Vladimir Oltean @ 2026-11-18 23:50 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
Like many other drivers, the software TSO path (enetc_map_tx_tso_buffs())
copies the L2+L3+L4 headers of the skb into a fixed-size TSO_HEADER_SIZE
(256 byte) slot of the per-ring dma_alloc_coherent() header area,
without checking that they fit.
Sashiko casually points out during review of an unrelated patch:
https://lore.kernel.org/netdev/179294166520.3134.18097439321876673016@kernel.org/
that TSO_HEADER_SIZE does not constitute the maximum size that packet
headers can have for GSO skbs, but rather, an essentially arbitrary
number.
An example where headers can exceed TSO_HEADER_SIZE is with an IPv6
extension named Segment Routing Header, set through setsockopt(IPV6_RTHDR),
with a type 4 routing header. With 11 or more segments, the headers of a
TCP/IPv6 packet exceed 256 bytes:
Ethernet 14
IPv6 40
SRH, 12 segments 8 + 12 * 16 = 200
TCP (with timestamps) 32
---
286 (30 bytes too many)
No privileges are required to request this socket option (but it will
cause driver writes outside allocated memory). A reproducer sketch can
be found at:
https://gist.github.com/vladimiroltean/7cecf636b788b29f361a2fbdae646010
Bizarrely, enetc is the only affected driver, because the core
accidentally protects most other drivers against this bug in
gso_features_check(). There, we have this logic that saves the day:
/* NETIF_F_IPV6_CSUM does not support IPv6 extension headers,
* so neither does TSO that depends on it.
*/
if (features & NETIF_F_IPV6_CSUM &&
skb_has_ipv6_extension_hdr(skb))
features &= ~(NETIF_F_IPV6_CSUM | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4);
enetc is the outlier because it only advertises the more complete
NETIF_F_HW_CSUM, so for it, this fixup does not clear the NETIF_F_TSO6
and NETIF_F_GSO_UDP_L4 bits.
[ astute reviewers may ask: what if we disable NETIF_F_IPV6_CSUM at
runtime, via ethtool -k, so as to bypass this fixup, don't we make
all drivers vulnerable?
No, because netdev_fix_features() will trigger the code path which
also prints "Dropping TSO6 features since no CSUM feature.\n".
So TSO skbs will now be segmented in the stack. ]
Surveying every driver that uses TSO_HEADER_SIZE:
Driver | TSO6 | Checksum feature | Core guard fires? | Verdict
---------------|---------------------|-------------------|---------
enetc | yes | NETIF_F_HW_CSUM | no | vulnerable
bnxt | yes | NETIF_F_IPV6_CSUM | yes | safe
nicvf | yes | NETIF_F_IPV6_CSUM | yes | safe
otx2 | yes | NETIF_F_IPV6_CSUM | yes | safe
fec | no | NETIF_F_IPV6_CSUM | n/a | safe
mvneta | no | NETIF_F_IPV6_CSUM | n/a | safe
mvpp2 | no | NETIF_F_IPV6_CSUM | n/a | safe
mv643xx | no | NETIF_F_IP_CSUM | n/a | safe
dpaa2 | no | NETIF_F_IPV6_CSUM | n/a | safe (*)
(*) dpaa2 also uses a fixed-size kmalloc(TSO_HEADER_SIZE) per segment,
so the identical overflow would apply if it ever gained NETIF_F_TSO6.
The above survey is what influenced the decision to make a localized
patch in enetc_features_check() rather than create a huge disturbance in
the core, even though, IMO, TSO_HEADER_SIZE is a huge foot gun.
Note that the LSO path (enetc_lso_map_hdr()) also copies the header into
the tso_headers buffers for a reason I don't quite understand. However,
I've excluded it from the discussion because when the GSO header size
grows to weird sizes, it never gets anywhere near TSO_HEADER_SIZE before
hardware stops being able to support this offload. There's an earlier
limit at ENETC_TX_CSUM_MAX_L4_OFFSET at which it stops being able to
perform HW TX checksumming (a dependency feature).
Fixes: fb8629e2cbfc ("net: enetc: add support for software TSO")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v1->v2:
- drop word "super" from "GSO super-skb"
- subtract VLAN_HLEN from maximum permissible GSO header size
- stop blaming LSO
---
drivers/net/ethernet/freescale/enetc/enetc.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index 6cc519eea5bd..2bc65cf6f508 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -1138,7 +1138,19 @@ netdev_features_t enetc_features_check(struct sk_buff *skb,
return features;
}
- if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
+ if (!skb_is_gso(skb))
+ return features;
+
+ /* In case NETIF_F_HW_VLAN_CTAG_TX is disabled, validate_xmit_vlan()
+ * has not yet run and a VLAN may still be in the hwaccel area, so we
+ * need to be one step ahead
+ */
+ if (enetc_lso_get_hdr_len(skb) > TSO_HEADER_SIZE - VLAN_HLEN) {
+ features &= ~NETIF_F_GSO_MASK;
+ return features;
+ }
+
+ if (enetc_skb_uses_lso(priv, skb))
return features;
if (enetc_tso_count_descs(skb) >= priv->tx_bd_count)
--
2.53.0
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
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-23 0:28 ` netdev-bot+sashiko
1 sibling, 1 reply; 14+ messages in thread
From: Eric Dumazet @ 2026-11-19 0:03 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, Andrew Lunn, David S . Miller, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
Le jeu. 19 nov. 2026 à 00:51, Vladimir Oltean
<vladimir.oltean@nxp.com> a écrit :
>
> Like many other drivers, the software TSO path (enetc_map_tx_tso_buffs())
> copies the L2+L3+L4 headers of the skb into a fixed-size TSO_HEADER_SIZE
> (256 byte) slot of the per-ring dma_alloc_coherent() header area,
> without checking that they fit.
>
> Sashiko casually points out during review of an unrelated patch:
> https://lore.kernel.org/netdev/179294166520.3134.18097439321876673016@kernel.org/
> that TSO_HEADER_SIZE does not constitute the maximum size that packet
> headers can have for GSO skbs, but rather, an essentially arbitrary
> number.
>
> An example where headers can exceed TSO_HEADER_SIZE is with an IPv6
> extension named Segment Routing Header, set through setsockopt(IPV6_RTHDR),
> with a type 4 routing header. With 11 or more segments, the headers of a
> TCP/IPv6 packet exceed 256 bytes:
>
> Ethernet 14
> IPv6 40
> SRH, 12 segments 8 + 12 * 16 = 200
> TCP (with timestamps) 32
> ---
> 286 (30 bytes too many)
>
> No privileges are required to request this socket option (but it will
> cause driver writes outside allocated memory). A reproducer sketch can
> be found at:
> https://gist.github.com/vladimiroltean/7cecf636b788b29f361a2fbdae646010
>
> Bizarrely, enetc is the only affected driver, because the core
> accidentally protects most other drivers against this bug in
> gso_features_check(). There, we have this logic that saves the day:
>
> /* NETIF_F_IPV6_CSUM does not support IPv6 extension headers,
> * so neither does TSO that depends on it.
> */
> if (features & NETIF_F_IPV6_CSUM &&
> skb_has_ipv6_extension_hdr(skb))
> features &= ~(NETIF_F_IPV6_CSUM | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4);
>
> enetc is the outlier because it only advertises the more complete
> NETIF_F_HW_CSUM, so for it, this fixup does not clear the NETIF_F_TSO6
> and NETIF_F_GSO_UDP_L4 bits.
>
> [ astute reviewers may ask: what if we disable NETIF_F_IPV6_CSUM at
> runtime, via ethtool -k, so as to bypass this fixup, don't we make
> all drivers vulnerable?
> No, because netdev_fix_features() will trigger the code path which
> also prints "Dropping TSO6 features since no CSUM feature.\n".
> So TSO skbs will now be segmented in the stack. ]
>
> Surveying every driver that uses TSO_HEADER_SIZE:
>
> Driver | TSO6 | Checksum feature | Core guard fires? | Verdict
> ---------------|---------------------|-------------------|---------
> enetc | yes | NETIF_F_HW_CSUM | no | vulnerable
> bnxt | yes | NETIF_F_IPV6_CSUM | yes | safe
> nicvf | yes | NETIF_F_IPV6_CSUM | yes | safe
> otx2 | yes | NETIF_F_IPV6_CSUM | yes | safe
> fec | no | NETIF_F_IPV6_CSUM | n/a | safe
> mvneta | no | NETIF_F_IPV6_CSUM | n/a | safe
> mvpp2 | no | NETIF_F_IPV6_CSUM | n/a | safe
> mv643xx | no | NETIF_F_IP_CSUM | n/a | safe
> dpaa2 | no | NETIF_F_IPV6_CSUM | n/a | safe (*)
>
> (*) dpaa2 also uses a fixed-size kmalloc(TSO_HEADER_SIZE) per segment,
> so the identical overflow would apply if it ever gained NETIF_F_TSO6.
>
> The above survey is what influenced the decision to make a localized
> patch in enetc_features_check() rather than create a huge disturbance in
> the core, even though, IMO, TSO_HEADER_SIZE is a huge foot gun.
>
> Note that the LSO path (enetc_lso_map_hdr()) also copies the header into
> the tso_headers buffers for a reason I don't quite understand. However,
> I've excluded it from the discussion because when the GSO header size
> grows to weird sizes, it never gets anywhere near TSO_HEADER_SIZE before
> hardware stops being able to support this offload. There's an earlier
> limit at ENETC_TX_CSUM_MAX_L4_OFFSET at which it stops being able to
> perform HW TX checksumming (a dependency feature).
>
> Fixes: fb8629e2cbfc ("net: enetc: add support for software TSO")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> v1->v2:
> - drop word "super" from "GSO super-skb"
> - subtract VLAN_HLEN from maximum permissible GSO header size
> - stop blaming LSO
> ---
> drivers/net/ethernet/freescale/enetc/enetc.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index 6cc519eea5bd..2bc65cf6f508 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -1138,7 +1138,19 @@ netdev_features_t enetc_features_check(struct sk_buff *skb,
> return features;
> }
>
> - if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
> + if (!skb_is_gso(skb))
> + return features;
> +
> + /* In case NETIF_F_HW_VLAN_CTAG_TX is disabled, validate_xmit_vlan()
> + * has not yet run and a VLAN may still be in the hwaccel area, so we
> + * need to be one step ahead
> + */
> + if (enetc_lso_get_hdr_len(skb) > TSO_HEADER_SIZE - VLAN_HLEN) {
> + features &= ~NETIF_F_GSO_MASK;
> + return features;
> + }
> +
> + if (enetc_skb_uses_lso(priv, skb))
> return features;
>
> if (enetc_tso_count_descs(skb) >= priv->tx_bd_count)
> --
> 2.53.0
I should probably rework my series :
https://lore.kernel.org/netdev/20260403043237.3909226-1-edumazet@google.com/
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
2026-11-19 0:03 ` Eric Dumazet
@ 2026-11-19 8:44 ` Vladimir Oltean
2026-11-19 9:38 ` Eric Dumazet
0 siblings, 1 reply; 14+ messages in thread
From: Vladimir Oltean @ 2026-11-19 8:44 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev, Andrew Lunn, David S . Miller, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
Hi Eric,
On Thu, Nov 19, 2026 at 01:03:16AM +0100, Eric Dumazet wrote:
> > Bizarrely, enetc is the only affected driver, because the core
> > accidentally protects most other drivers against this bug in
> > gso_features_check(). There, we have this logic that saves the day:
> >
> > /* NETIF_F_IPV6_CSUM does not support IPv6 extension headers,
> > * so neither does TSO that depends on it.
> > */
> > if (features & NETIF_F_IPV6_CSUM &&
> > skb_has_ipv6_extension_hdr(skb))
> > features &= ~(NETIF_F_IPV6_CSUM | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4);
> >
> > enetc is the outlier because it only advertises the more complete
> > NETIF_F_HW_CSUM, so for it, this fixup does not clear the NETIF_F_TSO6
> > and NETIF_F_GSO_UDP_L4 bits.
> >
> > [ astute reviewers may ask: what if we disable NETIF_F_IPV6_CSUM at
> > runtime, via ethtool -k, so as to bypass this fixup, don't we make
> > all drivers vulnerable?
> > No, because netdev_fix_features() will trigger the code path which
> > also prints "Dropping TSO6 features since no CSUM feature.\n".
> > So TSO skbs will now be segmented in the stack. ]
> >
> > Surveying every driver that uses TSO_HEADER_SIZE:
> >
> > Driver | TSO6 | Checksum feature | Core guard fires? | Verdict
> > ---------------|---------------------|-------------------|---------
> > enetc | yes | NETIF_F_HW_CSUM | no | vulnerable
> > bnxt | yes | NETIF_F_IPV6_CSUM | yes | safe
> > nicvf | yes | NETIF_F_IPV6_CSUM | yes | safe
> > otx2 | yes | NETIF_F_IPV6_CSUM | yes | safe
> > fec | no | NETIF_F_IPV6_CSUM | n/a | safe
> > mvneta | no | NETIF_F_IPV6_CSUM | n/a | safe
> > mvpp2 | no | NETIF_F_IPV6_CSUM | n/a | safe
> > mv643xx | no | NETIF_F_IP_CSUM | n/a | safe
> > dpaa2 | no | NETIF_F_IPV6_CSUM | n/a | safe (*)
> >
> > (*) dpaa2 also uses a fixed-size kmalloc(TSO_HEADER_SIZE) per segment,
> > so the identical overflow would apply if it ever gained NETIF_F_TSO6.
> >
> > The above survey is what influenced the decision to make a localized
> > patch in enetc_features_check() rather than create a huge disturbance in
> > the core, even though, IMO, TSO_HEADER_SIZE is a huge foot gun.
>
> I should probably rework my series :
> https://lore.kernel.org/netdev/20260403043237.3909226-1-edumazet@google.com/
Do you disagree with my analysis that only enetc risks corruption? I mean,
for a second layer of defense, having tso_features_check() everywhere
TSO_HEADER_SIZE is used probably makes sense, but I opted for a targeted
fix because I couldn't justify it for the other drivers.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
2026-11-19 8:44 ` Vladimir Oltean
@ 2026-11-19 9:38 ` Eric Dumazet
2026-11-19 9:43 ` Vladimir Oltean
0 siblings, 1 reply; 14+ messages in thread
From: Eric Dumazet @ 2026-11-19 9:38 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, Andrew Lunn, David S . Miller, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
Le jeu. 19 nov. 2026 à 09:44, Vladimir Oltean
<vladimir.oltean@nxp.com> a écrit :
>
> Hi Eric,
>
> On Thu, Nov 19, 2026 at 01:03:16AM +0100, Eric Dumazet wrote:
> > > Bizarrely, enetc is the only affected driver, because the core
> > > accidentally protects most other drivers against this bug in
> > > gso_features_check(). There, we have this logic that saves the day:
> > >
> > > /* NETIF_F_IPV6_CSUM does not support IPv6 extension headers,
> > > * so neither does TSO that depends on it.
> > > */
> > > if (features & NETIF_F_IPV6_CSUM &&
> > > skb_has_ipv6_extension_hdr(skb))
> > > features &= ~(NETIF_F_IPV6_CSUM | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4);
> > >
> > > enetc is the outlier because it only advertises the more complete
> > > NETIF_F_HW_CSUM, so for it, this fixup does not clear the NETIF_F_TSO6
> > > and NETIF_F_GSO_UDP_L4 bits.
> > >
> > > [ astute reviewers may ask: what if we disable NETIF_F_IPV6_CSUM at
> > > runtime, via ethtool -k, so as to bypass this fixup, don't we make
> > > all drivers vulnerable?
> > > No, because netdev_fix_features() will trigger the code path which
> > > also prints "Dropping TSO6 features since no CSUM feature.\n".
> > > So TSO skbs will now be segmented in the stack. ]
> > >
> > > Surveying every driver that uses TSO_HEADER_SIZE:
> > >
> > > Driver | TSO6 | Checksum feature | Core guard fires? | Verdict
> > > ---------------|---------------------|-------------------|---------
> > > enetc | yes | NETIF_F_HW_CSUM | no | vulnerable
> > > bnxt | yes | NETIF_F_IPV6_CSUM | yes | safe
> > > nicvf | yes | NETIF_F_IPV6_CSUM | yes | safe
> > > otx2 | yes | NETIF_F_IPV6_CSUM | yes | safe
> > > fec | no | NETIF_F_IPV6_CSUM | n/a | safe
> > > mvneta | no | NETIF_F_IPV6_CSUM | n/a | safe
> > > mvpp2 | no | NETIF_F_IPV6_CSUM | n/a | safe
> > > mv643xx | no | NETIF_F_IP_CSUM | n/a | safe
> > > dpaa2 | no | NETIF_F_IPV6_CSUM | n/a | safe (*)
> > >
> > > (*) dpaa2 also uses a fixed-size kmalloc(TSO_HEADER_SIZE) per segment,
> > > so the identical overflow would apply if it ever gained NETIF_F_TSO6.
> > >
> > > The above survey is what influenced the decision to make a localized
> > > patch in enetc_features_check() rather than create a huge disturbance in
> > > the core, even though, IMO, TSO_HEADER_SIZE is a huge foot gun.
> >
> > I should probably rework my series :
> > https://lore.kernel.org/netdev/20260403043237.3909226-1-edumazet@google.com/
>
> Do you disagree with my analysis that only enetc risks corruption? I mean,
> for a second layer of defense, having tso_features_check() everywhere
> TSO_HEADER_SIZE is used probably makes sense, but I opted for a targeted
> fix because I couldn't justify it for the other drivers.
I agree with your analysis, I could not find another driver where
headers can exceed TSO_HEADER_SIZE today. Your targeted fix is fine
for net.
The other drivers are only safe as a side effect of the
NETIF_F_IPV6_CSUM rule in gso_features_check(), and none of them
bounds the header length in an ndo_features_check(). I might respin
the tso_features_check() series for net-next as a second layer
(calling vlan_features_check() this time), and enetc can be
converted on top.
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
2026-11-19 9:38 ` Eric Dumazet
@ 2026-11-19 9:43 ` Vladimir Oltean
0 siblings, 0 replies; 14+ messages in thread
From: Vladimir Oltean @ 2026-11-19 9:43 UTC (permalink / raw)
To: Eric Dumazet
Cc: netdev, Andrew Lunn, David S . Miller, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
On Thu, Nov 19, 2026 at 10:38:14AM +0100, Eric Dumazet wrote:
> Le jeu. 19 nov. 2026 à 09:44, Vladimir Oltean
> <vladimir.oltean@nxp.com> a écrit :
> > Do you disagree with my analysis that only enetc risks corruption? I mean,
> > for a second layer of defense, having tso_features_check() everywhere
> > TSO_HEADER_SIZE is used probably makes sense, but I opted for a targeted
> > fix because I couldn't justify it for the other drivers.
>
> I agree with your analysis, I could not find another driver where
> headers can exceed TSO_HEADER_SIZE today. Your targeted fix is fine
> for net.
>
> The other drivers are only safe as a side effect of the
> NETIF_F_IPV6_CSUM rule in gso_features_check(), and none of them
> bounds the header length in an ndo_features_check(). I might respin
> the tso_features_check() series for net-next as a second layer
> (calling vlan_features_check() this time), and enetc can be
> converted on top.
>
> Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Sounds good to me, and I mean, I do agree that TSO_HEADER_SIZE not being
enforced as a maximum offloadable size in the core is definitely a trap
that should be addressed. But at the same time, I do have tens of other
'net' patches queued up waiting for this to go in in a minimal form, so
I also appreciate not waiting for tso_features_check() :)
Thanks for the review!
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
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-23 0:28 ` netdev-bot+sashiko
1 sibling, 0 replies; 14+ messages in thread
From: netdev-bot+sashiko @ 2026-11-23 0:28 UTC (permalink / raw)
To: vladimir.oltean
Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni,
claudiu.manoil, wei.fang, xiaoning.wang, ioana.ciornei,
willemdebruijn.kernel, imx, linux-kernel
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The comment added in enetc_features_check()
(drivers/net/ethernet/freescale/enetc/enetc.c) explains the VLAN_HLEN…
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the patch sits
right on top of it and only partly addresses it.
--
net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
This patch changes enetc_features_check() so that it clears
NETIF_F_GSO_MASK when the L2+L3+L4 header length of a GSO skb exceeds
TSO_HEADER_SIZE - VLAN_HLEN. The stack then segments those skbs.
Otherwise enetc_map_tx_tso_buffs() would copy oversized headers into the
fixed 256-byte tso_headers slot. The example given is a large IPv6
Segment Routing Header set through setsockopt(IPV6_RTHDR).
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index 6cc519eea5bd3..2bc65cf6f5087 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -1138,7 +1138,19 @@ netdev_features_t enetc_features_check(struct sk_buff *skb,
> return features;
> }
>
> - if (!skb_is_gso(skb) || enetc_skb_uses_lso(priv, skb))
> + if (!skb_is_gso(skb))
> + return features;
> +
> + /* In case NETIF_F_HW_VLAN_CTAG_TX is disabled, validate_xmit_vlan()
> + * has not yet run and a VLAN may still be in the hwaccel area, so we
> + * need to be one step ahead
> + */
[Severity: Low]
This isn't a bug, but does this comment cover every case? enetc never
advertises NETIF_F_HW_VLAN_STAG_TX. enetc_pf_netdev_setup() (and
enetc_vf.c in the same way) only sets the CTAG variants:
ndev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER |
NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6 |
NETIF_F_GSO_UDP_L4;
Take an skb whose hwaccel tag is ETH_P_8021AD, for example from an
802.1ad VLAN upper, a tc vlan push with protocol 802.1ad, or an 802.1ad
bridge. For that skb, validate_xmit_vlan() always pushes the tag into
the packet after ndo_features_check has run, even when CTAG TX offload
is enabled:
net/core/dev.c:validate_xmit_vlan() {
...
if (skb_vlan_tag_present(skb) &&
!vlan_hw_offload_capable(features, skb->vlan_proto))
skb = __vlan_hwaccel_push_inside(skb);
...
}
The VLAN_HLEN subtraction is unconditional, so the code already handles
this. Suppose a later change follows the comment and applies the margin
only when NETIF_F_HW_VLAN_CTAG_TX is off. Couldn't an 802.1ad-tagged GSO
skb then write 4 bytes past the tso_headers slot again?
Could the comment mention the 802.1ad case as well?
> + if (enetc_lso_get_hdr_len(skb) > TSO_HEADER_SIZE - VLAN_HLEN) {
> + features &= ~NETIF_F_GSO_MASK;
> + return features;
> + }
[Severity: High]
This is a pre-existing issue, not introduced by this patch. It goes back
to fb8629e2cbfc ("net: enetc: add support for software TSO"), and it sits
right next to this check.
The new check only looks at header length. What happens to IPv6 GSO skbs
that carry extension headers but whose headers still fit in 252 bytes?
Examples are a Segment Routing Header with 1-10 segments, or any routing,
hop-by-hop or destination options header.
On hardware without ENETC_SI_F_LSO, such as LS1028A, these still go
through enetc_start_xmit()->enetc_map_tx_tso_buffs(). The software TSO
path does not seem able to build valid segments for them.
tso_build_hdr() in net/core/tso.c does not count the extension header
bytes in the IPv6 payload length:
iph->payload_len = htons(size + tso->tlen);
enetc_tso_complete_csum() builds the pseudo-header from the outer IPv6
header:
csum_final = csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
&ipv6_hdr(skb)->daddr,
len, ipv6_hdr(skb)->nexthdr, sum);
Here nexthdr is the extension header type (0, 43 or 60), not
IPPROTO_TCP or IPPROTO_UDP. With a routing header, daddr is the first
hop rather than the final destination.
Wouldn't every segment then leave with a short payload_len and a wrong
TCP/UDP checksum, so the receiver drops it?
An unprivileged user can reach this with setsockopt(IPV6_RTHDR). It can
also be triggered remotely when forwarding, because
ipv6_gro_receive()->ipv6_gro_pull_exthdrs() aggregates packets with
routing or destination options headers into GSO skbs that may egress on
enetc.
As the commit message notes, enetc does not benefit from the core guard
in gso_features_check(), because it only advertises NETIF_F_HW_CSUM:
if (features & NETIF_F_IPV6_CSUM &&
skb_has_ipv6_extension_hdr(skb))
features &= ~(NETIF_F_IPV6_CSUM | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4);
Would it make sense to clear NETIF_F_GSO_MASK in enetc_features_check()
for any IPv6 GSO skb with extension headers? The stack would then
segment these correctly. The remaining header lengths would be bounded
at roughly 14 + 4 + 60 + 60 bytes, which would also close the overflow
this patch targets.
skb_has_ipv6_extension_hdr() is static in net/core/dev.c, so this would
need a local check. One option is vlan_get_protocol(skb) ==
htons(ETH_P_IPV6) && skb_network_header_len(skb) != sizeof(struct
ipv6hdr).
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118235055.1225115-1-vladimir.oltean%40nxp.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 net 0/4] ENETC GSO fixes
2026-11-18 23:50 [PATCH v2 net 0/4] ENETC GSO fixes Vladimir Oltean
` (3 preceding siblings ...)
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 9:42 ` Eric Dumazet
4 siblings, 0 replies; 14+ messages in thread
From: Eric Dumazet @ 2026-11-19 9:42 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, Andrew Lunn, David S . Miller, Jakub Kicinski,
Paolo Abeni, Claudiu Manoil, Wei Fang, Clark Wang, Ioana Ciornei,
Willem de Bruijn, imx, linux-kernel
Le jeu. 19 nov. 2026 à 00:51, Vladimir Oltean
<vladimir.oltean@nxp.com> a écrit :
>
> Sashiko derailed me from "[PATCH v5 net 0/4] Fix short frame
> transmission in enetc":
> https://lore.kernel.org/netdev/20261021145314.1435049-1-vladimir.oltean@nxp.com/
>
> which also touches the driver GSO code path, so I'm making a detour
> to fix 3 unrelated issues there (which I could all reproduce using
> LLM-produced programs).
>
> The main highlight of this series is the introduction of
> .ndo_features_check() for enetc, which runs for every transmitted skb.
> Each patch makes its implementation more and more complex (and I'm not
> done...).
>
> These patches all assume that at .ndo_features_check() time,
> skb_shinfo(skb)->gso_segs is set properly. There might be issues there,
> see commit 67b0cca9ba88 ("net: validate xmit skbs in generic_xdp_tx()")
> which fixes one case which led to gso_segs reaching the driver while
> being zero. For some reason it was merged to net-next though.
>
> Running a bidirectional eno0 <-> swp0 forwarding of raw IPv4 64B packets
> (no GRO or GSO) on LS1028A-QDS rather than some micro-benchmark,
> I am not seeing a noticeable performance degradation. It is in the
> noise margin.
> Before: 7440 Kpps ingress, 586 Kpps egress
> After: 7440 Kpps ingress, 588 Kpps egress
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread