Commit 5202993d authored by Krzysztof Sprzaczkowski's avatar Krzysztof Sprzaczkowski Committed by Tomasz Zawadzki
Browse files

module/accel: Cannot save configuration with IOAT accel module enabled



Added write config JSON function for IOAT accel module

Fixes issue #3251.

Change-Id: Ifbbbed42fe2a2758d925913d5dbebf55003586c2
Signed-off-by: default avatarKrzysztof Sprzaczkowski <krzysztof.sprzaczkowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21892


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 5434834a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ DEPDIRS-blobfs_bdev += event
endif

# module/accel
DEPDIRS-accel_ioat := log ioat thread jsonrpc rpc accel
DEPDIRS-accel_ioat := log ioat thread $(JSON_LIBS) accel
DEPDIRS-accel_dsa := log util idxd thread $(JSON_LIBS) accel trace
DEPDIRS-accel_iaa := log util idxd thread $(JSON_LIBS) accel trace
DEPDIRS-accel_dpdk_cryptodev := log thread $(JSON_LIBS) accel util
+13 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include "spdk/event.h"
#include "spdk/thread.h"
#include "spdk/ioat.h"
#include "spdk/json.h"

static bool g_ioat_enable = false;
static bool g_ioat_initialized = false;
@@ -71,6 +72,7 @@ ioat_free_device(struct ioat_device *dev)

static int accel_ioat_init(void);
static void accel_ioat_exit(void *ctx);
static void accel_ioat_write_config_json(struct spdk_json_write_ctx *w);
static bool ioat_supports_opcode(enum spdk_accel_opcode opc);
static struct spdk_io_channel *ioat_get_io_channel(void);
static int ioat_submit_tasks(struct spdk_io_channel *ch, struct spdk_accel_task *accel_task);
@@ -84,7 +86,7 @@ accel_ioat_get_ctx_size(void)
static struct spdk_accel_module_if g_ioat_module = {
	.module_init = accel_ioat_init,
	.module_fini = accel_ioat_exit,
	.write_config_json = NULL,
	.write_config_json = accel_ioat_write_config_json,
	.get_ctx_size = accel_ioat_get_ctx_size,
	.name			= "ioat",
	.supports_opcode	= ioat_supports_opcode,
@@ -335,4 +337,14 @@ accel_ioat_exit(void *ctx)
	}
}

static void
accel_ioat_write_config_json(struct spdk_json_write_ctx *w)
{
	if (g_ioat_enable) {
		spdk_json_write_object_begin(w);
		spdk_json_write_named_string(w, "method", "ioat_scan_accel_module");
		spdk_json_write_object_end(w);
	}
}

SPDK_LOG_REGISTER_COMPONENT(accel_ioat)