diff options
author | Tino Reichardt <[email protected]> | 2022-08-03 18:36:41 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-09-16 14:25:53 -0700 |
commit | 75e8b5ad847ed7fd9e40ffdf33989b6578469903 (patch) | |
tree | 862c95e9d94b4c9223d601b0cba6f685147bdc67 /tests/zfs-tests | |
parent | 7dee043af5d9fce99611bca5863bf6ca28b741ba (diff) |
Fix BLAKE3 tuneable and module loading on Linux and FreeBSD
Apply similar options to BLAKE3 as it is done for zfs_fletcher_4_impl.
The zfs module parameter on Linux changes from icp_blake3_impl to
zfs_blake3_impl.
You can check and set it on Linux via sysfs like this:
```
[bash]# cat /sys/module/zfs/parameters/zfs_blake3_impl
cycle [fastest] generic sse2 sse41 avx2
[bash]# echo sse2 > /sys/module/zfs/parameters/zfs_blake3_impl
[bash]# cat /sys/module/zfs/parameters/zfs_blake3_impl
cycle fastest generic [sse2] sse41 avx2
```
The modprobe module parameters may also be used now:
```
[bash]# modprobe zfs zfs_blake3_impl=sse41
[bash]# cat /sys/module/zfs/parameters/zfs_blake3_impl
cycle fastest generic sse2 [sse41] avx2
```
On FreeBSD the BLAKE3 implementation can be set via sysctl like this:
```
[bsd]# sysctl vfs.zfs.blake3_impl
vfs.zfs.blake3_impl: cycle [fastest] generic sse2 sse41 avx2
[bsd]# sysctl vfs.zfs.blake3_impl=sse2
vfs.zfs.blake3_impl: cycle [fastest] generic sse2 sse41 avx2 \
-> cycle fastest generic [sse2] sse41 avx2
```
This commit changes also some Blake3 internals like these:
- blake3_impl_ops_t was renamed to blake3_ops_t
- all functions are named blake3_impl_NAME() now
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Co-authored-by: Ryan Moeller <[email protected]>
Signed-off-by: Tino Reichardt <[email protected]>
Closes #13725
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r-- | tests/zfs-tests/cmd/checksum/blake3_test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/zfs-tests/cmd/checksum/blake3_test.c b/tests/zfs-tests/cmd/checksum/blake3_test.c index d57d0e047..648e1faaa 100644 --- a/tests/zfs-tests/cmd/checksum/blake3_test.c +++ b/tests/zfs-tests/cmd/checksum/blake3_test.c @@ -497,9 +497,9 @@ main(int argc, char *argv[]) } (void) printf("Running algorithm correctness tests:\n"); - for (id = 0; id < blake3_get_impl_count(); id++) { - blake3_set_impl_id(id); - const char *name = blake3_get_impl_name(); + for (id = 0; id < blake3_impl_getcnt(); id++) { + blake3_impl_setid(id); + const char *name = blake3_impl_getname(); dprintf("Result for BLAKE3-%s:\n", name); for (i = 0; TestArray[i].hash; i++) { blake3_test_t *cur = &TestArray[i]; @@ -565,9 +565,9 @@ main(int argc, char *argv[]) } while (0) printf("Running performance tests (hashing 1024 MiB of data):\n"); - for (id = 0; id < blake3_get_impl_count(); id++) { - blake3_set_impl_id(id); - const char *name = blake3_get_impl_name(); + for (id = 0; id < blake3_impl_getcnt(); id++) { + blake3_impl_setid(id); + const char *name = blake3_impl_getname(); BLAKE3_PERF_TEST(name, 256); } |