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

GSO-Friendly Packet Memory #175

Merged
merged 7 commits into from
Oct 3, 2020
Merged

GSO-Friendly Packet Memory #175

merged 7 commits into from
Oct 3, 2020

Conversation

victorstewart
Copy link
Contributor

this trivial patch enables the batching of packets out into a persistent buffer per connection, for cleaner more efficient GSO.

currently there is no way to relate the peer_ctx back to a connection inside the pmi_allocate callback, so the best you can do is a pool of packet buffers. This can lead to ~40+ unique packet buffers being passed via sendmsg into the kernel and just as many unique copies.

or one could construct a contiguous buffer of all packets for GSO within the ea_packets_out at the expense of all those copies.

and all is complicated further by using io_uring given the asynchronous sendmsg completions.

this patch relies on the assumption of sequence. That for a given connection, the sequence in which packet buffers are requested from pmi_allocate matches the order in which they are passed to ea_packets_out.

now all you need to do is group packets by connection in your ea_packets_out callback, then calculate the contiguous buffer they constitute into a new struct iov_vec and pass it into sendmsg.

accidentally deleted my branch lol. So here's the PR again, including all the changes we discussed.

@litespeedtech litespeedtech merged commit fecdd10 into litespeedtech:master Oct 3, 2020
litespeedtech pushed a commit that referenced this pull request Oct 7, 2020
- [FEATURE] Extensible HTTP Priorities (HTTP/3 only).
- [FEATURE] Add conn context to packet-out memory interface (PR #175).
- [BUGFIX] gQUIC proof generation: allocate buffer big enough for
  signature (issue #173).
- [BUGFIX] Make library thread-safe: drop use of global variables
  (issue #133, issue #167).
- [BUGFIX] Deactivate only *recent* HQ frame, not any HQ frame.
- [BUGFIX] gQUIC server: associate compressed cert with SSL_CTX,
  instead of keeping them in a separate hash, potentially leading
  to mismatches.
- [BUGFIX] Stream data discard infinite loop: break on FIN.
- cmake: add install target via -DCMAKE_INSTALL_PREFIX (PR #171).
- Support randomized packet number to begin a connection.
- Mini and full IETF connection size optimization.
- http_client: specify HTTP priorities based on stream conditions.
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.

2 participants