soreuseport: Fix broken SO_INCOMING_CPU.
Status from this message: This series was applied to netdev/net-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest posting 2/22 patches 0 repliesApplied 2/2
- v2 posting 2/22 patches 1 replySuperseded
- v3 posting 1/21 patch 0 repliesApplied 1/1
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 posting 1/2 | 1 patch | 6 replies | Superseded | |
| v1 | 3 patches | 6 replies | Superseded |
Changes in v3 from the cover letter
* Rebase and resolve conflicts
Patches in v3 posting 2/2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | soreuseport: Fix socket selection for SO_INCOMING_CPU.include/ net/ net/ | +92 | 0 replies | Applied |
| 2/2 | selftest: Add test for SO_INCOMING_CPU.tools/ tools/ tools/ | +244 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 net-next 0/2] 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.
Changes:
v3:
* Rebase and resolve conflicts
v2: https://lore.kernel.org/netdev/[email protected]/
* patch 1
* Rename helper functions
* Remove unnecessary arg sk from '__' helpers
* Fix reuseport_update_incoming_cpu() logic
* patch 2
* Add test cases
* Change when to set SO_INCOMING_CPU
* Add/Remove non-SO_INCOMING_CPU socket
v1: https://lore.kernel.org/netdev/[email protected]/
Kuniyuki Iwashima (2):
soreuseport: Fix socket selection for SO_INCOMING_CPU.
selftest: Add test for SO_INCOMING_CPU.
include/net/sock_reuseport.h | 2 + net/core/sock.c | 2 +- net/core/sock_reuseport.c | 94 ++++++- tools/testing/selftests/net/.gitignore | 1 + tools/testing/selftests/net/Makefile | 1 + tools/testing/selftests/net/so_incoming_cpu.c | 242 ++++++++++++++++++ 6 files changed, 336 insertions(+), 6 deletions(-) create mode 100644 tools/testing/selftests/net/so_incoming_cpu.c
Signature · 1 line
2.30.2