accel: delay finish until all IO channels are released
This ensures that there are no more outstanding operations, so we can safely free any global resources. Fixes #2987 Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: Iac423b4f2a1183278d1db20f96c1a3b1bb657f85 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17767 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Mike Gerdts <mgerdts@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
e407385e03
commit
bade2d8db5
@ -2471,17 +2471,12 @@ spdk_accel_module_finish(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
spdk_accel_finish(spdk_accel_fini_cb cb_fn, void *cb_arg)
|
||||
static void
|
||||
accel_io_device_unregister_cb(void *io_device)
|
||||
{
|
||||
struct spdk_accel_crypto_key *key, *key_tmp;
|
||||
enum accel_opcode op;
|
||||
|
||||
assert(cb_fn != NULL);
|
||||
|
||||
g_fini_cb_fn = cb_fn;
|
||||
g_fini_cb_arg = cb_arg;
|
||||
|
||||
spdk_spin_lock(&g_keyring_spin);
|
||||
TAILQ_FOREACH_SAFE(key, &g_keyring, link, key_tmp) {
|
||||
accel_crypto_key_destroy_unsafe(key);
|
||||
@ -2496,10 +2491,20 @@ spdk_accel_finish(spdk_accel_fini_cb cb_fn, void *cb_arg)
|
||||
g_modules_opc[op].module = NULL;
|
||||
}
|
||||
|
||||
spdk_io_device_unregister(&spdk_accel_module_list, NULL);
|
||||
spdk_accel_module_finish();
|
||||
}
|
||||
|
||||
void
|
||||
spdk_accel_finish(spdk_accel_fini_cb cb_fn, void *cb_arg)
|
||||
{
|
||||
assert(cb_fn != NULL);
|
||||
|
||||
g_fini_cb_fn = cb_fn;
|
||||
g_fini_cb_arg = cb_arg;
|
||||
|
||||
spdk_io_device_unregister(&spdk_accel_module_list, accel_io_device_unregister_cb);
|
||||
}
|
||||
|
||||
static struct spdk_accel_driver *
|
||||
accel_find_driver(const char *name)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user