Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- this is just a big FirstCommit for review - it will be separated to smaller pieces in the real PR modified: AUTHORS modified: include/sys/Makefile.am new file: include/sys/blake3.h modified: include/sys/zio.h modified: include/sys/zio_checksum.h modified: include/zfeature_common.h modified: lib/libicp/Makefile.am modified: lib/libzpool/Makefile.am modified: man/man5/zpool-features.5 modified: man/man8/zfsprops.8 modified: module/icp/Makefile.in new file: module/icp/algs/blake3/blake3.c new file: module/icp/algs/blake3/blake3_generic.c new file: module/icp/algs/blake3/blake3_impl.c new file: module/icp/algs/blake3/blake3_neon.c new file: module/icp/algs/blake3/blake3_x86-64.c new file: module/icp/asm-x86_64/blake3/blake3_avx2.S new file: module/icp/asm-x86_64/blake3/blake3_avx512.S new file: module/icp/asm-x86_64/blake3/blake3_sse2.S new file: module/icp/asm-x86_64/blake3/blake3_sse41.S new file: module/icp/include/blake3/blake3_impl.h modified: module/zcommon/zfeature_common.c modified: module/zcommon/zfs_prop.c modified: module/zfs/Makefile.in new file: module/zfs/blake3_zfs.c modified: module/zfs/zio_checksum.c Fixes for the first RFC BLAKE3 Checksum PR - add zfs_hashes.c - this will get the micro-benchmark code - add FEATURE_FLAG to include/sys/zfs_ioctl.h - use kmem_cache_alloc() for the blake3 ctx (stack size) Bitte geben Sie eine Commit-Beschreibung für Ihre Änderungen ein. Zeilen,
- Loading branch information
Showing
31 changed files
with
11,223 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ COMMON_H = \ | |
avl.h \ | ||
avl_impl.h \ | ||
bitops.h \ | ||
blake3.h \ | ||
blkptr.h \ | ||
bplist.h \ | ||
bpobj.h \ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License, Version 1.0 only | ||
* (the "License"). You may not use this file except in compliance | ||
* with the License. | ||
* | ||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
* or http://www.opensolaris.org/os/licensing. | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
/* | ||
* Based on BLAKE3 v0.3.7, https://github.com/BLAKE3-team/BLAKE3 | ||
* Copyright (c) 2019-2020 Samuel Neves and Jack O'Connor | ||
* Copyright (c) 2021 Tino Reichardt <milky-zfs@mcmilk.de> | ||
*/ | ||
|
||
#ifndef BLAKE3_H | ||
#define BLAKE3_H | ||
|
||
#ifdef _KERNEL | ||
#include <sys/types.h> | ||
#else | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define BLAKE3_KEY_LEN 32 | ||
#define BLAKE3_OUT_LEN 32 | ||
#define BLAKE3_MAX_DEPTH 54 | ||
#define BLAKE3_BLOCK_LEN 64 | ||
#define BLAKE3_CHUNK_LEN 1024 | ||
|
||
/* | ||
* This struct is a private implementation detail. | ||
* It has to be here because it's part of BLAKE3_CTX below. | ||
*/ | ||
typedef struct { | ||
uint32_t cv[8]; | ||
uint64_t chunk_counter; | ||
uint8_t buf[BLAKE3_BLOCK_LEN]; | ||
uint8_t buf_len; | ||
uint8_t blocks_compressed; | ||
uint8_t flags; | ||
} blake3_chunk_state_t; | ||
|
||
typedef struct { | ||
uint32_t key[8]; | ||
blake3_chunk_state_t chunk; | ||
uint8_t cv_stack_len; | ||
|
||
/* | ||
* The stack size is MAX_DEPTH + 1 because we do lazy merging. For | ||
* example, with 7 chunks, we have 3 entries in the stack. Adding an | ||
* 8th chunk requires a 4th entry, rather than merging everything down | ||
* to 1, because we don't know whether more input is coming. This is | ||
* different from how the reference implementation does things. | ||
*/ | ||
uint8_t cv_stack[(BLAKE3_MAX_DEPTH + 1) * BLAKE3_OUT_LEN]; | ||
} BLAKE3_CTX; | ||
|
||
/* init the context for hash operation */ | ||
void Blake3_Init(BLAKE3_CTX *ctx); | ||
|
||
/* init the context for a MAC and/or tree hash operation */ | ||
void Blake3_InitKeyed(BLAKE3_CTX *ctx, const uint8_t key[BLAKE3_KEY_LEN]); | ||
|
||
/* process the input bytes */ | ||
void Blake3_Update(BLAKE3_CTX *ctx, const void *input, size_t input_len); | ||
|
||
/* finalize the hash computation and output the result */ | ||
void Blake3_Final(const BLAKE3_CTX *ctx, uint8_t *out); | ||
|
||
/* finalize the hash computation and output the result */ | ||
void Blake3_FinalSeek(const BLAKE3_CTX *ctx, uint64_t seek, uint8_t *out, | ||
size_t out_len); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* BLAKE3_H */ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* | ||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
* or http://www.opensolaris.org/os/licensing. | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2021 Tino Reichardt <milky-zfs@mcmilk.de> | ||
*/ | ||
|
||
#ifndef _ZFS_HASHES_H | ||
#define _ZFS_HASHES_H | ||
|
||
#include <sys/types.h> | ||
#include <sys/spa_checksum.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void hashes_init(zio_cksum_t *); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _ZFS_HASHES_H */ |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ KERNEL_C = \ | |
aggsum.c \ | ||
arc.c \ | ||
arc_os.c \ | ||
blake3_zfs.c \ | ||
blkptr.c \ | ||
bplist.c \ | ||
bpobj.c \ | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.