Commit 6074b3a3 authored by Ben Walker's avatar Ben Walker Committed by Tomasz Zawadzki
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13911


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent aa156d53
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -16,16 +16,6 @@
#include "../isa-l/include/igzip_lib.h"
#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;

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;
};

struct sw_accel_io_channel {
	struct spdk_poller		*completion_poller;
	TAILQ_HEAD(, spdk_accel_task)	tasks_to_complete;
};

struct spdk_accel_task {
	struct accel_io_channel		*accel_ch;
	spdk_accel_completion_cb	cb_fn;
+16 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@

#include "spdk_internal/accel_engine.h"

#include "accel_internal.h"

#include "spdk/env.h"
#include "spdk/likely.h"
#include "spdk/log.h"
@@ -19,6 +21,10 @@
#include "libpmem.h"
#endif

#ifdef SPDK_CONFIG_ISAL
#include "../isa-l/include/igzip_lib.h"
#endif

/* Accelerator Engine Framework: The following provides a top level
 * generic API for the accelerator functions defined here. Modules,
 * 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;
}

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
 * complete them on the caller's stack as they'll likely submit another. */
inline static void
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *   All rights reserved.
 */

#include "spdk_internal/accel_engine.h"
#include "accel_internal.h"

#include "spdk/rpc.h"
#include "spdk/util.h"
+25 −0
Original line number Diff line number Diff line
/*   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