Re: [PATCH net] tcp: fix TFO max_qlen accounting across reuseport migration
Eric Dumazet <[email protected]>
| Newsgroups | org.kernel.vger.netdev,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CANn89iL_NQq02FUfS6rT9+VRZ--UprWdBp-bG39T4BND+XcS7w@mail.gmail.com> |
On Wed, Aug 5, 2026 at 7:15 AM Kuniyuki Iwashima <[email protected]> wrote: > > On Sun, Aug 2, 2026 at 11:18 PM Jiayuan Chen <[email protected]> wrote: > > > > A listener's TCP_FASTOPEN max_qlen stops being accurate and lets through > > far more pending Fast Open requests than it was configured for. > > > > This only shows up with SO_REUSEPORT listener migration, where closing a > > listener hands its still-pending TFO children over to a surviving one. > > > > fastopenq.qlen is charged in tcp_fastopen_create_child() when the child > > is created and uncharged in reqsk_fastopen_remove() when the handshake > > completes. The uncharge follows rsk_listener of the request the child > > points at, and inet_reqsk_clone() has repointed the child at a new > > request owned by the new listener, so the ++ and the -- land on two > > different sockets. The new listener's qlen drifts negative and its > > limit no longer binds. > > > > Charge the new listener during migration, like reqsk_queue_migrated() > > already does for queue->young and queue->qlen. > > > > Fixes: 54b92e841937 ("tcp: Migrate TCP_ESTABLISHED/TCP_SYN_RECV sockets in accept queues.") > > Signed-off-by: Jiayuan Chen <[email protected]> > > Reviewed-by: Kuniyuki Iwashima <[email protected]> Reviewed-by: Eric Dumazet <[email protected]>