470e851c4b
KTLS OCF support was originally targeted at software backends that used host CPU cycles to encrypt TLS records. As a result, each KTLS worker thread queued a single TLS record at a time and waited for it to be encrypted before processing another TLS record. This works well for software backends but limits throughput on OCF drivers for coprocessors that support asynchronous operation such as qat(4) or ccr(4). This change uses an alternate function (ktls_encrypt_async) when encrypt TLS records via a coprocessor. This function queues TLS records for encryption and returns. It defers the work done after a TLS record has been encrypted (such as marking the mbufs ready) to a callback invoked asynchronously by the coprocessor driver when a record has been encrypted. - Add a struct ktls_ocf_state that holds the per-request state stored on the stack for synchronous requests. Asynchronous requests malloc this structure while synchronous requests continue to allocate this structure on the stack. - Add a ktls_encrypt_async() variant of ktls_encrypt() which does not perform request completion after dispatching a request to OCF. Instead, the ktls_ocf backends invoke ktls_encrypt_cb() when a TLS record request completes for an asynchronous request. - Flag AEAD software TLS sessions as async if the backend driver selected by OCF is an async driver. - Pull code to create and dispatch an OCF request out of ktls_encrypt() into a new ktls_encrypt_one() function used by both ktls_encrypt() and ktls_encrypt_async(). - Pull code to "finish" the VM page shuffling for a file-backed TLS record into a helper function ktls_finish_noanon() used by both ktls_encrypt() and ktls_encrypt_cb(). Reviewed by: markj Tested on: ccr(4) (jhb), qat(4) (markj) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31665 |
||
---|---|---|
.. | ||
_cryptodev.h | ||
cbc_mac.c | ||
cbc_mac.h | ||
criov.c | ||
crypto.c | ||
cryptodeflate.c | ||
cryptodev_if.m | ||
cryptodev.c | ||
cryptodev.h | ||
cryptosoft.c | ||
deflate.h | ||
gfmult.c | ||
gfmult.h | ||
gmac.c | ||
gmac.h | ||
ktls_ocf.c | ||
ktls.h | ||
rmd160.c | ||
rmd160.h | ||
xform_aes_icm.c | ||
xform_aes_xts.c | ||
xform_auth.h | ||
xform_cbc_mac.c | ||
xform_chacha20_poly1305.c | ||
xform_cml.c | ||
xform_comp.h | ||
xform_deflate.c | ||
xform_enc.h | ||
xform_gmac.c | ||
xform_null.c | ||
xform_poly1305.c | ||
xform_rijndael.c | ||
xform_rmd160.c | ||
xform_sha1.c | ||
xform_sha2.c | ||
xform.c | ||
xform.h |