<div dir="ltr"><br><br>On Sat, Jul 3, 2021 at 5:49 PM David Miller <<a href="mailto:davem@davemloft.net">davem@davemloft.net</a>> wrote:<br>><br>> From: Nguyen Dinh Phi <<a href="mailto:phind.uet@gmail.com">phind.uet@gmail.com</a>><br>> Date: Sat,  3 Jul 2021 17:34:17 +0800<br>><br>> > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c<br>> > index 7d5e59f688de..855ada2be25e 100644<br>> > --- a/net/ipv4/tcp_input.c<br>> > +++ b/net/ipv4/tcp_input.c<br>> > @@ -5922,7 +5922,6 @@ void tcp_init_transfer(struct sock *sk, int bpf_op, struct sk_buff *skb)<br>> >               tp->snd_cwnd = tcp_init_cwnd(tp, __sk_dst_get(sk));<br>> >       tp->snd_cwnd_stamp = tcp_jiffies32;<br>> ><br>> > -     icsk->icsk_ca_initialized = 0;<br>> >       bpf_skops_established(sk, bpf_op, skb);<br>> >       if (!icsk->icsk_ca_initialized)<br>> >               tcp_init_congestion_control(sk);<br>><br>> Don't you have to make the tcp_init_congestion_control() call unconditional now?<div><br></div><div>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:</div><div><br></div><div>-       icsk->icsk_ca_initialized = 0;<br>        bpf_skops_established(sk, bpf_op, skb);</div><div>+       /* Initialize congestion control unless a BPF op initialized it already: */</div><div>        if (!icsk->icsk_ca_initialized)<br>                tcp_init_congestion_control(sk);<br></div><div><br></div><div>neal</div><div><br></div></div>