OSDN Git Service

Merge branch 'soreuseport-fix-broken-so_incoming_cpu'
authorPaolo Abeni <pabeni@redhat.com>
Tue, 25 Oct 2022 09:35:19 +0000 (11:35 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 25 Oct 2022 09:35:19 +0000 (11:35 +0200)
commit818a26048a292e290a6b76e3fe2174344824b3b7
treecfb7babb6a9d1450651386213f23fb9f68144011
parent71920a773e522b6a34bba957a3aacc99cefa3836
parent6df96146b2025e122447354daf66edbfa88e8a1e
Merge branch 'soreuseport-fix-broken-so_incoming_cpu'

Kuniyuki Iwashima says:

====================
soreuseport: Fix broken SO_INCOMING_CPU.

setsockopt(SO_INCOMING_CPU) for UDP/TCP is broken since 4.5/4.6 due to
these commits:

  * e32ea7e74727 ("soreuseport: fast reuseport UDP socket selection")
  * c125e80b8868 ("soreuseport: fast reuseport TCP socket selection")

These commits introduced the O(1) socket selection algorithm and removed
O(n) iteration over the list, but it ignores the score calculated by
compute_score().  As a result, it caused two misbehaviours:

  * Unconnected sockets receive packets sent to connected sockets
  * SO_INCOMING_CPU does not work

The former is fixed by commit acdcecc61285 ("udp: correct reuseport
selection with connected sockets").  This series fixes the latter and
adds some tests for SO_INCOMING_CPU.
====================

Link: https://lore.kernel.org/r/20221021204435.4259-1-kuniyu@amazon.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>