TCP flow state tracking should be lockless, if possible
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- networking, performance
Research direction
Start by locating the fastpath TCP flow state update guarded by KMutex and trace how Rx and Tx packet processing reach it. Review TcpState transitions and counter updates, then determine whether the proposed compare-and-swap approach preserves correctness under concurrent access. Done means TCP state remains correct without per-flow mutex contention and the fastpath performance improves.
Written by the indexing model from the issue text.
Description
For TCP flows, once a fastpath entry has been acquired we need to update the TCP state based on the flags seen in a packet. Today this is guarded using a KMutex<T>, which ends up as a place where contention can arise for a single flow. Mainly, this is because the Rx packet processing and Tx packet processing are going to be happening on different threads unless we get very lucky with squeue bindings.
Outright removing the TCP state gets us around 500 Mbps, but I think in general we do want to keep it in place. My thinking here is that most state transitions are going to be trivial: e.g., moving from TcpState::Established to itself, and incrememting some counters. Everything else could be probably handled by computing the transform, performing a compare-and-swap between the old and target states, and then looping those steps if the comparison fails.
- Dominant language
- Rust
- Stars
- 77
- Forks
- 11
- Avg merge
- 9d 20h
- Merged PRs (30d)
- 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from oxidecomputer/opte
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
oxidecomputer/opte#1052 ·
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
oxidecomputer/opte#341 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
oxidecomputer/opte#1035 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
oxidecomputer/opte#996 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
oxidecomputer/opte#979 · 1 comment ·
All issues in oxidecomputer/opte
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100