Commit 0cd6ba66 authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

accel/dsa: Do not register module automatically



Register the module when a dedicated RPC to enable dsa
module is called. With this change this module is not
added to a global list and isn't used at all.

Signed-off-by: default avatarAlexey Marchuk <alexeymar@nvidia.com>
Change-Id: Id7594e8d69134c987050d51f5d951df786702ded
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18177


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
parent d6bed442
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/*   SPDX-License-Identifier: BSD-3-Clause
 *   Copyright (C) 2022 Intel Corporation.
 *   Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
 *   All rights reserved.
 */

@@ -276,6 +277,7 @@ static bool
dsa_supports_opcode(enum accel_opcode opc)
{
	if (!g_dsa_initialized) {
		assert(0);
		return false;
	}

@@ -307,8 +309,6 @@ static struct spdk_accel_module_if g_dsa_module = {
	.submit_tasks		= dsa_submit_tasks
};

SPDK_ACCEL_MODULE_REGISTER(dsa, &g_dsa_module)

static int
dsa_create_cb(void *io_device, void *ctx_buf)
{
@@ -371,6 +371,7 @@ accel_dsa_enable_probe(bool kernel_mode)
	g_kernel_mode = kernel_mode;
	g_dsa_enable = true;
	spdk_idxd_set_config(g_kernel_mode);
	spdk_accel_module_list_add(&g_dsa_module);
}

static bool