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

[inetstack] Move UDP stack to objects #1003

Merged
merged 6 commits into from
Nov 15, 2023

Conversation

iyzhang
Copy link
Contributor

@iyzhang iyzhang commented Nov 10, 2023

This PR moves the UDP stack towards our new architecture. We have moved functionality into each SharedUDPQueue, including a per-queue background coroutine that sends pending packets. Since most of the time we will be able to send synchronously, it's better to avoid the lookup on each send and just rely on the scheduler to wake the appropriate background coroutine. I also added a clean up for the background coroutine on socket close.

This PR has a few lingering issues:

  1. I moved the UDP queues to the AsyncQueue data structure, which is currently unbounded. We should move it back to being bounded and possibly using the mpsc abstractions from the futures crate. We should decide what kind of blocking behavior we want when the receive or send queues fill up.
  2. I added a SharedAsyncQueue data structure but wound up not using it. I left it in case we need it somewhere else.

Other remaining tasks:

  1. Add UDP support to the socket state machine and have the SharedUdpQueue check it on each operation.
  2. Add pending ops to the SharedUdpQueue and cancel them when the queue is closed.

@iyzhang iyzhang added the enhancement Enhancement Request on an Existing Feature label Nov 10, 2023
@iyzhang iyzhang requested review from anandbonde and ppenna November 10, 2023 23:06
@iyzhang iyzhang self-assigned this Nov 10, 2023
@iyzhang iyzhang force-pushed the enhancement-inetstack-udp-move-to-objects branch 2 times, most recently from e207672 to 7ba60c1 Compare November 10, 2023 23:42
@iyzhang iyzhang force-pushed the enhancement-inetstack-udp-move-to-objects branch 4 times, most recently from 87c540f to 03b050b Compare November 15, 2023 00:26
@iyzhang iyzhang force-pushed the enhancement-inetstack-udp-move-to-objects branch from 03b050b to 9540287 Compare November 15, 2023 18:33
@iyzhang iyzhang merged commit 60754f8 into dev Nov 15, 2023
19 checks passed
@iyzhang iyzhang deleted the enhancement-inetstack-udp-move-to-objects branch November 15, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement Request on an Existing Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants