Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3950043pxv; Mon, 5 Jul 2021 09:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKyXIEYG0AtQh3EvQvEWWs+5J99GLuoPOH2IyaCxPrDPe1BG686ZUd1jm+LEKnnBdDJfw1 X-Received: by 2002:aa7:d7ca:: with SMTP id e10mr10780667eds.40.1625502988176; Mon, 05 Jul 2021 09:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625502988; cv=none; d=google.com; s=arc-20160816; b=w0+zVsCDLr+lax95Amz5vTyHEZa+BVJYMsUgLkYng/iauoZucPDqrP4m38+pvaxxSD Ib0f/W61/4hiHRiELn910+5RwRwAF9FUjYCwM+lqcl8gHarvZpVbzaxoGSo5XygxYl9W 8LeOOTFOcNKeozRPr1DAgz2qOxR32yAicojIqm07WohhsZ8YLdihpbxqj6WbKddnYWp4 NLzEQjDceUMtIqm0ztCQdRDLA4bqNuaQAghTl9WOytG6i/cwW0frxrskZTQs/XUunkDG pP+7ZcaOL9ydioHnMarJG36bUUVOzIcy9Tbl9WIy/+xpGQc/lw93v2pCYleDcQ+oskfn F5iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=fJA+d5ID8q3IsTw9va0CZTFXOsFZE3rsEkxwpk4NWbM=; b=okKu/lqBRkSfw5oG7UdwoAUjAiPX/4AqR/OvzyUCH+ajO0Cw6nJ/cCUuIvnhtHYDbB jr/viP1XWpuDTmheZ2/fRWQs+WlVFEqMqdbR8vDmFWEoBnLRAM0mSSdASxEBrXrQlr8F dyeFEAMIsVALBdoJfM1K7r0Dewf1O3C6lxO92ZFjjlt8o5C3FGgp6DpcMPnDewr+56Je ZDhKKOrEsaIhJblknmVR9NlMu8wIKbL4nnAOsY3WPcSeWl3+xg8EX7XqakEgGw0pD2HW 8VnWU2XhOeb6xscRPYejWwlrKiin4yxcMlpP0HaHZCDUJuuz0Jk4P0l6AxUG8Eu2LxbA P0AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H5V1Lk+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si10960858ejb.555.2021.07.05.09.36.04; Mon, 05 Jul 2021 09:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H5V1Lk+c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbhGEQhl (ORCPT + 99 others); Mon, 5 Jul 2021 12:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbhGEQhk (ORCPT ); Mon, 5 Jul 2021 12:37:40 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED4DC06175F; Mon, 5 Jul 2021 09:35:03 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id b14-20020a17090a7aceb029017261c7d206so9045180pjl.5; Mon, 05 Jul 2021 09:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fJA+d5ID8q3IsTw9va0CZTFXOsFZE3rsEkxwpk4NWbM=; b=H5V1Lk+cSTzjUoH3HLe+PiPcr3U0ePf5/obcZHzGbuX7ko73wrzWJjIwZqtChvRk8c 0J5s53u19WPJbISAFqiiwhenCJfGvK60bF4NXJLlSZ2ZWTfdTSrxZRIS0vbaxYUpjap6 cQzWRzTdvXZpj13UQN6J5m0lcyTx5IpjM6WR1Vs+272JXWAoZCKObgtKKq7d2Y78BGXm nNKK84pHhXzzYtjSOq5syjuURF5JVc9Xy4EpCboP7VIww4rebJhfr+PeOH5AipVzzbNh qx6wCnL4YchmfCJW4WRKN3A1vxwX7ao6E5brYcwMBJ4JsmyCipHECJP+lyxqvGeXkS/I c4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fJA+d5ID8q3IsTw9va0CZTFXOsFZE3rsEkxwpk4NWbM=; b=hdsHuKjlRI8nolP+iukEC/vZoM/3YTkxJG/aMmR+49X3xsdgjTm4f2LDCp501GDSTc TqQNB6rDmj8BH6U8kJP8vizyGtxwsBc9jv1O8d61AxEN6pd12w1IJecVDvSq84tnIm3H 5c6hqi6QUF85wpQi/CiuAHSW1PhX53gX3NNN5J+xgVNCUbFRUfz8oApHRYm/BNciucqh ofwhZAWbRHn0oTgL84C2+wiRZhcJO+IhKnbZUeI4QynmWzETLGs3Lboe56ttFCv2jqL6 GvyGhsKSv3LWrhEnWcOD7/jc39xQkZ7HP6cGOQiSUfBwD8eTjKAG5VlZMFQaUQBUCxFQ 2O0A== X-Gm-Message-State: AOAM532QEpvZfplFejZ8zT6tlc3UTGAIcI/MZ49htWsZLO0ronVKLgp4 rECSnbxTH9ar02kOm6EwnME= X-Received: by 2002:a17:90a:f16:: with SMTP id 22mr21345pjy.38.1625502903374; Mon, 05 Jul 2021 09:35:03 -0700 (PDT) Received: from [192.168.93.106] (bb42-60-144-185.singnet.com.sg. [42.60.144.185]) by smtp.gmail.com with ESMTPSA id u21sm13118250pfh.163.2021.07.05.09.34.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Jul 2021 09:35:02 -0700 (PDT) Subject: Re: [PATCH v4] tcp: fix tcp_init_transfer() to not reset icsk_ca_initialized To: Neal Cardwell , David Miller Cc: yhs@fb.com, edumazet@google.com, yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, ycheng@google.com, yyd@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, syzbot+f1e24a0594d4e3a895d3@syzkaller.appspotmail.com References: <20210703093417.1569943-1-phind.uet@gmail.com> <20210703.144945.1327654903412498334.davem@davemloft.net> From: Phi Nguyen Message-ID: Date: Tue, 6 Jul 2021 00:34:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/4/2021 9:52 PM, Neal Cardwell wrote: > > > On Sat, Jul 3, 2021 at 5:49 PM David Miller > wrote: > > > > From: Nguyen Dinh Phi > > > Date: Sat,  3 Jul 2021 17:34:17 +0800 > > > > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > > > index 7d5e59f688de..855ada2be25e 100644 > > > --- a/net/ipv4/tcp_input.c > > > +++ b/net/ipv4/tcp_input.c > > > @@ -5922,7 +5922,6 @@ void tcp_init_transfer(struct sock *sk, int > bpf_op, struct sk_buff *skb) > > >               tp->snd_cwnd = tcp_init_cwnd(tp, __sk_dst_get(sk)); > > >       tp->snd_cwnd_stamp = tcp_jiffies32; > > > > > > -     icsk->icsk_ca_initialized = 0; > > >       bpf_skops_established(sk, bpf_op, skb); > > >       if (!icsk->icsk_ca_initialized) > > >               tcp_init_congestion_control(sk); > > > > Don't you have to make the tcp_init_congestion_control() call > unconditional now? > > I think we want to keep it conditional, to avoid double-initialization > if the BPF code sets the congestion control algorithm and initializes > it. But that's relatively new and subtle, so it might be nice for this > patch to add a comment about that, since it's touching this part of the > code anyway: > > -       icsk->icsk_ca_initialized = 0; >         bpf_skops_established(sk, bpf_op, skb); > +       /* Initialize congestion control unless a BPF op initialized it > already: */ >         if (!icsk->icsk_ca_initialized) >                 tcp_init_congestion_control(sk); > > neal > I will make a new version with your comment. Thank you very much for helping.