scsi: qla2xxx: Move GPSC and GFPNID out of session management
Move GPSC & GFPNID commands out of session management to reduce time lag in reporting the session state to remote port. These commands are not essential when it comes to maintaining the rport state. Delay sending these commands after rport state is set to Online. Signed-off-by: Quinn Tran <quinn.tran@cavium.com> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
bee8b84686
commit
cc28e0ace9
|
@ -2279,8 +2279,6 @@ enum discovery_state {
|
||||||
DSC_LOGIN_PEND,
|
DSC_LOGIN_PEND,
|
||||||
DSC_LOGIN_FAILED,
|
DSC_LOGIN_FAILED,
|
||||||
DSC_GPDB,
|
DSC_GPDB,
|
||||||
DSC_GFPN_ID,
|
|
||||||
DSC_GPSC,
|
|
||||||
DSC_UPD_FCPORT,
|
DSC_UPD_FCPORT,
|
||||||
DSC_LOGIN_COMPLETE,
|
DSC_LOGIN_COMPLETE,
|
||||||
DSC_ADISC,
|
DSC_ADISC,
|
||||||
|
@ -3227,6 +3225,7 @@ enum qla_work_type {
|
||||||
QLA_EVT_GNNID,
|
QLA_EVT_GNNID,
|
||||||
QLA_EVT_GFPNID,
|
QLA_EVT_GFPNID,
|
||||||
QLA_EVT_SP_RETRY,
|
QLA_EVT_SP_RETRY,
|
||||||
|
QLA_EVT_IIDMA,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,8 @@ extern int qla2x00_post_async_prlo_work(struct scsi_qla_host *, fc_port_t *,
|
||||||
uint16_t *);
|
uint16_t *);
|
||||||
extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *,
|
extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *,
|
||||||
fc_port_t *, uint16_t *);
|
fc_port_t *, uint16_t *);
|
||||||
|
int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport);
|
||||||
|
void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport);
|
||||||
/*
|
/*
|
||||||
* Global Data in qla_os.c source file.
|
* Global Data in qla_os.c source file.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3175,7 +3175,6 @@ int qla24xx_async_gidpn(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
|
|
||||||
done_free_sp:
|
done_free_sp:
|
||||||
sp->free(sp);
|
sp->free(sp);
|
||||||
fcport->flags &= ~FCF_ASYNC_SENT;
|
|
||||||
done:
|
done:
|
||||||
fcport->flags &= ~FCF_ASYNC_ACTIVE;
|
fcport->flags &= ~FCF_ASYNC_ACTIVE;
|
||||||
return rval;
|
return rval;
|
||||||
|
@ -3239,7 +3238,7 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *vha, struct event_arg *ea)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qla24xx_post_upd_fcport_work(vha, ea->fcport);
|
qla_post_iidma_work(vha, fcport);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qla24xx_async_gpsc_sp_done(void *s, int res)
|
static void qla24xx_async_gpsc_sp_done(void *s, int res)
|
||||||
|
@ -3257,8 +3256,6 @@ static void qla24xx_async_gpsc_sp_done(void *s, int res)
|
||||||
"Async done-%s res %x, WWPN %8phC \n",
|
"Async done-%s res %x, WWPN %8phC \n",
|
||||||
sp->name, res, fcport->port_name);
|
sp->name, res, fcport->port_name);
|
||||||
|
|
||||||
fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
|
|
||||||
|
|
||||||
if (res == (DID_ERROR << 16)) {
|
if (res == (DID_ERROR << 16)) {
|
||||||
/* entry status error */
|
/* entry status error */
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -3327,7 +3324,6 @@ int qla24xx_async_gpsc(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
if (!sp)
|
if (!sp)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
fcport->flags |= FCF_ASYNC_SENT;
|
|
||||||
sp->type = SRB_CT_PTHRU_CMD;
|
sp->type = SRB_CT_PTHRU_CMD;
|
||||||
sp->name = "gpsc";
|
sp->name = "gpsc";
|
||||||
sp->gen1 = fcport->rscn_gen;
|
sp->gen1 = fcport->rscn_gen;
|
||||||
|
@ -4555,7 +4551,6 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
|
|
||||||
done_free_sp:
|
done_free_sp:
|
||||||
sp->free(sp);
|
sp->free(sp);
|
||||||
fcport->flags &= ~FCF_ASYNC_SENT;
|
|
||||||
done:
|
done:
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
@ -4617,7 +4612,6 @@ static void qla2x00_async_gfpnid_sp_done(void *s, int res)
|
||||||
struct event_arg ea;
|
struct event_arg ea;
|
||||||
u64 wwn;
|
u64 wwn;
|
||||||
|
|
||||||
fcport->flags &= ~FCF_ASYNC_SENT;
|
|
||||||
wwn = wwn_to_u64(fpn);
|
wwn = wwn_to_u64(fpn);
|
||||||
if (wwn)
|
if (wwn)
|
||||||
memcpy(fcport->fabric_port_name, fpn, WWN_SIZE);
|
memcpy(fcport->fabric_port_name, fpn, WWN_SIZE);
|
||||||
|
@ -4646,12 +4640,10 @@ int qla24xx_async_gfpnid(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
|
if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
|
||||||
return rval;
|
return rval;
|
||||||
|
|
||||||
fcport->disc_state = DSC_GFPN_ID;
|
|
||||||
sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC);
|
sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC);
|
||||||
if (!sp)
|
if (!sp)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
fcport->flags |= FCF_ASYNC_SENT;
|
|
||||||
sp->type = SRB_CT_PTHRU_CMD;
|
sp->type = SRB_CT_PTHRU_CMD;
|
||||||
sp->name = "gfpnid";
|
sp->name = "gfpnid";
|
||||||
sp->gen1 = fcport->rscn_gen;
|
sp->gen1 = fcport->rscn_gen;
|
||||||
|
|
|
@ -1021,30 +1021,11 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)
|
||||||
vha->fcport_count++;
|
vha->fcport_count++;
|
||||||
ea->fcport->login_succ = 1;
|
ea->fcport->login_succ = 1;
|
||||||
|
|
||||||
if (!IS_IIDMA_CAPABLE(vha->hw) ||
|
ql_dbg(ql_dbg_disc, vha, 0x20d6,
|
||||||
!vha->hw->flags.gpsc_supported) {
|
"%s %d %8phC post upd_fcport fcp_cnt %d\n",
|
||||||
ql_dbg(ql_dbg_disc, vha, 0x20d6,
|
__func__, __LINE__, ea->fcport->port_name,
|
||||||
"%s %d %8phC post upd_fcport fcp_cnt %d\n",
|
vha->fcport_count);
|
||||||
__func__, __LINE__, ea->fcport->port_name,
|
qla24xx_post_upd_fcport_work(vha, ea->fcport);
|
||||||
vha->fcport_count);
|
|
||||||
|
|
||||||
qla24xx_post_upd_fcport_work(vha, ea->fcport);
|
|
||||||
} else {
|
|
||||||
if (ea->fcport->id_changed) {
|
|
||||||
ea->fcport->id_changed = 0;
|
|
||||||
ql_dbg(ql_dbg_disc, vha, 0x20d7,
|
|
||||||
"%s %d %8phC post gfpnid fcp_cnt %d\n",
|
|
||||||
__func__, __LINE__, ea->fcport->port_name,
|
|
||||||
vha->fcport_count);
|
|
||||||
qla24xx_post_gfpnid_work(vha, ea->fcport);
|
|
||||||
} else {
|
|
||||||
ql_dbg(ql_dbg_disc, vha, 0x20d7,
|
|
||||||
"%s %d %8phC post gpsc fcp_cnt %d\n",
|
|
||||||
__func__, __LINE__, ea->fcport->port_name,
|
|
||||||
vha->fcport_count);
|
|
||||||
qla24xx_post_gpsc_work(vha, ea->fcport);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (ea->fcport->login_succ) {
|
} else if (ea->fcport->login_succ) {
|
||||||
/*
|
/*
|
||||||
* We have an existing session. A late RSCN delivery
|
* We have an existing session. A late RSCN delivery
|
||||||
|
@ -5058,6 +5039,24 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport)
|
||||||
|
{
|
||||||
|
qla2x00_iidma_fcport(vha, fcport);
|
||||||
|
qla24xx_update_fcport_fcp_prio(vha, fcport);
|
||||||
|
}
|
||||||
|
|
||||||
|
int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport)
|
||||||
|
{
|
||||||
|
struct qla_work_evt *e;
|
||||||
|
|
||||||
|
e = qla2x00_alloc_work(vha, QLA_EVT_IIDMA);
|
||||||
|
if (!e)
|
||||||
|
return QLA_FUNCTION_FAILED;
|
||||||
|
|
||||||
|
e->u.fcport.fcport = fcport;
|
||||||
|
return qla2x00_post_work(vha, e);
|
||||||
|
}
|
||||||
|
|
||||||
/* qla2x00_reg_remote_port is reserved for Initiator Mode only.*/
|
/* qla2x00_reg_remote_port is reserved for Initiator Mode only.*/
|
||||||
static void
|
static void
|
||||||
qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
|
qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
|
@ -5126,13 +5125,14 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
|
|
||||||
if (IS_QLAFX00(vha->hw)) {
|
if (IS_QLAFX00(vha->hw)) {
|
||||||
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
|
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
|
||||||
goto reg_port;
|
} else {
|
||||||
|
fcport->login_retry = 0;
|
||||||
|
fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
|
||||||
|
fcport->disc_state = DSC_LOGIN_COMPLETE;
|
||||||
|
fcport->deleted = 0;
|
||||||
|
fcport->logout_on_delete = 1;
|
||||||
|
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
|
||||||
}
|
}
|
||||||
fcport->login_retry = 0;
|
|
||||||
fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT);
|
|
||||||
fcport->disc_state = DSC_LOGIN_COMPLETE;
|
|
||||||
fcport->deleted = 0;
|
|
||||||
fcport->logout_on_delete = 1;
|
|
||||||
|
|
||||||
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
|
qla2x00_set_fcport_state(fcport, FCS_ONLINE);
|
||||||
qla2x00_iidma_fcport(vha, fcport);
|
qla2x00_iidma_fcport(vha, fcport);
|
||||||
|
@ -5144,7 +5144,6 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)
|
||||||
|
|
||||||
qla24xx_update_fcport_fcp_prio(vha, fcport);
|
qla24xx_update_fcport_fcp_prio(vha, fcport);
|
||||||
|
|
||||||
reg_port:
|
|
||||||
switch (vha->host->active_mode) {
|
switch (vha->host->active_mode) {
|
||||||
case MODE_INITIATOR:
|
case MODE_INITIATOR:
|
||||||
qla2x00_reg_remote_port(vha, fcport);
|
qla2x00_reg_remote_port(vha, fcport);
|
||||||
|
@ -5163,6 +5162,23 @@ reg_port:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) {
|
||||||
|
if (fcport->id_changed) {
|
||||||
|
fcport->id_changed = 0;
|
||||||
|
ql_dbg(ql_dbg_disc, vha, 0x20d7,
|
||||||
|
"%s %d %8phC post gfpnid fcp_cnt %d\n",
|
||||||
|
__func__, __LINE__, fcport->port_name,
|
||||||
|
vha->fcport_count);
|
||||||
|
qla24xx_post_gfpnid_work(vha, fcport);
|
||||||
|
} else {
|
||||||
|
ql_dbg(ql_dbg_disc, vha, 0x20d7,
|
||||||
|
"%s %d %8phC post gpsc fcp_cnt %d\n",
|
||||||
|
__func__, __LINE__, fcport->port_name,
|
||||||
|
vha->fcport_count);
|
||||||
|
qla24xx_post_gpsc_work(vha, fcport);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -5063,6 +5063,10 @@ qla2x00_do_work(struct scsi_qla_host *vha)
|
||||||
break;
|
break;
|
||||||
case QLA_EVT_SP_RETRY:
|
case QLA_EVT_SP_RETRY:
|
||||||
qla_sp_retry(vha, e);
|
qla_sp_retry(vha, e);
|
||||||
|
break;
|
||||||
|
case QLA_EVT_IIDMA:
|
||||||
|
qla_do_iidma_work(vha, e->u.fcport.fcport);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (e->flags & QLA_EVT_FLAG_FREE)
|
if (e->flags & QLA_EVT_FLAG_FREE)
|
||||||
kfree(e);
|
kfree(e);
|
||||||
|
|
|
@ -4835,7 +4835,6 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
|
||||||
switch (sess->disc_state) {
|
switch (sess->disc_state) {
|
||||||
case DSC_LOGIN_PEND:
|
case DSC_LOGIN_PEND:
|
||||||
case DSC_GPDB:
|
case DSC_GPDB:
|
||||||
case DSC_GPSC:
|
|
||||||
case DSC_UPD_FCPORT:
|
case DSC_UPD_FCPORT:
|
||||||
case DSC_LOGIN_COMPLETE:
|
case DSC_LOGIN_COMPLETE:
|
||||||
case DSC_ADISC:
|
case DSC_ADISC:
|
||||||
|
|
Loading…
Reference in a new issue