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.
Motivation and Context
Improve the performance of SHA256 checksum usage by ZFS.
Description
Check if OCF has hardware acceleration available. If so, use it instead of the software implementation that's built into OpenZFS. Allan Jude did a review of this patch and wanted the crypto_os.h files and cleaned up style issues.
FreeBSD 13 will need https://cgit.freebsd.org/src/commit/?id=c71f2370c5d480cf70f12ee276e044681c57aefc to be backported to it before this patch will work on 13
How Has This Been Tested?
On Intel without SHA256 acceleration and on Ryzen and Apple M1, created a zpool and dataset using SHA256, dd 100GB of /dev/random into the dataset and scrub the pool. Apply the patch, recompile the FreeBSD kernel and reboot. Scrub the pool.
On Apple M1 the pre-patch scrub is 1000MB/s and 80% cpu usage, after the patch and loading ossl.ko to provide the SHA256 acceleration results in 1.7GB/s and 30% cpu usage.
On my Ryzen 1700 I don't have fast enough SSDs to saturate my cpu, about 25-30% cpu usage before at 500MB/s. After is 5-8%
Types of changes
Checklist:
Signed-off-by
.