Commit b86af2c8 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

lib/iscsi: Extract spdk_iscsi_conn_migration



Put it in the iscsi.c

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


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent d4d03a5e
Loading
Loading
Loading
Loading
+38 −43
Original line number Diff line number Diff line
@@ -1197,23 +1197,10 @@ spdk_iscsi_conn_full_feature_migrate(void *arg1, void *arg2)
}

void
spdk_iscsi_conn_login_do_work(void *arg)
spdk_iscsi_conn_migration(struct spdk_iscsi_conn *conn)
{
	struct spdk_iscsi_conn	*conn = arg;
	int				lcore;
	int				rc;
	struct spdk_event		*event;

	/* iSCSI connection state check */
	rc = spdk_iscsi_conn_check_state(conn);
	if (rc < 0) {
		return;
	}

	/* Check if this connection transitioned to full feature phase. If it
	 * did, migrate it to a dedicated reactor for the target node.
	 */
	if (conn->login_phase == ISCSI_FULL_FEATURE_PHASE) {
	struct spdk_iscsi_tgt_node *target;

	lcore = spdk_iscsi_conn_allocate_reactor(conn->portal->cpumask);
@@ -1248,6 +1235,14 @@ spdk_iscsi_conn_login_do_work(void *arg)
				    conn, NULL);
	spdk_event_call(event);
}

void
spdk_iscsi_conn_login_do_work(void *arg)
{
	struct spdk_iscsi_conn	*conn = arg;

	/* iSCSI connection state check */
	spdk_iscsi_conn_check_state(conn);
}

void
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@ void spdk_shutdown_iscsi_conns(void);

int spdk_iscsi_conn_construct(struct spdk_iscsi_portal *portal, struct spdk_sock *sock);
void spdk_iscsi_conn_handle_nop(struct spdk_iscsi_conn *conn);
void spdk_iscsi_conn_migration(struct spdk_iscsi_conn *conn);
void spdk_iscsi_conn_logout(struct spdk_iscsi_conn *conn);
int spdk_iscsi_drop_conns(struct spdk_iscsi_conn *conn,
			  const char *conn_match, int drop_all);
+1 −0
Original line number Diff line number Diff line
@@ -2120,6 +2120,7 @@ spdk_iscsi_op_login_rsp_handle_t_bit(struct spdk_iscsi_conn *conn,
		}

		conn->full_feature = 1;
		spdk_iscsi_conn_migration(conn);
		break;

	default:
+5 −0
Original line number Diff line number Diff line
@@ -86,6 +86,11 @@ spdk_iscsi_portal_grp_close_all(void)
{
}

void
spdk_iscsi_conn_migration(struct spdk_iscsi_conn *conn)
{
}

void
spdk_iscsi_conn_free_pdu(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
{