lib/accel: remove public API for getting capabilities
First in a series of patches that will enable multiple engines to exist at once and choose the best one based on their priorities and capabilites, the public API will no longer be needed. Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: Ia87b83aa2263745a94a822a160b6e97bb2e0dc19 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11948 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
a06aaacbe7
commit
e68aebd50b
@ -26,6 +26,8 @@ The APIs include:
|
|||||||
|
|
||||||
A new flag `ACCEL_FLAG_PERSISTENT` was added to indicate the target memory is PMEM.
|
A new flag `ACCEL_FLAG_PERSISTENT` was added to indicate the target memory is PMEM.
|
||||||
|
|
||||||
|
The API `spdk_accel_get_capabilities` has been removed.
|
||||||
|
|
||||||
### crypto
|
### crypto
|
||||||
|
|
||||||
Support for AES_XTS was added for MLX5 polled mode driver (pmd).
|
Support for AES_XTS was added for MLX5 polled mode driver (pmd).
|
||||||
|
@ -612,19 +612,6 @@ _worker_stop(void *arg)
|
|||||||
return SPDK_POLLER_BUSY;
|
return SPDK_POLLER_BUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
|
||||||
identify_accel_engine_usage(struct spdk_io_channel *ch)
|
|
||||||
{
|
|
||||||
uint64_t capabilities;
|
|
||||||
|
|
||||||
assert(ch != NULL);
|
|
||||||
capabilities = spdk_accel_get_capabilities(ch);
|
|
||||||
if ((capabilities & g_workload_selection) != g_workload_selection) {
|
|
||||||
SPDK_WARNLOG("The selected workload is not natively supported by the current engine\n");
|
|
||||||
SPDK_WARNLOG("The software engine will be used instead.\n\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_init_thread(void *arg1)
|
_init_thread(void *arg1)
|
||||||
{
|
{
|
||||||
@ -646,17 +633,12 @@ _init_thread(void *arg1)
|
|||||||
worker->core = spdk_env_get_current_core();
|
worker->core = spdk_env_get_current_core();
|
||||||
worker->thread = spdk_get_thread();
|
worker->thread = spdk_get_thread();
|
||||||
pthread_mutex_lock(&g_workers_lock);
|
pthread_mutex_lock(&g_workers_lock);
|
||||||
i = g_num_workers;
|
|
||||||
g_num_workers++;
|
g_num_workers++;
|
||||||
worker->next = g_workers;
|
worker->next = g_workers;
|
||||||
g_workers = worker;
|
g_workers = worker;
|
||||||
pthread_mutex_unlock(&g_workers_lock);
|
pthread_mutex_unlock(&g_workers_lock);
|
||||||
worker->ch = spdk_accel_engine_get_io_channel();
|
worker->ch = spdk_accel_engine_get_io_channel();
|
||||||
|
|
||||||
if (i == 0) {
|
|
||||||
identify_accel_engine_usage(worker->ch);
|
|
||||||
}
|
|
||||||
|
|
||||||
TAILQ_INIT(&worker->tasks_pool);
|
TAILQ_INIT(&worker->tasks_pool);
|
||||||
|
|
||||||
worker->task_base = calloc(num_tasks, sizeof(struct ap_task));
|
worker->task_base = calloc(num_tasks, sizeof(struct ap_task));
|
||||||
|
@ -101,15 +101,6 @@ void spdk_accel_engine_module_finish(void);
|
|||||||
*/
|
*/
|
||||||
struct spdk_io_channel *spdk_accel_engine_get_io_channel(void);
|
struct spdk_io_channel *spdk_accel_engine_get_io_channel(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve accel engine HW acceleration capabilities.
|
|
||||||
*
|
|
||||||
* \param ch I/O channel associated with this call.
|
|
||||||
*
|
|
||||||
* \return bitmap of HW acceleration capabilities defined by enum accel_capability.
|
|
||||||
*/
|
|
||||||
uint64_t spdk_accel_get_capabilities(struct spdk_io_channel *ch);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submit a copy request.
|
* Submit a copy request.
|
||||||
*
|
*
|
||||||
|
@ -128,15 +128,6 @@ spdk_accel_task_complete(struct spdk_accel_task *accel_task, int status)
|
|||||||
cb_fn(cb_arg, status);
|
cb_fn(cb_arg, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Accel framework public API for discovering current engine capabilities. */
|
|
||||||
uint64_t
|
|
||||||
spdk_accel_get_capabilities(struct spdk_io_channel *ch)
|
|
||||||
{
|
|
||||||
struct accel_io_channel *accel_ch = spdk_io_channel_get_ctx(ch);
|
|
||||||
|
|
||||||
return accel_ch->engine->capabilities;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline static struct spdk_accel_task *
|
inline static struct spdk_accel_task *
|
||||||
_get_task(struct accel_io_channel *accel_ch, spdk_accel_completion_cb cb_fn, void *cb_arg)
|
_get_task(struct accel_io_channel *accel_ch, spdk_accel_completion_cb cb_fn, void *cb_arg)
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
spdk_accel_engine_finish;
|
spdk_accel_engine_finish;
|
||||||
spdk_accel_engine_module_finish;
|
spdk_accel_engine_module_finish;
|
||||||
spdk_accel_engine_get_io_channel;
|
spdk_accel_engine_get_io_channel;
|
||||||
spdk_accel_get_capabilities;
|
|
||||||
spdk_accel_submit_copy;
|
spdk_accel_submit_copy;
|
||||||
spdk_accel_submit_dualcast;
|
spdk_accel_submit_dualcast;
|
||||||
spdk_accel_submit_compare;
|
spdk_accel_submit_compare;
|
||||||
|
@ -161,21 +161,6 @@ test_spdk_accel_task_complete(void)
|
|||||||
CU_ASSERT(expected_accel_task == &accel_task);
|
CU_ASSERT(expected_accel_task == &accel_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
test_spdk_accel_get_capabilities(void)
|
|
||||||
{
|
|
||||||
uint64_t cap, expected_cap;
|
|
||||||
|
|
||||||
/* Setup a few capabilities and make sure they are reported as expected. */
|
|
||||||
g_accel_ch->engine = &g_accel_engine;
|
|
||||||
expected_cap = ACCEL_COPY | ACCEL_DUALCAST | ACCEL_CRC32C;
|
|
||||||
g_accel_ch->engine->capabilities = expected_cap;
|
|
||||||
|
|
||||||
cap = spdk_accel_get_capabilities(g_ch);
|
|
||||||
CU_ASSERT(cap == expected_cap);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_get_task(void)
|
test_get_task(void)
|
||||||
{
|
{
|
||||||
@ -799,7 +784,6 @@ int main(int argc, char **argv)
|
|||||||
CU_ADD_TEST(suite, test_accel_sw_unregister);
|
CU_ADD_TEST(suite, test_accel_sw_unregister);
|
||||||
CU_ADD_TEST(suite, test_is_supported);
|
CU_ADD_TEST(suite, test_is_supported);
|
||||||
CU_ADD_TEST(suite, test_spdk_accel_task_complete);
|
CU_ADD_TEST(suite, test_spdk_accel_task_complete);
|
||||||
CU_ADD_TEST(suite, test_spdk_accel_get_capabilities);
|
|
||||||
CU_ADD_TEST(suite, test_get_task);
|
CU_ADD_TEST(suite, test_get_task);
|
||||||
CU_ADD_TEST(suite, test_spdk_accel_submit_copy);
|
CU_ADD_TEST(suite, test_spdk_accel_submit_copy);
|
||||||
CU_ADD_TEST(suite, test_spdk_accel_submit_dualcast);
|
CU_ADD_TEST(suite, test_spdk_accel_submit_dualcast);
|
||||||
|
Loading…
Reference in New Issue
Block a user