lib/accel: set RPC accel_get_opc_assignments as SPDK_RPC_RUNTIME
Add the processing of returning 0 for spdk_accel_get_opc_module_name(), and remove SPDK_RPC_STARTUP, because this will cause core dumped when run nvmf_tgt with --wait-for-rpc and no RPC framework_start_init. Fixes issue: 2770 Change-Id: I1c53ccb8caa52f2eaa0b8b560a021bded49d8fed Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15377 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This commit is contained in:
parent
2356d1d6f3
commit
f6a256c013
@ -34,12 +34,13 @@ rpc_accel_get_opc_assignments(struct spdk_jsonrpc_request *request,
|
|||||||
rc = _accel_get_opc_name(opcode, &name);
|
rc = _accel_get_opc_name(opcode, &name);
|
||||||
if (rc == 0) {
|
if (rc == 0) {
|
||||||
rc = spdk_accel_get_opc_module_name(opcode, &module_name);
|
rc = spdk_accel_get_opc_module_name(opcode, &module_name);
|
||||||
if (rc != 0) {
|
if (rc == 0) {
|
||||||
|
spdk_json_write_named_string(w, name, module_name);
|
||||||
|
} else {
|
||||||
/* This isn't fatal but throw an informational message if we
|
/* This isn't fatal but throw an informational message if we
|
||||||
* cant get an module name right now */
|
* cant get an module name right now */
|
||||||
SPDK_NOTICELOG("FYI error (%d) getting module name.\n", rc);
|
SPDK_NOTICELOG("FYI error (%d) getting module name.\n", rc);
|
||||||
}
|
}
|
||||||
spdk_json_write_named_string(w, name, module_name);
|
|
||||||
} else {
|
} else {
|
||||||
/* this should never happen */
|
/* this should never happen */
|
||||||
SPDK_ERRLOG("Invalid opcode (%d)).\n", opcode);
|
SPDK_ERRLOG("Invalid opcode (%d)).\n", opcode);
|
||||||
@ -50,8 +51,7 @@ rpc_accel_get_opc_assignments(struct spdk_jsonrpc_request *request,
|
|||||||
|
|
||||||
spdk_jsonrpc_end_result(request, w);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("accel_get_opc_assignments", rpc_accel_get_opc_assignments,
|
SPDK_RPC_REGISTER("accel_get_opc_assignments", rpc_accel_get_opc_assignments, SPDK_RPC_RUNTIME)
|
||||||
SPDK_RPC_STARTUP | SPDK_RPC_RUNTIME)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rpc_dump_module_info(struct module_info *info)
|
rpc_dump_module_info(struct module_info *info)
|
||||||
@ -101,8 +101,7 @@ rpc_accel_get_module_info(struct spdk_jsonrpc_request *request,
|
|||||||
spdk_json_write_array_end(info.w);
|
spdk_json_write_array_end(info.w);
|
||||||
spdk_jsonrpc_end_result(request, info.w);
|
spdk_jsonrpc_end_result(request, info.w);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("accel_get_module_info", rpc_accel_get_module_info,
|
SPDK_RPC_REGISTER("accel_get_module_info", rpc_accel_get_module_info, SPDK_RPC_RUNTIME)
|
||||||
SPDK_RPC_RUNTIME)
|
|
||||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(accel_get_module_info, accel_get_engine_info)
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(accel_get_module_info, accel_get_engine_info)
|
||||||
|
|
||||||
struct rpc_accel_assign_opc {
|
struct rpc_accel_assign_opc {
|
||||||
|
Loading…
Reference in New Issue
Block a user