Commit ebeac5de authored by GangCao's avatar GangCao Committed by Jim Harris
Browse files

event: add an assert check for obtained reactor



In the case that reactor is needed to be valid, add an
explicit assert there.

Change-Id: Ic47030d50a6a940ddf87a3744bae38c94dd7252e
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7320


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatar <dongx.yi@intel.com>
Reviewed-by: default avatarXiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
parent 567a3da8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ _reactor_set_notify_cpuset(void *arg1, void *arg2)
	struct spdk_reactor *target = arg1;
	struct spdk_reactor *reactor = spdk_reactor_get(spdk_env_get_current_core());

	assert(reactor != NULL);
	spdk_cpuset_set_cpu(&reactor->notify_cpuset, target->lcore, target->new_in_interrupt);
}

@@ -715,6 +716,7 @@ _reactors_scheduler_update_core_mode(void *ctx)
	}

	reactor = spdk_reactor_get(g_scheduler_core_number);
	assert(reactor != NULL);
	if (reactor->in_interrupt != g_core_infos[g_scheduler_core_number].interrupt_mode) {
		/* Switch next found reactor to new state */
		rc = spdk_reactor_set_interrupt_mode(g_scheduler_core_number,
@@ -1078,6 +1080,8 @@ thread_process_interrupts(void *arg)
	uint64_t now;
	int rc;

	assert(reactor != NULL);

	/* Update idle_tsc between the end of last intr_fn and the start of this intr_fn. */
	now = spdk_get_ticks();
	reactor->idle_tsc += now - reactor->tsc_last;