intr: call intr_enable before thread lib init
Restrict spdk_interrupt_mode_enable must be called once prior to initializing the threading library. Change-Id: I833ff63fae19882e82154195d03dd7ce56ffb1de Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6707 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: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
26d7e3d4bb
commit
fbd6c30b8b
@ -2019,6 +2019,14 @@ static bool g_interrupt_mode = false;
|
||||
int
|
||||
spdk_interrupt_mode_enable(void)
|
||||
{
|
||||
/* It must be called once prior to initializing the threading library.
|
||||
* g_spdk_msg_mempool will be valid if thread library is initialized.
|
||||
*/
|
||||
if (g_spdk_msg_mempool) {
|
||||
SPDK_ERRLOG("Failed due to threading library is already initailzied.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
SPDK_NOTICELOG("Set SPDK running in interrupt mode.\n");
|
||||
g_interrupt_mode = true;
|
||||
|
Loading…
Reference in New Issue
Block a user