linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phi Nguyen <phind.uet@gmail.com>
To: Neal Cardwell <ncardwell@google.com>, David Miller <davem@davemloft.net>
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
Subject: Re: [PATCH v4] tcp: fix tcp_init_transfer() to not reset icsk_ca_initialized
Date: Tue, 6 Jul 2021 00:34:47 +0800	[thread overview]
Message-ID: <ea882927-a6f6-6d26-66bd-442d03ac3ea0@gmail.com> (raw)
In-Reply-To: <CADVnQynxFKthexWRFRGN_9enRt7cmgrNo7mpNOMpNVm_jJpt4w@mail.gmail.com>

On 7/4/2021 9:52 PM, Neal Cardwell wrote:
> 
> 
> On Sat, Jul 3, 2021 at 5:49 PM David Miller <davem@davemloft.net 
> <mailto:davem@davemloft.net>> wrote:
>  >
>  > From: Nguyen Dinh Phi <phind.uet@gmail.com <mailto:phind.uet@gmail.com>>
>  > 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.

      parent reply	other threads:[~2021-07-05 16:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03  9:34 [PATCH v4] tcp: fix tcp_init_transfer() to not reset icsk_ca_initialized Nguyen Dinh Phi
2021-07-03 21:49 ` David Miller
2021-07-04 14:03   ` Neal Cardwell
     [not found]   ` <CADVnQynxFKthexWRFRGN_9enRt7cmgrNo7mpNOMpNVm_jJpt4w@mail.gmail.com>
2021-07-05 16:34     ` Phi Nguyen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea882927-a6f6-6d26-66bd-442d03ac3ea0@gmail.com \
    --to=phind.uet@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=syzbot+f1e24a0594d4e3a895d3@syzkaller.appspotmail.com \
    --cc=ycheng@google.com \
    --cc=yhs@fb.com \
    --cc=yoshfuji@linux-ipv6.org \
    --cc=yyd@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).