subsystem/accel: add entry point for .write_config_json
Write config json for setting the selected accel module. Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: Ife11d4d4a776254b56fa6d24dc817481beb78c3c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/664 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
e753402aa1
commit
9e1b82ac9c
@ -140,6 +140,15 @@ int spdk_accel_submit_fill(struct spdk_accel_task *accel_req, struct spdk_io_cha
|
|||||||
*/
|
*/
|
||||||
size_t spdk_accel_task_size(void);
|
size_t spdk_accel_task_size(void);
|
||||||
|
|
||||||
|
struct spdk_json_write_ctx;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write Acceleration subsystem configuration into provided JSON context.
|
||||||
|
*
|
||||||
|
* \param w JSON write context
|
||||||
|
*/
|
||||||
|
void spdk_accel_write_config_json(struct spdk_json_write_ctx *w);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "spdk/event.h"
|
#include "spdk/event.h"
|
||||||
#include "spdk/log.h"
|
#include "spdk/log.h"
|
||||||
#include "spdk/thread.h"
|
#include "spdk/thread.h"
|
||||||
|
#include "spdk/json.h"
|
||||||
|
|
||||||
/* Accelerator Engine Framework: The following provides a top level
|
/* Accelerator Engine Framework: The following provides a top level
|
||||||
* generic API for the accelerator functions defined here. Modules,
|
* generic API for the accelerator functions defined here. Modules,
|
||||||
@ -230,6 +231,19 @@ spdk_accel_engine_module_finish_cb(void)
|
|||||||
g_fini_cb_arg = NULL;
|
g_fini_cb_arg = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
spdk_accel_write_config_json(struct spdk_json_write_ctx *w)
|
||||||
|
{
|
||||||
|
spdk_json_write_array_begin(w);
|
||||||
|
spdk_json_write_object_begin(w);
|
||||||
|
spdk_json_write_named_string(w, "method", "accel_set_module");
|
||||||
|
spdk_json_write_named_object_begin(w, "params");
|
||||||
|
spdk_json_write_named_uint32(w, "module", g_active_accel_module);
|
||||||
|
spdk_json_write_object_end(w);
|
||||||
|
spdk_json_write_object_end(w);
|
||||||
|
spdk_json_write_array_end(w);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
spdk_accel_engine_module_finish(void)
|
spdk_accel_engine_module_finish(void)
|
||||||
{
|
{
|
||||||
|
@ -60,11 +60,18 @@ spdk_accel_engine_subsystem_finish(void)
|
|||||||
spdk_accel_engine_finish(spdk_accel_engine_subsystem_finish_done, NULL);
|
spdk_accel_engine_finish(spdk_accel_engine_subsystem_finish_done, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
spdk_accel_engine_subsystem_write_config_json(struct spdk_json_write_ctx *w)
|
||||||
|
{
|
||||||
|
spdk_accel_write_config_json(w);
|
||||||
|
}
|
||||||
|
|
||||||
static struct spdk_subsystem g_spdk_subsystem_accel = {
|
static struct spdk_subsystem g_spdk_subsystem_accel = {
|
||||||
.name = "accel",
|
.name = "accel",
|
||||||
.init = spdk_accel_engine_subsystem_initialize,
|
.init = spdk_accel_engine_subsystem_initialize,
|
||||||
.fini = spdk_accel_engine_subsystem_finish,
|
.fini = spdk_accel_engine_subsystem_finish,
|
||||||
.config = spdk_accel_engine_config_text,
|
.config = spdk_accel_engine_config_text,
|
||||||
|
.write_config_json = spdk_accel_engine_subsystem_write_config_json,
|
||||||
};
|
};
|
||||||
|
|
||||||
SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_accel);
|
SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_accel);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"subsystems": [
|
"subsystems": [
|
||||||
{
|
{
|
||||||
"subsystem": "accel",
|
"subsystem": "accel",
|
||||||
"config": null
|
"config": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"subsystem": "interface",
|
"subsystem": "interface",
|
||||||
|
@ -23,6 +23,7 @@ def sort_json_object(o):
|
|||||||
|
|
||||||
def filter_methods(do_remove_global_rpcs):
|
def filter_methods(do_remove_global_rpcs):
|
||||||
global_rpcs = [
|
global_rpcs = [
|
||||||
|
'accel_set_module',
|
||||||
'iscsi_set_options',
|
'iscsi_set_options',
|
||||||
'nvmf_set_config',
|
'nvmf_set_config',
|
||||||
'nvmf_set_max_subsystems',
|
'nvmf_set_max_subsystems',
|
||||||
|
Loading…
Reference in New Issue
Block a user