Skip to content

MSG_ZEROCOPY + non-temporal stores from AES-GCM #3007

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

Merged
merged 81 commits into from
Jul 1, 2022
Merged

Conversation

kazuho
Copy link
Member

@kazuho kazuho commented Apr 25, 2022

For sending encrypted bytes to the socket with minimal overhead in terms of both memory bandwidth and CPU clock cycles, uses MSG_ZEROCOPY and non-temporal aes-gcm engine (h2o/picotls#384).

  • Do not mix buffers passed to kernel with MSG_ZEROCOPY and those that are not. At the moment, they share the same allocator: h2o_socket_ssl_buffer_allocator (done in 9bcf40f).
  • Reduce threshold for zerocopy from 16KB to 4KB or something. https://www.kernel.org/doc/html/v5.17/networking/msg_zerocopy.html recommends 10KB but we probably want to use a smaller number, especially when using non-temporal engine and tx-nocache-copy, in which case both the source and destination of the copy becomes main memory (done in 4cba163).
  • Consult if zerocopy is actually used, and report if non-use rate is high. It's too easy to screw up configuration. -> This to be done in a follow-up PR.

Builds on top of h2o/picotls#384, #3031.

@kazuho kazuho changed the title MSG_ZEROCOPY MSG_ZEROCOPY + non-temporal stores from AES-GCM May 11, 2022
@kazuho kazuho marked this pull request as ready for review July 1, 2022 05:56
@kazuho kazuho merged commit 16d0c19 into master Jul 1, 2022
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