Re: [PATCH net-next v2] tcp: propagate gso_segs to the new skb built in tcp collapse

From: David Miller
Date: Tue Aug 07 2018 - 15:32:28 EST

From: Yafang Shao <laoar.shao@xxxxxxxxx>
Date: Sun, 5 Aug 2018 18:25:07 +0800

> The gso_segs of the new built SKB in tcp collapse is inited to 0,
> that makes us hard to know the accurate segments number of this new SKB.
> We'd better propagate the gso_segs of the collapsed SKB to the new built
> one, so when this SKB is dropped (for example when doing tcp prune) the
> sk_drops will be added to the correct value.
> If the collapsed SKB is fully copied to the new built one, we just add its
> gso_segs to the new SKB.
> While if the collapsed SKB is partially copied to the new built SKB,
> we have to caculate how many segments are copied.
> Furthemore, we have to reset the gso_segs of this SKB if is is partially
> copied, so in the next round when the left segments are copied it could
> propagate the correct value.
> Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>

Eric, please review.

If partial copies are common, I wonder how much sense it makes to try to
avoid the DIV_ROUND_UP() operations.