On Sat, 19 Sep 2026 11:37:45 -0400 Willem de Bruijn wrote:
> >     return skb_shinfo(skb)->gso_segs <= READ_ONCE(dev->gso_max_segs) &&
> > -          skb->len < netif_get_gso_max_size(dev, skb->protocol);
> > +          skb->len < netif_get_gso_max_size(dev, vlan_get_protocol(skb));
>
> If this change is needed, it is not new for this feature and should be
> a separate commit.

Okay, will do it in v3 as patch 1/5, with a Fixes tag.

> > +   if (!skb_is_gso(skb) || !skb_is_gso_tcp(skb) ||
> > +       skb->encapsulation || mss == GSO_BY_FRAGS ||
> > +       !skb_mac_header_was_set(skb) ||
> > +       !skb_transport_header_was_set(skb) ||
> > +       !skb_can_gso_resegment(skb, features))
> > +           return 0;
>
> Is this duplicating/extending skb_can_gso_resegment

Okay, v3 folds skb_can_gso_resegment() into skb_gso_resegment_max_segs():
one caller, so the checks stay in one list.

> > +   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. Consider how
> to make this less expensive.

Okay, v3 enters on

        if (unlikely(skb_is_gso(skb) && !(features & NETIF_F_GSO_MASK))) {

features is what netif_skb_features() returned a few lines above, and
gso_features_check() has already cleared the GSO bits for an over-limit
skb, so the common path reads two bits of a value which is already loaded.
An oversized skb then pays one __netif_skb_features(skb, false) call.
Could you take a look whether that is cheap enough?
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to