1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (C) 2023 Intel Corporation. All rights reserved. 3 */ 4 5 #ifndef SPDK_ACCEL_ERROR_H 6 #define SPDK_ACCEL_ERROR_H 7 8 #include "spdk/accel.h" 9 10 enum accel_error_inject_type { 11 ACCEL_ERROR_INJECT_DISABLE, 12 ACCEL_ERROR_INJECT_CORRUPT, 13 ACCEL_ERROR_INJECT_FAILURE, 14 ACCEL_ERROR_INJECT_MAX, 15 }; 16 17 struct accel_error_inject_opts { 18 enum spdk_accel_opcode opcode; 19 enum accel_error_inject_type type; 20 uint64_t count; 21 uint64_t interval; 22 int errcode; 23 }; 24 25 int accel_error_inject_error(struct accel_error_inject_opts *opts); 26 const char *accel_error_get_type_name(enum accel_error_inject_type type); 27 28 #endif /* SPDK_ACCEL_ERROR_H */ 29