lib/iscsi: Extract spdk_iscsi_conn_migration

Put it in the iscsi.c

Change-Id: Ifb2843fb7c78f9ca948eac60704547b8b0635bf0
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402484
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ziye Yang 2018-03-05 08:01:00 +08:00 committed by Jim Harris
parent d4d03a5ecf
commit b86af2c8d2
4 changed files with 48 additions and 46 deletions

View File

@ -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);
@ -1247,7 +1234,15 @@ spdk_iscsi_conn_login_do_work(void *arg)
event = spdk_event_allocate(lcore, spdk_iscsi_conn_full_feature_migrate,
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

View File

@ -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);

View File

@ -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:

View File

@ -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)
{