2022-08-05 19:32:35 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2022-11-01 20:26:26 +00:00
|
|
|
* Copyright (C) 2022 Intel Corporation.
|
2022-10-04 18:50:44 +00:00
|
|
|
* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES.
|
2022-08-05 19:32:35 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SPDK_INTERNAL_ACCEL_INTERNAL_H
|
|
|
|
#define SPDK_INTERNAL_ACCEL_INTERNAL_H
|
|
|
|
|
|
|
|
#include "spdk/stdinc.h"
|
|
|
|
|
2022-08-08 20:31:08 +00:00
|
|
|
#include "spdk/accel.h"
|
2022-08-05 19:32:35 +00:00
|
|
|
#include "spdk/queue.h"
|
|
|
|
#include "spdk/config.h"
|
|
|
|
|
2022-08-08 21:43:24 +00:00
|
|
|
struct module_info {
|
2022-08-05 19:32:35 +00:00
|
|
|
struct spdk_json_write_ctx *w;
|
|
|
|
const char *name;
|
|
|
|
enum accel_opcode ops[ACCEL_OPC_LAST];
|
|
|
|
uint32_t num_ops;
|
|
|
|
};
|
|
|
|
|
2023-02-27 14:41:26 +00:00
|
|
|
struct accel_operation_stats {
|
|
|
|
uint64_t executed;
|
|
|
|
uint64_t failed;
|
2023-04-14 13:20:28 +00:00
|
|
|
uint64_t num_bytes;
|
2023-02-27 14:41:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct accel_stats {
|
|
|
|
struct accel_operation_stats operations[ACCEL_OPC_LAST];
|
|
|
|
uint64_t sequence_executed;
|
|
|
|
uint64_t sequence_failed;
|
|
|
|
};
|
|
|
|
|
2022-08-08 21:43:24 +00:00
|
|
|
typedef void (*_accel_for_each_module_fn)(struct module_info *info);
|
|
|
|
void _accel_for_each_module(struct module_info *info, _accel_for_each_module_fn fn);
|
2022-10-04 18:50:44 +00:00
|
|
|
int _accel_get_opc_name(enum accel_opcode opcode, const char **opcode_name);
|
2022-10-04 19:16:21 +00:00
|
|
|
void _accel_crypto_key_dump_param(struct spdk_json_write_ctx *w, struct spdk_accel_crypto_key *key);
|
|
|
|
void _accel_crypto_keys_dump_param(struct spdk_json_write_ctx *w);
|
2023-02-28 06:58:27 +00:00
|
|
|
typedef void (*accel_get_stats_cb)(struct accel_stats *stats, void *cb_arg);
|
|
|
|
int accel_get_stats(accel_get_stats_cb cb_fn, void *cb_arg);
|
2022-10-04 19:16:21 +00:00
|
|
|
|
2022-08-05 19:32:35 +00:00
|
|
|
#endif
|