Thread (27 messages) 27 messages, 5 authors, 3d ago

Re: [PATCH net-next v2 3/4] net: core: resegment oversized TCP GSO skbs

From: Paolo Abeni <pabeni@redhat.com>
Date: 2026-09-24 14:02:21

On 9/19/26 17:37, Willem de Bruijn wrote:
quoted
@@ -4088,10 +4168,29 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
  	if (unlikely(!skb))
  		goto out_null;
  
-	if (netif_needs_gso(skb, features)) {
+	/*
+	 * An oversized skb loses its GSO feature bits and is segmented
+	 * down to MSS sized skbs below.  A TCP skb can instead be split
+	 * into GSO skbs which do fit the device, so keep the bits and
+	 * bound the resegmentation.  The features computed without the
+	 * limit checks say whether the device offloads the GSO type at
+	 * all.
+	 */
+	if (skb_is_gso(skb) && skb_is_gso_tcp(skb) && !skb->encapsulation &&
+	    !gso_within_device_limits(skb, dev)) {
+		netdev_features_t offload = __netif_skb_features(skb, false);
+
+		resegment_max_segs =
+			skb_gso_resegment_max_segs(skb, dev, offload);
+		if (resegment_max_segs)
+			features = offload;
+	}
+
This is a lot to put in the hot path for a rare use case. 
+1
Consider how to make this less expensive.
I think that performing all the resegs check only in the

	netif_needs_gso(skb, features)

case would address this concern.

/P
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help