Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3078096pxv; Sun, 4 Jul 2021 07:05:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/m8P5j3BZbVQkx7jNbVqPJbJZDAF3ZNIuLL336JYyQ6EFaKGlJVTjZ/AlqQJ/XbNttWEB X-Received: by 2002:a05:6602:1645:: with SMTP id y5mr8200128iow.7.1625407532841; Sun, 04 Jul 2021 07:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625407532; cv=none; d=google.com; s=arc-20160816; b=Zt9JrptwP4J5oceYE1I8A/8GlioAMGL5a3RqvM29jXrd2NU7DATaM5gAKTcepysqxi FvctXV2u4IkjYKdQ/9eIg1gZK6l6TB4EWOjmRpsxg3dwhxC0KC3xdOQycTM+S7P/BXtp zMc7u2Slh9E7XaLgJWArY95ig/bf+XyBO6lZWPlaSUo9ZSZNnSWvZx3aavVm7/MSw1AV I3DrRPNZRZDDrJZtbwgMCUyh4qo3Ytck1HEVzH5tydzEXxV2LzPm045sopUAi2CLaaVy PEwp7pNw323HC+5VvdXBEZcDAgH/BdrCz3WoG9NpEo4cD16qpHVcs8kQAGUbzElMNLL0 rWrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gBspm/BlVrYCvD2/PgUixtAdfPPqsF72ctK925L56Wc=; b=LFZJpCbaLodoGV/6pZIaiXq3x3BUSyygkQ0wimYRK++4szsm/HLMKse6MRxaJwx7Vh Tft1gmPbvtucZ9Z1KB48cV7+xU3PMKf+VYqpBtsl6G0D3/IAe/T1tUMAtuQPsztKPAls RONZ5Gx1EVv/9RkoY2lg+7QkrfOFhCScsydnF+fqE4faScHuqUIgGBtU6tus/xj3VOb1 R42B+evi13imS1fZchhv2rU4Uj2PwVi2txJe47LT1R6HBKHefxwlpcjCLZ/7Frnr+O5D vXdrdbHG5URha8/kPCQJaLZLoRcxNA77kxn6ykzRojB22UwCEIgpQKwRWrPVKdORBa7V P73g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=lc1Lmfjc; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si10148554ioq.102.2021.07.04.07.05.20; Sun, 04 Jul 2021 07:05:32 -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=@google.com header.s=20161025 header.b=lc1Lmfjc; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229672AbhGDOGD (ORCPT + 99 others); Sun, 4 Jul 2021 10:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbhGDOGC (ORCPT ); Sun, 4 Jul 2021 10:06:02 -0400 Received: from mail-vk1-xa29.google.com (mail-vk1-xa29.google.com [IPv6:2607:f8b0:4864:20::a29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F01AAC061762 for ; Sun, 4 Jul 2021 07:03:25 -0700 (PDT) Received: by mail-vk1-xa29.google.com with SMTP id k140so3211237vkk.6 for ; Sun, 04 Jul 2021 07:03:25 -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=gBspm/BlVrYCvD2/PgUixtAdfPPqsF72ctK925L56Wc=; b=lc1LmfjctBzKJNjKLR7QVzRXzvkDICIDyMrYxrN6y5PwKmmAy6WJMPG5oIp+mrsbE3 XQ2/F31H5tEilzpFWH+jZPPxkOLpsutS/DpuKwoUzY9qDxb2ipYStnabEPwNTNSwEVHz Ko9YLgIXfMIRjbRF4uOgoFZ7hZ+bJdcZMJ0urItEc619PEEx1ZAO0l3c+Bzdj0S1/SnM Qt98R3v/DaEi0/MPNkDbAWkmam24FQHrhUBsY9goYzCPST14diqxaFcm3b2yvRykULGZ oxFwXcxsoXIz+ia5Lk3MsPVxAGSquH9myTASmYxsdSEkGsa+1kalucIIT2GGU+swgI5A N99w== 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=gBspm/BlVrYCvD2/PgUixtAdfPPqsF72ctK925L56Wc=; b=nJQtON9qD0mpfnoFbjE64MKIKPS4vsn18zZgUq7uthIRTho7hncJ0Ih14vWzI5nHYl eak49dcsGBeXUeB9ZebBkZx7TA9zzxAOJAJw/LoQ8NPAx93v6DoO9tWceR/y9y1h2HHv holinwli70KuAT8wUwT5m+YaP4FL3a0WVLML1CvwlUskB+hGU8kUaTOYUrf+K4VoKQJn 7DD8hId3xYa6h7L9B8N+Reex1FR+NsgI0XeAGTHH2JoekuS2JySFvt4z9SHaqXAThgjG aq1GpW8eqDmjhqxXRH1rgNYcb74RNW8l4HmDZ+S6KFpFVZqPV4H4gjVAg115p0fUbJLb HTqw== X-Gm-Message-State: AOAM530X6ogHJimrpfTOKSeIs59WP34w5z3PI+isDQz8APYz9klQkTDo PSPpnqTe9h0uPt3vv1e8wY/skqrrJd4coGjNlQM5dA== X-Received: by 2002:a1f:dfc1:: with SMTP id w184mr5658047vkg.17.1625407404796; Sun, 04 Jul 2021 07:03:24 -0700 (PDT) MIME-Version: 1.0 References: <20210703093417.1569943-1-phind.uet@gmail.com> <20210703.144945.1327654903412498334.davem@davemloft.net> In-Reply-To: <20210703.144945.1327654903412498334.davem@davemloft.net> From: Neal Cardwell Date: Sun, 4 Jul 2021 10:03:08 -0400 Message-ID: Subject: Re: [PATCH v4] tcp: fix tcp_init_transfer() to not reset icsk_ca_initialized To: David Miller Cc: phind.uet@gmail.com, 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 BPF initialized it already: */ if (!icsk->icsk_ca_initialized) tcp_init_congestion_control(sk); neal