Skip to content

vquic: use apple recvmsg_x - #22341

Closed
icing wants to merge 6 commits into
curl:masterfrom
icing:apple-rcvmsg_x
Closed

vquic: use apple recvmsg_x#22341
icing wants to merge 6 commits into
curl:masterfrom
icing:apple-rcvmsg_x

Conversation

@icing

@icing icing commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the tests label Jul 17, 2026
@vszakats vszakats added the appleOS specific to an Apple operating system label Jul 18, 2026
Comment thread lib/vquic/vquic.c
@vszakats

Copy link
Copy Markdown
Member

Which would be better to add cmake/autotools build bits for this?

  • merging as-is, then I do it in a next PR?
  • I do it stacked on this in a PR now, then merge this, rebase, and merge the build part when both are ready.

Either case I think this needs a rebase on master. (git am and patch -p1 both fail ATM.)

@github-actions github-actions Bot added the HTTP/3 h3 or quic related label Jul 28, 2026
@icing

icing commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

rebased. Do with this PR how you find the easiest. Maybe just take the patch into you own and we close this?

@vszakats

vszakats commented Jul 28, 2026

Copy link
Copy Markdown
Member

Copilot reported issues when I run it over the build-PR (which has this PR verbatim):
#22417 (review)

Also run it here, just in case. (edit: it's reporting two different issues in this run.)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_x availability and route QUIC send/recv through new syscall(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_x is used.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/vquic/vquic.c
Comment thread lib/vquic/vquic.c
Comment on lines +198 to +200
while((rc = syscall(SYS_sendmsg_x, qctx->sockfd, &mmsg, batch, 0)) == -1 &&
(SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
;
Comment thread lib/vquic/vquic.c
Comment on lines +212 to +215
failf(data, "QUIC: sendmsg_x() unexpectedly returned %d (errno=%d; %s)",
rc, SOCKERRNO, errstr);
result = CURLE_RECV_ERROR;
goto out;
@vszakats vszakats closed this in 079a11b Jul 29, 2026
@vszakats

Copy link
Copy Markdown
Member

Merged via 079a11b #22417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

appleOS specific to an Apple operating system HTTP/3 h3 or quic related tests

Development

Successfully merging this pull request may close these issues.

3 participants