Commit e7578781 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

accel: always write JSON with an array of objects for accel modules



Patch below added writing out json configuration for accel modules.
(fad052b0) accel: add write_config json for accel modules

Out of two current modules, only idxd reported its confi out.
When idxd was not compiled in, then "framework_get_config accel"
RPC did not return a valid JSON. Following JSON was returned:
{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":}

Where "result" never had any property given.

This patch adds array object to encompas all accel modules.

Next patch in series will try to address the issue on JSON
level.

Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib0758db5406896f2a204920417619a3ab6fbde98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2550


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatar <dongx.yi@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent ae8099ca
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -257,11 +257,13 @@ spdk_accel_write_config_json(struct spdk_json_write_ctx *w)
	 * The accel engine has no config, there may be some in
	 * the modules though.
	 */
	spdk_json_write_array_begin(w);
	TAILQ_FOREACH(accel_engine_module, &spdk_accel_module_list, tailq) {
		if (accel_engine_module->write_config_json) {
			accel_engine_module->write_config_json(w);
		}
	}
	spdk_json_write_array_end(w);
}

void
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ DEPDIRS-nvme += rdma
endif

DEPDIRS-blob := log util thread
DEPDIRS-accel := log util thread
DEPDIRS-accel := log util thread json
DEPDIRS-jsonrpc := log util json
DEPDIRS-virtio := log util json thread

+0 −4
Original line number Diff line number Diff line
@@ -645,8 +645,6 @@ accel_engine_idxd_exit(void *ctx)
static void
accel_engine_idxd_write_config_json(struct spdk_json_write_ctx *w)
{
	spdk_json_write_array_begin(w);

	if (g_idxd_enable) {
		spdk_json_write_object_begin(w);
		spdk_json_write_named_string(w, "method", "idxd_scan_accel_engine");
@@ -655,8 +653,6 @@ accel_engine_idxd_write_config_json(struct spdk_json_write_ctx *w)
		spdk_json_write_object_end(w);
		spdk_json_write_object_end(w);
	}

	spdk_json_write_array_end(w);
}

SPDK_ACCEL_MODULE_REGISTER(accel_engine_idxd_init, accel_engine_idxd_exit,