Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect UDP sockets. #4270

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

jellefoks
Copy link
Member

@jellefoks jellefoks commented Oct 15, 2024

Allow Cobalt to connect UDP sockets. This saves kernel CPU time. In the download
benchmark page, this results in ~7% higher achieved bandwidth and ~5% less total
CPU usage.

Since this will also detect unreachable IP networks sooner, it may also help with connection latency in some networks.

b/373726636
b/205134049

@jellefoks jellefoks force-pushed the http3_opts_part_one_b_connect branch 3 times, most recently from 3037478 to db57bfe Compare October 15, 2024 23:14
@jellefoks jellefoks force-pushed the http3_opts_part_one_b_connect branch from db57bfe to 3161990 Compare October 15, 2024 23:31
Copy link
Member

@kaidokert kaidokert left a comment

Choose a reason for hiding this comment

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

lgtm - questions /nitpicks nonwithstanding. Great improvement if this proves out !

@kaidokert

This comment was marked as resolved.

@jellefoks jellefoks force-pushed the http3_opts_part_one_b_connect branch from 3161990 to d58a033 Compare October 15, 2024 23:41
Allow Cobalt to connect UDP sockets. This saves kernel CPU time. In the download
benchmark page, this results in ~7% higher achieved bandwidth and ~5% less total
CPU usage.
@kaidokert
Copy link
Member

Submitting - the test failures are due to IPv6 and prior build breakage on devices. We'll need to fix those separately

@kaidokert kaidokert merged commit d955af2 into youtube:25.lts.1+ Oct 16, 2024
586 of 638 checks passed
jellefoks added a commit to jellefoks/cobalt that referenced this pull request Oct 16, 2024
Since youtube#4270, UDP socket connections are no longer
silently ignored. Starboard can not return ERR_ADDRESS_UNREACHABLE and will
instead return ERR_FAILED.

This changes UDPSocketTest.ClientGetLocalPeerAddresses to allow that return
value for ipv6 connections.

b/373726636
b/205134049
jellefoks added a commit that referenced this pull request Oct 16, 2024
Since #4270, UDP socket connections are no longer
silently ignored. Starboard can not return ERR_ADDRESS_UNREACHABLE and
will instead return ERR_FAILED.

This changes UDPSocketTest.ClientGetLocalPeerAddresses to allow that
return value for ipv6 connections.

b/373726636
b/205134049
madhurajayaraman added a commit that referenced this pull request Oct 29, 2024
jellefoks added a commit that referenced this pull request Oct 31, 2024
Starboard builds that don't include #4270 hard assert when sending a UDP
packet without a destination address, even on connected sockets.

This fixes that by supplying the remote address, unless the
`"dev.cobalt.extension.SocketReceiveMultiMsg"` extension from #4321 is
also implemented for the platform. As a result, platforms that implement
the extension will still get the full performance benefit of relying on
connected UDP sockets.

b/374155470 
b/373726636
b/205134049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants