vquic: use apple recvmsg_x - #22341
Conversation
|
Which would be better to add cmake/autotools build bits for this?
Either case I think this needs a rebase on master. ( |
A quick hack to use Apple's secret recvmsg_c call for receiving batches of UDP packets.
|
rebased. Do with this PR how you find the easiest. Maybe just take the patch into you own and we close this? |
|
Copilot reported issues when I run it over the build-PR (which has this PR verbatim): Also run it here, just in case. (edit: it's reporting two different issues in this run.) |
There was a problem hiding this comment.
Pull request overview
This PR adds an Apple-specific fast path for QUIC UDP I/O by using Apple’s undocumented recvmsg_x/sendmsg_x syscalls to send/receive batches of datagrams, aiming to reduce syscall overhead similarly to recvmmsg/sendmmsg on other platforms.
Changes:
- Detect Apple
recvmsg_x/sendmsg_xavailability and route QUIC send/recv through newsyscall(SYS_*msg_x, ...)implementations. - Adjust logging to reflect the actual send method used and unify trace output placement.
- Exclude UDP GRO parsing helpers on Apple when
*_msg_xis used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| while((rc = syscall(SYS_sendmsg_x, qctx->sockfd, &mmsg, batch, 0)) == -1 && | ||
| (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE)) | ||
| ; |
| failf(data, "QUIC: sendmsg_x() unexpectedly returned %d (errno=%d; %s)", | ||
| rc, SOCKERRNO, errstr); | ||
| result = CURLE_RECV_ERROR; | ||
| goto out; |
Using Apple's secret recvmsg_x and sendmsg_x syscalls for receiving/sending batches of UDP packets.
Since this uses undocumented calls, we'll need an "opt-in" configure/cmake option.