Thread (5 messages) 5 messages, 4 authors, 2021-07-05

Re: [PATCH v4] tcp: fix tcp_init_transfer() to not reset icsk_ca_initialized

From: Phi Nguyen <hidden>
Date: 2021-07-05 16:35:06
Also in: bpf, lkml, netdev

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.
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help