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

Add dgram crate #1764

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft

Add dgram crate #1764

wants to merge 26 commits into from

Conversation

evanrittenhouse
Copy link
Contributor

@evanrittenhouse evanrittenhouse commented Apr 24, 2024

Overview

This PR adds a new crate for abstracting away direct interactions with cmsgs. It currently only contains implementations for Linux, but we can add multi-platform support when required.

Tasks

  • Review TODOs
  • Ensure parity with existing error returns from e.g. quiche/apps/sendto
  • Check syscall tests again after API finalization
  • More unit tests
  • Redo test plan once PR is published
  • Test plan on master as a control group
  • Unify Linux/non-Linux API signatures
  • Test async

Testing

Unit tests exist for basic functionality, but should probably be more robust.

To check the actual GSO/GRO syscall counts, I'm using quiche-server and quiche-client. The general test plan is to make 30 requests to quiche-server, returning a 1MB body each time to trigger batching (e.g. modifying the Not Found! response). I used the following command to grab the syscall counts:

strace -p $(pgrep quiche-server) \
-o $(pwd)/syscall-counts/server-{master,dgram}{-gsogro}.txt \
-e trace="sendmsg,sendto,recvmsg,recvfrom"

and for sending the requests:

for i in (seq 0 30)
     cargo run --bin quiche-client -- https://127.0.0.1:8085 --no-verify
end

The syscall counts are as follows:
Server
No GSO/GRO

…uiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly took 1m26s
❯ rg -c "sendto" -g "syscall-counts/server-dgram.txt"
syscall-counts/server-dgram.txt:24025

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "sendmsg" -g "syscall-counts/server-dgram.txt"

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "recvfrom" -g "syscall-counts/server-dgram.txt"

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "recvmsg" -g "syscall-counts/server-dgram.txt"
syscall-counts/server-dgram.txt:26047

GSO/GRO

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "sendto" -g syscall-counts/server-dgram-gsogro.txt
syscall-counts/server-dgram-gsogro.txt:62

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "sendmsg" -g syscall-counts/server-dgram-gsogro.txt
syscall-counts/server-dgram-gsogro.txt:2542

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "recvfrom" -g syscall-counts/server-dgram-gsogro.txt

…debian in quiche on  evanrittenhouse/dgram [ ⇡1 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "recvmsg" -g syscall-counts/server-dgram-gsogro.txt
syscall-counts/server-dgram-gsogro.txt:5404

And on master, as a control:
No GSO

…an in quiche on  evanrittenhouse/mio_retry [ !2 ?7 *1 ] via Rust v1.79.0-nightly
❮ rg -c "sendto" -g syscall-counts/server-master.txt
syscall-counts/server-master.txt:19781

…an in quiche on  evanrittenhouse/mio_retry [ !2 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "sendmsg" -g syscall-counts/server-master.txt

GSO

…an in quiche on  evanrittenhouse/mio_retry [ !2 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "sendto" -g syscall-counts/server-master-gso.txt
syscall-counts/server-master-gso.txt:62

…an in quiche on  evanrittenhouse/mio_retry [ !2 ?7 *1 ] via Rust v1.79.0-nightly
❯ rg -c "sendmsg" -g syscall-counts/server-master-gso.txt
syscall-counts/server-master-gso.txt:2542

@evanrittenhouse evanrittenhouse requested a review from a team as a code owner April 24, 2024 01:53
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/dgram branch 8 times, most recently from 9ad7cc5 to 6f1c5dd Compare April 24, 2024 14:56
@evanrittenhouse evanrittenhouse marked this pull request as draft April 24, 2024 19:53
@evanrittenhouse evanrittenhouse force-pushed the evanrittenhouse/dgram branch 9 times, most recently from 8ea3dd9 to cc10a34 Compare May 2, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant