-
Notifications
You must be signed in to change notification settings - Fork 1.5k
crypto/cryptodev: optimize driver #18029
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
xiaoxiang781216
merged 4 commits into
apache:master
from
ThePassionate:crypto-optimize-drivers
Jan 20, 2026
Merged
crypto/cryptodev: optimize driver #18029
xiaoxiang781216
merged 4 commits into
apache:master
from
ThePassionate:crypto-optimize-drivers
Jan 20, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
This CI error seems to be occurring in every PR: |
Contributor
|
@ThePassionate please fix the break as soon as possible. |
Contributor
it's strange why apache/nuttx-apps#3314 pass ci. |
xiaoxiang781216
approved these changes
Jan 20, 2026
jerpelea
approved these changes
Jan 20, 2026
Add olen field to crypt_op structure and crp_olen to cryptop structure to support output length tracking in virtio crypto mode. Signed-off-by: makejian <makejian@xiaomi.com>
Add ivlen field to crypt_op and crp_ivlen to cryptop structure to support cipher algorithms with different IV lengths. Signed-off-by: makejian <makejian@xiaomi.com>
Replace dynamic memory allocation with stack-based variables in cryptodev_op(). This eliminates kmm_malloc/kmm_free overhead and simplifies error handling by removing the need for goto bail cleanup paths. Signed-off-by: makejian <makejian@xiaomi.com>
After adding the cross-core crypto driver, there are now three encryption modes: 1. Hardware driver in local core 2. Crypto driver in remote core 3. Software encryption in local core This prioritizes local hardware driver first, then remote driver (typically hardware), and finally local software encryption as a fallback. Signed-off-by: makejian <makejian@xiaomi.com>
4825783 to
41e7c2f
Compare
xiaoxiang781216
approved these changes
Jan 20, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR includes four improvements to the NuttX crypto subsystem:
Add olen field for virtio mode support - Add
olenfield tocrypt_opstructure andcrp_olentocryptopstructure to support output length tracking in virtio crypto mode.Export ivlen to support different cipher algorithms - Add
ivlenfield tocrypt_opandcrp_ivlentocryptopstructure to support cipher algorithms with different IV lengths.Optimize cryptodev without dynamic memory - Replace dynamic memory allocation with stack-based variables in
cryptodev_op(). This eliminateskmm_malloc/kmm_freeoverhead and simplifies error handling by removing the need for goto bail cleanup paths.Determine the order of crypto drivers - After adding the cross-core crypto driver, there are now three encryption modes:
This prioritizes local hardware driver first, then remote driver (typically hardware), and finally local software encryption as a fallback.
Impact
These changes improve crypto subsystem flexibility, performance, and support for virtio-based crypto operations.
Testing
Build and runtime tested on NuttX with software crypto drivers.