Spdk/include/spdk/xor.h
Artur Paszkiewicz 69c448a30e lib/util: add ISA-L accelerated xor generation
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I3ef9dadb4c68e92760c8426f0fffb7b249829e2b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12080
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-09-29 22:52:45 +00:00

43 lines
821 B
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) Intel Corporation.
* All rights reserved.
*/
/**
* \file
* XOR utility functions
*/
#ifndef SPDK_XOR_H
#define SPDK_XOR_H
#include "spdk/stdinc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Generate XOR from multiple source buffers.
*
* \param dest Destination buffer.
* \param sources Array of source buffers.
* \param n Number of source buffers in the array.
* \param len Length of each buffer in bytes.
* \return 0 on success, negative error code otherwise.
*/
int spdk_xor_gen(void *dest, void **sources, uint32_t n, uint32_t len);
/**
* Get the optimal buffer alignment for XOR functions.
*
* \return The alignment in bytes.
*/
size_t spdk_xor_get_optimal_alignment(void);
#ifdef __cplusplus
}
#endif
#endif /* SPDK_XOR_H */