From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.6 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7776AC07E95 for ; Sun, 4 Jul 2021 14:03:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60158613E5 for ; Sun, 4 Jul 2021 14:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229713AbhGDOGD (ORCPT ); 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-Google-Smtp-Source: ABdhPJytYsHbTrFOlrsisLYRSoTTuDDGUpSkgbxQLUklvl9NvDcJPMoaAHHy6mtBNB9vJmqcpiJooThRYrXLq62DZ+o= 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