Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1523491imm; Fri, 27 Jul 2018 20:14:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdbuZk7DaiK2rg4/OoCe97ZKpKw/Xz7XFSlsrh1ztOQTC9zJMXfZ/uFWcT+5B0TgDF0cSrg X-Received: by 2002:a17:902:694a:: with SMTP id k10-v6mr8342662plt.166.1532747678256; Fri, 27 Jul 2018 20:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532747678; cv=none; d=google.com; s=arc-20160816; b=LWp5w6pFncDloWaDMmNWaJtJKmg/RUxXE4taVq9M3nTLIw54GGan4h6tjtEl2+f5vO lRltg3PgmIVBqnrdnj14CpfcpkEsGF0lLg8vOW9xK8nukWRmvCQh4spsYfWqeWUyCg3W 13+2rqT5GinODowyn0EaEnC0AfhtCOYpcgD4o4VcvhCXMeTOleNAYNLAJaJdK0shOaFY Tr3uCxtDY/LeWJTWInSG/icpgFf8E2iThzVzGoCXYDnHg91zDqxJhGRdjOD6vWBE24TZ M4lSnBTD1yyV60gRflWTThAL267LOtsN0/CZ4KYATDeP9OFuSXHOYCt4j435vytTyBVx sQwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=ZPXR33qs6O5Wu9AZBbuJIhlfYQJYZOynPDRzjJ3xVmk=; b=xnuQz4INRd8ihPnKGDgI0A0OFycSUpPsyzXu+kbpsDuEysrYAxZ0QBpmqXYVoBfQbM WraskBHkyUAvgSyUm6ywG2Af0uJDvUFnGvwMH2ozIoIPNQPEwUZT1qlYzB7Hs0zqksFT IfslgEChkzCSerLyWIf3+tqBaa2RtEkMSTOc/XiQF6GMUFwepsPx4nvsAgYY4tg+tkog 1THLPSDe/0pb5esO4hLAaX9QpNdVFqj4QrINkIVkDoY5O2G95b87y4a4Bwhja85OXMnm Tbaap4xS5DGYNo0R5lzreGUU5Dm4lCydDmx1FHFIgu7cPXttbejJBdYd09at/28npNK7 1mkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FB2SpV5M; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11-v6si4620746plo.144.2018.07.27.20.14.21; Fri, 27 Jul 2018 20:14:38 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=FB2SpV5M; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726004AbeG1EiS (ORCPT + 99 others); Sat, 28 Jul 2018 00:38:18 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:36572 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbeG1EiS (ORCPT ); Sat, 28 Jul 2018 00:38:18 -0400 Received: by mail-it0-f66.google.com with SMTP id p81-v6so10014874itp.1 for ; Fri, 27 Jul 2018 20:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZPXR33qs6O5Wu9AZBbuJIhlfYQJYZOynPDRzjJ3xVmk=; b=FB2SpV5MXzxZUAU42WjQctJcROzJaizqGmxn6ixKhVaZZl/RfaTUREVSH/yVIO8aUr aubx+lQGJpAThvobShtSJvbo+SAreFiA82V8DoybVMRyBBlwIB5Rj8gIDDt/vfGQJm8v zRy67Bxq2DgPUrJt91afSIRJGRKhAO+pPwr7zo0/sTlb8xQiAuKcvtZk6Us2XmP94umJ zFF7qxj5Iqvq22O0LKym7akvribVrwfDqPBaIm+edJqiZL24aVJ96sRBN/Ennd+n+Qlf CpZGfXCIw7tYy1/FASje1oe055NxjH708GZlBXnICjBfGZ3RjK6yVes8egeu6FFml924 8mog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZPXR33qs6O5Wu9AZBbuJIhlfYQJYZOynPDRzjJ3xVmk=; b=rCUKhRiphWGJI7XaW1ef4CQmUfQ8tR/K5Ne7e808hAEBjd0Bbxjn2CXJaEBxz6Hs4V VSriJzHuaNiX/XFFQ/3sHMnV7efbsdMbBwVp6F6uBg606TDxFR5ty1hLVgb6UNjQpMKe XaI5wjrUwVEaei0BrcvtaHnew4RvVzj98iW2h2qYu9/dVbR2mF6o074WqS4cW1gWNGp2 YoWGtdzO3AtaBwhWREpeNGZYn6jBppL1EkNFVgovuuzWwn+lZuHMvG+ghayX6NIhC/5w 48V7nHC9AUxAVstKn1abxlNTdP+xL18tyblJy4dZ2qjbpxi66l7fpppdBbQWBAC0jknU HnOA== X-Gm-Message-State: AOUpUlFiTZ7j8pOH771yfP1jQL5FwTQQGEgWqkqT/XbaZSDXtqYzEyz3 9Ngq+S7LoRUopOuZF0260Ieo9HRGVsfz1bGxY5BpQg== X-Received: by 2002:a24:7414:: with SMTP id o20-v6mr7729248itc.116.1532747610973; Fri, 27 Jul 2018 20:13:30 -0700 (PDT) MIME-Version: 1.0 References: <1532746900-11710-1-git-send-email-laoar.shao@gmail.com> <1532746900-11710-2-git-send-email-laoar.shao@gmail.com> In-Reply-To: <1532746900-11710-2-git-send-email-laoar.shao@gmail.com> From: Eric Dumazet Date: Fri, 27 Jul 2018 20:13:19 -0700 Message-ID: Subject: Re: [PATCH net-next 2/2] tcp: propagate GSO to the new skb built in tcp collapse To: Yafang Shao Cc: David Miller , netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 27, 2018 at 8:02 PM Yafang Shao wrote: > > Currently the collapsed SKB doesn't propagate the GSO information to the > new SKB. > The GSO should be propagated for better tracking, i.e. when this SKB is > dropped we could know how many network segments are dropped. What is "the GSO" ? > > Signed-off-by: Yafang Shao > --- > net/ipv4/tcp_input.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index 90f83eb..af52e4e 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -4893,6 +4893,8 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb) > if (!nskb) > break; > > + skb_shinfo(nskb)->gso_size = skb_shinfo(skb)->gso_size; > + skb_shinfo(nskb)->gso_type = skb_shinfo(skb)->gso_type; Why gso_size and gso_type are important ? Where later in the stack these values are used ? > memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); > #ifdef CONFIG_TLS_DEVICE > nskb->decrypted = skb->decrypted; > @@ -4906,18 +4908,24 @@ void tcp_rbtree_insert(struct rb_root *root, struct sk_buff *skb) > > /* Copy data, releasing collapsed skbs. */ > while (copy > 0) { > - int offset = start - TCP_SKB_CB(skb)->seq; > int size = TCP_SKB_CB(skb)->end_seq - start; > + int offset = start - TCP_SKB_CB(skb)->seq; > > BUG_ON(offset < 0); > if (size > 0) { > - size = min(copy, size); > + if (copy >= size) > + skb_shinfo(nskb)->gso_segs += > + max_t(u16, 1, skb_shinfo(skb)->gso_segs); > + else > + size = copy; > + So... what happens if copy was partial ? Your patch does not really fix the uncertainty, it merely shifts it a bit.