Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp23306imm; Tue, 7 Aug 2018 13:10:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeR5obA5+aPL7xSAehi6Dw+5L25Hrx/hXAmQ84C3X0Kojwm/kKN7L3d4VVrKBWLpy1r2Vwj X-Received: by 2002:a17:902:8601:: with SMTP id f1-v6mr7271552plo.61.1533672621533; Tue, 07 Aug 2018 13:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533672621; cv=none; d=google.com; s=arc-20160816; b=hA1hW4GRBM+rqeg/4TBxehkMbFHV6ZSbXd0qO4eR1XZG47t8MLTGMBt9CqzW0uFVb8 HZdg0Z8bgOJfMkQQhRqhrLv4lVXZVVanG0BvpV2M3ITyOj83RohWE/ZNrn5C5fv7uES7 PuBNmPHX/uapbL5vQnQMZoNw94hp9eEDy564fODidz45xPhvaPQAHJ++gi97Pqm3eS5u 5eLN0pPuXtG3uHr1n1z52TetUO7o3nJNoq7gACICugZvBJkcKMJoX7UYgsdY937u5KG+ ebt54IRNDqbrJZ9K9PkE14YNehkKaS9Dd3m5UovdRAZRjaqgKYnrFakqUy9Ybw8m50z/ 2Wsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=GYXSAg8WZPMrUgvBUsG53wLolQ6Q1W2qgnAY365BWcg=; b=Jk9d04GwDOsvJZ5TwNxzx3v2WNOi81gg7c6x+fX72WjDIrDAp7EN9yhGBySexeqapR fMsQUV+ovNsgr7Q0O0o7aDSPdPeRjJuOa9lX8sqSJwCyCWlqs9ryXJ0OovuipFVFVFp8 seKLW75QGfen5PeMYTKHmpt88qF60GDJvKFqKAeLH6uPOdorWKF98iTY8qPOHnvNnkj9 1REyNHJ6abBfryf47IJXGeqiVvr8OnykvyZVY9VmeAaaQVtsknj31TgrvoMT4L/lAkYa HNnGm4rzapXjzAWl0tx3YPhSvRkeDxM/udjpqScKB5qbdMkgFfSgFP6YcgIjqyJH5K4w BAsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23-v6si1837076pgd.47.2018.08.07.13.10.06; Tue, 07 Aug 2018 13:10:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390198AbeHGVsT (ORCPT + 99 others); Tue, 7 Aug 2018 17:48:19 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:49144 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388581AbeHGVsT (ORCPT ); Tue, 7 Aug 2018 17:48:19 -0400 Received: from localhost (71-36-117-41.ptld.qwest.net [71.36.117.41]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 0BB9E13EABC15; Tue, 7 Aug 2018 12:32:26 -0700 (PDT) Date: Tue, 07 Aug 2018 12:32:25 -0700 (PDT) Message-Id: <20180807.123225.174635984138364812.davem@davemloft.net> To: laoar.shao@gmail.com Cc: edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2] tcp: propagate gso_segs to the new skb built in tcp collapse From: David Miller In-Reply-To: <1533464707-11777-1-git-send-email-laoar.shao@gmail.com> References: <1533464707-11777-1-git-send-email-laoar.shao@gmail.com> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 07 Aug 2018 12:32:26 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yafang Shao 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 Eric, please review. If partial copies are common, I wonder how much sense it makes to try to avoid the DIV_ROUND_UP() operations.