Skip to content

mctp-estack: Don't hold a lock to send messages #51

Closed
mkj wants to merge 0 commit into
CodeConstruct:mainfrom
mkj:pr/no-sender-lock
Closed

mctp-estack: Don't hold a lock to send messages #51
mkj wants to merge 0 commit into
CodeConstruct:mainfrom
mkj:pr/no-sender-lock

Conversation

@mkj
Copy link
Copy Markdown
Member

@mkj mkj commented May 5, 2026

send_message() was holding a blocking lock across the whole
send sequence (until the queue was full). This is currently a
CriticalSectionMutex so would block interrupts.

Instead we can poll until a sender is available. forward_packet() is
now made async. Any waits will be short, until a concurrent
send_message() completes or runs out of queue to copy into.

@mkj
Copy link
Copy Markdown
Member Author

mkj commented May 5, 2026

Leaving this as Draft until I've tested on real hardware. I'm confident it's correct though.

@mkj mkj force-pushed the pr/no-sender-lock branch 2 times, most recently from 67e6ee8 to 0b1081f Compare May 5, 2026 06:04
@mkj mkj marked this pull request as ready for review June 3, 2026 01:36
@mkj
Copy link
Copy Markdown
Member Author

mkj commented Jun 3, 2026

Tested OK with usbnvme mctp-bench

@mkj mkj closed this Jun 3, 2026
@mkj mkj force-pushed the pr/no-sender-lock branch from 0b1081f to 5a7b906 Compare June 3, 2026 01:38
@mkj
Copy link
Copy Markdown
Member Author

mkj commented Jun 3, 2026

Merged to main

@mkj mkj deleted the pr/no-sender-lock branch June 3, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant