Commit 9a0bd78b authored by Ziye Yang's avatar Ziye Yang Committed by Tomasz Zawadzki
Browse files

interrupt_tgt: Fix the interrupt mode usage issue.



When the application is not set with the interrupt mode,
we should fail the rpc.

Fixes issue #2023

Change-Id: I4157f220948b7c96f474682c41ac9d78977b1c40
Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8676


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatar <dongx.yi@intel.com>
parent 78ecd30d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -78,6 +78,14 @@ rpc_reactor_set_interrupt_mode(struct spdk_jsonrpc_request *request,
		return;
	}

	if (!spdk_interrupt_mode_is_enabled()) {
		SPDK_ERRLOG("Interrupt mode is not set when staring the application\n");
		spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
						 "spdk_json_decode_object failed");
		return;
	}


	SPDK_NOTICELOG("RPC Start to %s interrupt mode on reactor %d.\n",
		       req.disable_interrupt ? "disable" : "enable", req.lcore);
	if (req.lcore >= (int64_t)spdk_env_get_first_core() &&