feat: use sendmmsg in linux, and increase parameter values while still remaining conservative#70
feat: use sendmmsg in linux, and increase parameter values while still remaining conservative#70richard-ramos wants to merge 1 commit intofix/variousfrom
sendmmsg in linux, and increase parameter values while still remaining conservative#70Conversation
…ining conservative
| msg_len: cuint | ||
|
|
||
| proc sendmmsg( | ||
| sockfd: SocketHandle, msgvec: ptr MMsgHdr, vlen: cuint, flags: cint |
There was a problem hiding this comment.
[nph] reported by reviewdog 🐶
| sockfd: SocketHandle, msgvec: ptr MMsgHdr, vlen: cuint, flags: cint | |
| sockfd: SocketHandle, msgvec: ptr MMsgHdr, vlen: cuint, flags: cint |
There was a problem hiding this comment.
Pull request overview
This PR optimizes packet sending on Linux by using sendmmsg (batch syscall) instead of per-packet sendmsg, and increases QUIC flow control window settings for both client and server while keeping them conservative.
Changes:
- Use Linux
sendmmsgsyscall to batch-send multiple packets in a single system call - Increase connection and stream flow control windows for both client and server contexts
- Remove unused imports (
sequninit,net)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lsquic/context/io.nim | Add sendmmsg FFI binding for Linux; refactor sendPacketsOut to use batch sending on Linux |
| lsquic/context/server.nim | Increase server flow control window settings |
| lsquic/context/client.nim | Increase client flow control window settings (more aggressively than server) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| let res = sendmmsg(SocketHandle(quicCtx.fd), addr msgs[0], nspecs, 0) | ||
| if res < 0: | ||
| return 0 |
There was a problem hiding this comment.
because we need to return how much data is written, and when there is error 0 is returned? but what should happen to this error?
sendmmsg in linux, and increase settings while still remaining conservativesendmmsg in linux, and increase parameter values while still remaining conservative
|
|
||
| let res = sendmmsg(SocketHandle(quicCtx.fd), addr msgs[0], nspecs, 0) | ||
| if res < 0: | ||
| return 0 |
There was a problem hiding this comment.
because we need to return how much data is written, and when there is error 0 is returned? but what should happen to this error?
No description provided.