From: Alexander Duyck Date: Mon, 2 May 2016 16:38:12 +0000 (-0700) Subject: gso: Do not perform partial GSO if number of partial segments is 1 or less X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d7fb5a80492169cd737d51042f4ee03b09be0ef6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git gso: Do not perform partial GSO if number of partial segments is 1 or less In the event that the number of partial segments is equal to 1 we don't really need to perform partial segmentation offload. As such we should skip multiplying the MSS and instead just clear the partial_segs value since it will not provide any gain to advertise the frame as being GSO when it is a single frame. Signed-off-by: Alexander Duyck Signed-off-by: David S. Miller --- diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7a1d48983f81..b8dd2d2e2256 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3101,7 +3101,10 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, */ if (features & NETIF_F_GSO_PARTIAL) { partial_segs = len / mss; - mss *= partial_segs; + if (partial_segs > 1) + mss *= partial_segs; + else + partial_segs = 0; } headroom = skb_headroom(head_skb);