Commit d10401cc authored by Ziye Yang's avatar Ziye Yang Committed by Changpeng Liu
Browse files

iscsi: Solve the potential no io channel issue.



Reason: If we trigger the spdk_iscsi_conn_migration,
we may face the issue that the io channel of lun
is NULL(which means not allocated). So I think
that if we trigger the migration, we need to
stop the executing the further pdu of this conn
by the current polling group.

Also since the connection is triggered migration,
we should stop execution on the current core, and
let this connection be handled by next round.

Change-Id: I0ab89d79c976f3233890ae25cb7eac98de5e30ac
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/409984


Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent 3dab6c95
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ spdk_iscsi_poll_group_add_conn(struct spdk_iscsi_conn *conn)
{
	struct spdk_iscsi_poll_group *poll_group = &g_spdk_iscsi.poll_group[spdk_env_get_current_core()];

	conn->is_stopped = false;
	STAILQ_INSERT_TAIL(&poll_group->connections, conn, link);
	spdk_iscsi_poll_group_add_conn_sock(conn);
}
@@ -209,6 +210,7 @@ spdk_iscsi_poll_group_remove_conn(struct spdk_iscsi_conn *conn)
{
	struct spdk_iscsi_poll_group *poll_group = &g_spdk_iscsi.poll_group[spdk_env_get_current_core()];

	conn->is_stopped = true;
	STAILQ_REMOVE(&poll_group->connections, conn, spdk_iscsi_conn, link);
}

@@ -1154,6 +1156,10 @@ spdk_iscsi_conn_handle_incoming_pdus(struct spdk_iscsi_conn *conn)
				    conn->initiator_port != NULL ? spdk_scsi_port_get_name(conn->initiator_port) : "NULL");
			return rc;
		}

		if (conn->is_stopped) {
			break;
		}
	}

	return i;
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ struct spdk_iscsi_conn {

	STAILQ_ENTRY(spdk_iscsi_conn) link;
	struct spdk_poller	*flush_poller;
	bool			is_stopped;  /* Set true when connection is stopped for migration */
	TAILQ_HEAD(queued_r2t_tasks, spdk_iscsi_task)	queued_r2t_tasks;
	TAILQ_HEAD(active_r2t_tasks, spdk_iscsi_task)	active_r2t_tasks;
	TAILQ_HEAD(queued_datain_tasks, spdk_iscsi_task)	queued_datain_tasks;