1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (C) 2022 Intel Corporation. 3 * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. 4 * All rights reserved. 5 */ 6 7 #ifndef SPDK_INTERNAL_ACCEL_INTERNAL_H 8 #define SPDK_INTERNAL_ACCEL_INTERNAL_H 9 10 #include "spdk/stdinc.h" 11 12 #include "spdk/accel.h" 13 #include "spdk/queue.h" 14 #include "spdk/config.h" 15 16 struct module_info { 17 struct spdk_json_write_ctx *w; 18 const char *name; 19 enum accel_opcode ops[ACCEL_OPC_LAST]; 20 uint32_t num_ops; 21 }; 22 23 struct accel_operation_stats { 24 uint64_t executed; 25 uint64_t failed; 26 uint64_t num_bytes; 27 }; 28 29 struct accel_stats { 30 struct accel_operation_stats operations[ACCEL_OPC_LAST]; 31 uint64_t sequence_executed; 32 uint64_t sequence_failed; 33 }; 34 35 typedef void (*_accel_for_each_module_fn)(struct module_info *info); 36 void _accel_for_each_module(struct module_info *info, _accel_for_each_module_fn fn); 37 int _accel_get_opc_name(enum accel_opcode opcode, const char **opcode_name); 38 void _accel_crypto_key_dump_param(struct spdk_json_write_ctx *w, struct spdk_accel_crypto_key *key); 39 void _accel_crypto_keys_dump_param(struct spdk_json_write_ctx *w); 40 typedef void (*accel_get_stats_cb)(struct accel_stats *stats, void *cb_arg); 41 int accel_get_stats(accel_get_stats_cb cb_fn, void *cb_arg); 42 43 #endif 44