mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 18:11:00 +03:00
75e8b5ad84
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 <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Co-authored-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de> Closes #13725
126 lines
4.2 KiB
C
126 lines
4.2 KiB
C
/*
|
|
* Copyright (c) 2020 iXsystems, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
* SUCH DAMAGE.
|
|
*
|
|
* $FreeBSD$
|
|
*/
|
|
|
|
#ifndef _SPL_MOD_H
|
|
#define _SPL_MOD_H
|
|
|
|
#include <sys/sysctl.h>
|
|
|
|
#define ZMOD_RW CTLFLAG_RWTUN
|
|
#define ZMOD_RD CTLFLAG_RDTUN
|
|
|
|
#define ZFS_MODULE_PARAM(scope_prefix, name_prefix, name, type, perm, desc) \
|
|
SYSCTL_DECL(_vfs_ ## scope_prefix); \
|
|
SYSCTL_##type(_vfs_ ## scope_prefix, OID_AUTO, name, perm, \
|
|
&name_prefix ## name, 0, desc)
|
|
|
|
#define ZFS_MODULE_PARAM_ARGS SYSCTL_HANDLER_ARGS
|
|
|
|
#define ZFS_MODULE_PARAM_CALL_IMPL(parent, name, perm, args, desc) \
|
|
SYSCTL_DECL(parent); \
|
|
SYSCTL_PROC(parent, OID_AUTO, name, CTLFLAG_MPSAFE | perm | args, desc)
|
|
|
|
#define ZFS_MODULE_PARAM_CALL( \
|
|
scope_prefix, name_prefix, name, func, _, perm, desc) \
|
|
ZFS_MODULE_PARAM_CALL_IMPL(_vfs_ ## scope_prefix, name, perm, \
|
|
func ## _args(name_prefix ## name), desc)
|
|
|
|
#define ZFS_MODULE_VIRTUAL_PARAM_CALL ZFS_MODULE_PARAM_CALL
|
|
|
|
#define param_set_arc_long_args(var) \
|
|
CTLTYPE_ULONG, &var, 0, param_set_arc_long, "LU"
|
|
|
|
#define param_set_arc_int_args(var) \
|
|
CTLTYPE_INT, &var, 0, param_set_arc_int, "I"
|
|
|
|
#define param_set_arc_min_args(var) \
|
|
CTLTYPE_ULONG, NULL, 0, param_set_arc_min, "LU"
|
|
|
|
#define param_set_arc_max_args(var) \
|
|
CTLTYPE_ULONG, NULL, 0, param_set_arc_max, "LU"
|
|
|
|
#define param_set_arc_free_target_args(var) \
|
|
CTLTYPE_UINT, NULL, 0, param_set_arc_free_target, "IU"
|
|
|
|
#define param_set_arc_no_grow_shift_args(var) \
|
|
CTLTYPE_INT, NULL, 0, param_set_arc_no_grow_shift, "I"
|
|
|
|
#define param_set_deadman_failmode_args(var) \
|
|
CTLTYPE_STRING, NULL, 0, param_set_deadman_failmode, "A"
|
|
|
|
#define param_set_deadman_synctime_args(var) \
|
|
CTLTYPE_ULONG, NULL, 0, param_set_deadman_synctime, "LU"
|
|
|
|
#define param_set_deadman_ziotime_args(var) \
|
|
CTLTYPE_ULONG, NULL, 0, param_set_deadman_ziotime, "LU"
|
|
|
|
#define param_set_multihost_interval_args(var) \
|
|
CTLTYPE_ULONG, NULL, 0, param_set_multihost_interval, "LU"
|
|
|
|
#define param_set_slop_shift_args(var) \
|
|
CTLTYPE_INT, NULL, 0, param_set_slop_shift, "I"
|
|
|
|
#define param_set_min_auto_ashift_args(var) \
|
|
CTLTYPE_U64, NULL, 0, param_set_min_auto_ashift, "QU"
|
|
|
|
#define param_set_max_auto_ashift_args(var) \
|
|
CTLTYPE_U64, NULL, 0, param_set_max_auto_ashift, "QU"
|
|
|
|
#define fletcher_4_param_set_args(var) \
|
|
CTLTYPE_STRING, NULL, 0, fletcher_4_param, "A"
|
|
|
|
#define blake3_param_set_args(var) \
|
|
CTLTYPE_STRING, NULL, 0, blake3_param, "A"
|
|
|
|
#include <sys/kernel.h>
|
|
#define module_init(fn) \
|
|
static void \
|
|
wrap_ ## fn(void *dummy __unused) \
|
|
{ \
|
|
fn(); \
|
|
} \
|
|
SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
|
|
|
#define module_init_early(fn) \
|
|
static void \
|
|
wrap_ ## fn(void *dummy __unused) \
|
|
{ \
|
|
fn(); \
|
|
} \
|
|
SYSINIT(zfs_ ## fn, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
|
|
|
#define module_exit(fn) \
|
|
static void \
|
|
wrap_ ## fn(void *dummy __unused) \
|
|
{ \
|
|
fn(); \
|
|
} \
|
|
SYSUNINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
|
|
|
#endif /* SPL_MOD_H */
|