accel: Do not refer to the "framework" as "engine"

The word engine was both used (interchangeably with module) to refer to
the things that plug into the framework and to the framework itself.
This patch eliminates all use of the word engine that meant the
framework. It leaves uses of the word that meant "module".

Change-Id: I6b9b50e2f045ac39f2a74d0152ee8d6269be4bd1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13918
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
Ben Walker 2022-08-08 13:51:25 -07:00 committed by Tomasz Zawadzki
parent dd7140e627
commit 34c48f1b3b
18 changed files with 62 additions and 62 deletions

View File

@ -161,7 +161,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
run_test "dpdk_mem_utility" test/dpdk_memory_utility/test_dpdk_mem_info.sh
run_test "event" test/event/event.sh
run_test "thread" test/thread/thread.sh
run_test "accel_engine" test/accel_engine/accel_engine.sh
run_test "accel" test/accel/accel.sh
if [ $SPDK_TEST_BLOCKDEV -eq 1 ]; then
run_test "blockdev_general" test/bdev/blockdev.sh

View File

@ -628,7 +628,7 @@ _init_thread(void *arg1)
worker->next = g_workers;
g_workers = worker;
pthread_mutex_unlock(&g_workers_lock);
worker->ch = spdk_accel_engine_get_io_channel();
worker->ch = spdk_accel_get_io_channel();
if (worker->ch == NULL) {
fprintf(stderr, "Unable to get an accel channel\n");
goto error;

View File

@ -4,11 +4,11 @@
*/
/** \file
* Acceleration engine abstraction layer
* Acceleration Framework
*/
#ifndef SPDK_ACCEL_ENGINE_H
#define SPDK_ACCEL_ENGINE_H
#ifndef SPDK_ACCEL_H
#define SPDK_ACCEL_H
#include "spdk/stdinc.h"
@ -40,35 +40,35 @@ enum accel_opcode {
typedef void (*spdk_accel_completion_cb)(void *ref, int status);
/**
* Acceleration engine finish callback.
* Acceleration framework finish callback.
*
* \param cb_arg Callback argument.
*/
typedef void (*spdk_accel_fini_cb)(void *cb_arg);
/**
* Initialize the acceleration engine.
* Initialize the acceleration framework.
*
* \return 0 on success.
*/
int spdk_accel_engine_initialize(void);
int spdk_accel_initialize(void);
/**
* Close the acceleration engine.
* Close the acceleration framework.
*
* \param cb_fn Called when the close operation completes.
* \param cb_arg Argument passed to the callback function.
*/
void spdk_accel_engine_finish(spdk_accel_fini_cb cb_fn, void *cb_arg);
void spdk_accel_finish(spdk_accel_fini_cb cb_fn, void *cb_arg);
/**
* Get the I/O channel registered on the acceleration engine.
* Get an I/O channel for the acceleration framework.
*
* This I/O channel is used to submit copy request.
* This I/O channel is used to submit requests.
*
* \return a pointer to the I/O channel on success, or NULL on failure.
*/
struct spdk_io_channel *spdk_accel_engine_get_io_channel(void);
struct spdk_io_channel *spdk_accel_get_io_channel(void);
/**
* Submit a copy request.

View File

@ -11,7 +11,7 @@ SO_MINOR := 0
SO_SUFFIX := $(SO_VER).$(SO_MINOR)
LIBNAME = accel
C_SRCS = accel_engine.c accel_engine_rpc.c accel_sw.c
C_SRCS = accel.c accel_rpc.c accel_sw.c
SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_accel.map)

View File

@ -17,7 +17,7 @@
#include "spdk/crc32.h"
#include "spdk/util.h"
/* Accelerator Engine Framework: The following provides a top level
/* Accelerator 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
* with the exception of the pure software implementation contained
@ -483,7 +483,7 @@ spdk_accel_module_list_add(struct spdk_accel_module_if *accel_module)
/* Framework level channel create callback. */
static int
accel_engine_create_cb(void *io_device, void *ctx_buf)
accel_create_channel(void *io_device, void *ctx_buf)
{
struct accel_io_channel *accel_ch = ctx_buf;
struct spdk_accel_task *accel_task;
@ -523,7 +523,7 @@ err:
/* Framework level channel destroy callback. */
static void
accel_engine_destroy_cb(void *io_device, void *ctx_buf)
accel_destroy_channel(void *io_device, void *ctx_buf)
{
struct accel_io_channel *accel_ch = ctx_buf;
int i;
@ -538,13 +538,13 @@ accel_engine_destroy_cb(void *io_device, void *ctx_buf)
}
struct spdk_io_channel *
spdk_accel_engine_get_io_channel(void)
spdk_accel_get_io_channel(void)
{
return spdk_get_io_channel(&spdk_accel_module_list);
}
static void
accel_engine_module_initialize(void)
accel_module_initialize(void)
{
struct spdk_accel_module_if *accel_engine_module;
@ -554,13 +554,13 @@ accel_engine_module_initialize(void)
}
int
spdk_accel_engine_initialize(void)
spdk_accel_initialize(void)
{
enum accel_opcode op;
struct spdk_accel_module_if *accel_module = NULL;
g_engine_started = true;
accel_engine_module_initialize();
accel_module_initialize();
/* Create our priority global map of opcodes to engines, we populate starting
* with the software engine (guaranteed to be first on the list) and then
@ -599,17 +599,17 @@ spdk_accel_engine_initialize(void)
}
#endif
/*
* We need a unique identifier for the accel engine framework, so use the
* We need a unique identifier for the accel framework, so use the
* spdk_accel_module_list address for this purpose.
*/
spdk_io_device_register(&spdk_accel_module_list, accel_engine_create_cb, accel_engine_destroy_cb,
sizeof(struct accel_io_channel), "accel_module");
spdk_io_device_register(&spdk_accel_module_list, accel_create_channel, accel_destroy_channel,
sizeof(struct accel_io_channel), "accel");
return 0;
}
static void
accel_engine_module_finish_cb(void)
accel_module_finish_cb(void)
{
spdk_accel_fini_cb cb_fn = g_fini_cb_fn;
@ -646,7 +646,7 @@ spdk_accel_module_finish(void)
}
if (!g_accel_engine_module) {
accel_engine_module_finish_cb();
accel_module_finish_cb();
return;
}
@ -658,7 +658,7 @@ spdk_accel_module_finish(void)
}
void
spdk_accel_engine_finish(spdk_accel_fini_cb cb_fn, void *cb_arg)
spdk_accel_finish(spdk_accel_fini_cb cb_fn, void *cb_arg)
{
enum accel_opcode op;

View File

@ -2,9 +2,9 @@
global:
# public functions
spdk_accel_engine_initialize;
spdk_accel_engine_finish;
spdk_accel_engine_get_io_channel;
spdk_accel_initialize;
spdk_accel_finish;
spdk_accel_get_io_channel;
spdk_accel_submit_copy;
spdk_accel_submit_dualcast;
spdk_accel_submit_compare;

View File

@ -1313,7 +1313,7 @@ nvmf_tcp_poll_group_create(struct spdk_nvmf_transport *transport,
}
}
tgroup->accel_channel = spdk_accel_engine_get_io_channel();
tgroup->accel_channel = spdk_accel_get_io_channel();
if (spdk_unlikely(!tgroup->accel_channel)) {
SPDK_ERRLOG("Cannot create accel_channel for tgroup=%p\n", tgroup);
goto cleanup;

View File

@ -478,9 +478,9 @@ malloc_create_channel_cb(void *io_device, void *ctx)
{
struct malloc_channel *ch = ctx;
ch->accel_channel = spdk_accel_engine_get_io_channel();
ch->accel_channel = spdk_accel_get_io_channel();
if (!ch->accel_channel) {
SPDK_ERRLOG("Failed to get accel engine's IO channel\n");
SPDK_ERRLOG("Failed to get accel framework's IO channel\n");
return -ENOMEM;
}

View File

@ -2426,7 +2426,7 @@ bdev_nvme_create_poll_group_cb(void *io_device, void *ctx_buf)
return -1;
}
group->accel_channel = spdk_accel_engine_get_io_channel();
group->accel_channel = spdk_accel_get_io_channel();
if (!group->accel_channel) {
spdk_nvme_poll_group_destroy(group->group);
SPDK_ERRLOG("Cannot get the accel_channel for bdev nvme polling group=%p\n",

View File

@ -11,31 +11,31 @@
#include "spdk/env.h"
static void
accel_engine_subsystem_initialize(void)
accel_subsystem_initialize(void)
{
int rc;
rc = spdk_accel_engine_initialize();
rc = spdk_accel_initialize();
spdk_subsystem_init_next(rc);
}
static void
accel_engine_subsystem_finish_done(void *cb_arg)
accel_subsystem_finish_done(void *cb_arg)
{
spdk_subsystem_fini_next();
}
static void
accel_engine_subsystem_finish(void)
accel_subsystem_finish(void)
{
spdk_accel_engine_finish(accel_engine_subsystem_finish_done, NULL);
spdk_accel_finish(accel_subsystem_finish_done, NULL);
}
static struct spdk_subsystem g_spdk_subsystem_accel = {
.name = "accel",
.init = accel_engine_subsystem_initialize,
.fini = accel_engine_subsystem_finish,
.init = accel_subsystem_initialize,
.fini = accel_subsystem_finish,
.write_config_json = spdk_accel_write_config_json,
};

16
test/accel/accel.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
#Run through all SW ops with defaults for a quick sanity check
#To save time, only use verification case
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w crc32c -y
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w crc32c -y -C 2
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w copy -y
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w fill -y
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w copy_crc32c -y
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w copy_crc32c -y -C 2
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w dualcast -y
run_test "accel" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w compare -y

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
#Run through all SW ops with defaults for a quick sanity check
#To save time, only use verification case
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w crc32c -y
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w crc32c -y -C 2
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w copy -y
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w fill -y
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w copy_crc32c -y
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w copy_crc32c -y -C 2
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w dualcast -y
run_test "accel_engine" $SPDK_EXAMPLE_DIR/accel_perf -t 1 -w compare -y

View File

@ -5,6 +5,6 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
TEST_FILE = accel_engine_ut.c
TEST_FILE = accel_ut.c
include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk

View File

@ -9,7 +9,7 @@
#include "spdk_internal/accel_engine.h"
#include "thread/thread_internal.h"
#include "common/lib/test_env.c"
#include "accel/accel_engine.c"
#include "accel/accel.c"
#include "accel/accel_sw.c"
#include "unit/lib/json_mock.c"

View File

@ -57,7 +57,7 @@ spdk_nvme_ctrlr_get_memory_domains(const struct spdk_nvme_ctrlr *ctrlr,
}
struct spdk_io_channel *
spdk_accel_engine_get_io_channel(void)
spdk_accel_get_io_channel(void)
{
return spdk_get_io_channel(g_accel_p);
}

View File

@ -217,7 +217,7 @@ DEFINE_STUB(spdk_bdev_reset, int, (struct spdk_bdev_desc *desc, struct spdk_io_c
DEFINE_STUB_V(spdk_bdev_free_io, (struct spdk_bdev_io *bdev_io));
struct spdk_io_channel *
spdk_accel_engine_get_io_channel(void)
spdk_accel_get_io_channel(void)
{
return spdk_get_io_channel(g_accel_p);
}

View File

@ -219,7 +219,7 @@ if [ $(uname -s) = Linux ]; then
run_test "unittest_ftl" unittest_ftl
fi
run_test "unittest_accel" $valgrind $testdir/lib/accel/accel.c/accel_engine_ut
run_test "unittest_accel" $valgrind $testdir/lib/accel/accel.c/accel_ut
run_test "unittest_ioat" $valgrind $testdir/lib/ioat/ioat.c/ioat_ut
if grep -q '#define SPDK_CONFIG_IDXD 1' $rootdir/include/spdk/config.h; then
run_test "unittest_idxd_user" $valgrind $testdir/lib/idxd/idxd_user.c/idxd_user_ut