Add KTLS support in tls_wolfssl #3782
Open
+394
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add Kernel TLS support in tls_wolfssl
Details
Try to use KTLS for RX and TX ( dependent on Kernel support and loaded modules https://docs.kernel.org/networking/tls-offload.html )
If kernel support is not found, or if the cypher attempted to be used is not supported ( only AES-GCM for now ), then SSL operations will continue to be done in user-space.
IF NIC supports SSL offloading, that can also be enabled without any changes needed to the module https://docs.nvidia.com/doca/sdk/ktls-offloads/index.html
Solution
Add Kernel TLS suppor in tls_wolfssl
Easy testing with modparam("tls_wolfssl","try_use_ktls", 1)
Observe encryption handled in kernel-space
DBG:tls_wolfssl:_wolfssl_read: KTLS RX read 276 bytes
DBG:tls_wolfssl:_wolfssl_tls_write: KTLS write was successful (278 bytes)
Compatibility
Backwards compatible, try_use_ktls defaults to 0