accel: Move definitions not needed by modules to accel_internal.h

spdk_internal/accel_engine.h will become the API for accel modules. Move
anything in there that a module doesn't need to see into
lib/accel/accel_internal.h

Some of the software fallback definitions didn't even need to be in a
header and were moved to accel_engine.c

Change-Id: Idb8b12b1c0c1de3d462b906e3df3ba9ee8f830b8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13911
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Ben Walker 2022-08-05 12:32:35 -07:00 committed by Tomasz Zawadzki
parent aa156d53be
commit 6074b3a3f9
4 changed files with 42 additions and 16 deletions

View File

@ -16,16 +16,6 @@
#include "../isa-l/include/igzip_lib.h" #include "../isa-l/include/igzip_lib.h"
#endif #endif
struct engine_info {
struct spdk_json_write_ctx *w;
const char *name;
enum accel_opcode ops[ACCEL_OPC_LAST];
uint32_t num_ops;
};
typedef void (*_accel_for_each_engine_fn)(struct engine_info *info);
void _accel_for_each_engine(struct engine_info *info, _accel_for_each_engine_fn fn);
struct spdk_accel_task; struct spdk_accel_task;
void spdk_accel_task_complete(struct spdk_accel_task *task, int status); void spdk_accel_task_complete(struct spdk_accel_task *task, int status);
@ -41,11 +31,6 @@ struct accel_io_channel {
TAILQ_HEAD(, spdk_accel_task) task_pool; TAILQ_HEAD(, spdk_accel_task) task_pool;
}; };
struct sw_accel_io_channel {
struct spdk_poller *completion_poller;
TAILQ_HEAD(, spdk_accel_task) tasks_to_complete;
};
struct spdk_accel_task { struct spdk_accel_task {
struct accel_io_channel *accel_ch; struct accel_io_channel *accel_ch;
spdk_accel_completion_cb cb_fn; spdk_accel_completion_cb cb_fn;

View File

@ -7,6 +7,8 @@
#include "spdk_internal/accel_engine.h" #include "spdk_internal/accel_engine.h"
#include "accel_internal.h"
#include "spdk/env.h" #include "spdk/env.h"
#include "spdk/likely.h" #include "spdk/likely.h"
#include "spdk/log.h" #include "spdk/log.h"
@ -19,6 +21,10 @@
#include "libpmem.h" #include "libpmem.h"
#endif #endif
#ifdef SPDK_CONFIG_ISAL
#include "../isa-l/include/igzip_lib.h"
#endif
/* Accelerator Engine Framework: The following provides a top level /* Accelerator Engine Framework: The following provides a top level
* generic API for the accelerator functions defined here. Modules, * generic API for the accelerator functions defined here. Modules,
* such as the one in /module/accel/ioat, supply the implementation * such as the one in /module/accel/ioat, supply the implementation
@ -141,6 +147,16 @@ _get_task(struct accel_io_channel *accel_ch, spdk_accel_completion_cb cb_fn, voi
return accel_task; return accel_task;
} }
struct sw_accel_io_channel {
/* for ISAL */
#ifdef SPDK_CONFIG_ISAL
struct isal_zstream stream;
struct inflate_state state;
#endif
struct spdk_poller *completion_poller;
TAILQ_HEAD(, spdk_accel_task) tasks_to_complete;
};
/* Post SW completions to a list and complete in a poller as we don't want to /* Post SW completions to a list and complete in a poller as we don't want to
* complete them on the caller's stack as they'll likely submit another. */ * complete them on the caller's stack as they'll likely submit another. */
inline static void inline static void

View File

@ -3,7 +3,7 @@
* All rights reserved. * All rights reserved.
*/ */
#include "spdk_internal/accel_engine.h" #include "accel_internal.h"
#include "spdk/rpc.h" #include "spdk/rpc.h"
#include "spdk/util.h" #include "spdk/util.h"

View File

@ -0,0 +1,25 @@
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) Intel Corporation.
* All rights reserved.
*/
#ifndef SPDK_INTERNAL_ACCEL_INTERNAL_H
#define SPDK_INTERNAL_ACCEL_INTERNAL_H
#include "spdk/stdinc.h"
#include "spdk/accel_engine.h"
#include "spdk/queue.h"
#include "spdk/config.h"
struct engine_info {
struct spdk_json_write_ctx *w;
const char *name;
enum accel_opcode ops[ACCEL_OPC_LAST];
uint32_t num_ops;
};
typedef void (*_accel_for_each_engine_fn)(struct engine_info *info);
void _accel_for_each_engine(struct engine_info *info, _accel_for_each_engine_fn fn);
#endif