Commit 040036bb authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Delay loop id allocation at login

Delay loop id allocation to login time
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 604e2e57
...@@ -580,36 +580,29 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, ...@@ -580,36 +580,29 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,
if (!found) { if (!found) {
/* fw has no record of this port */ /* fw has no record of this port */
if (fcport->loop_id == FC_NO_LOOP_ID) { for (i = 0; i < n; i++) {
qla2x00_find_new_loop_id(vha, fcport); e = &vha->gnl.l[i];
fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; id.b.domain = e->port_id[0];
} else { id.b.area = e->port_id[1];
for (i = 0; i < n; i++) { id.b.al_pa = e->port_id[2];
e = &vha->gnl.l[i]; id.b.rsvd_1 = 0;
id.b.domain = e->port_id[0]; loop_id = le16_to_cpu(e->nport_handle);
id.b.area = e->port_id[1];
id.b.al_pa = e->port_id[2]; if (fcport->d_id.b24 == id.b24) {
id.b.rsvd_1 = 0; conflict_fcport =
loop_id = le16_to_cpu(e->nport_handle); qla2x00_find_fcport_by_wwpn(vha,
e->port_name, 0);
if (fcport->d_id.b24 == id.b24) { ql_dbg(ql_dbg_disc, vha, 0x20e6,
conflict_fcport = "%s %d %8phC post del sess\n",
qla2x00_find_fcport_by_wwpn(vha, __func__, __LINE__,
e->port_name, 0); conflict_fcport->port_name);
qlt_schedule_sess_for_deletion
ql_dbg(ql_dbg_disc, vha, 0x20e6, (conflict_fcport, 1);
"%s %d %8phC post del sess\n",
__func__, __LINE__,
conflict_fcport->port_name);
qlt_schedule_sess_for_deletion
(conflict_fcport, 1);
}
if (fcport->loop_id == loop_id) {
/* FW already picked this loop id for another fcport */
qla2x00_find_new_loop_id(vha, fcport);
}
} }
/* FW already picked this loop id for another fcport */
if (fcport->loop_id == loop_id)
fcport->loop_id = FC_NO_LOOP_ID;
} }
qla24xx_fcport_handle_login(vha, fcport); qla24xx_fcport_handle_login(vha, fcport);
} }
...@@ -1104,6 +1097,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) ...@@ -1104,6 +1097,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)
static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport) static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport)
{ {
u8 login = 0; u8 login = 0;
int rc;
if (qla_tgt_mode_enabled(vha)) if (qla_tgt_mode_enabled(vha))
return; return;
...@@ -1129,6 +1123,18 @@ static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport) ...@@ -1129,6 +1123,18 @@ static void qla_chk_n2n_b4_login(struct scsi_qla_host *vha, fc_port_t *fcport)
} }
if (login) { if (login) {
if (fcport->loop_id == FC_NO_LOOP_ID) {
fcport->fw_login_state = DSC_LS_PORT_UNAVAIL;
rc = qla2x00_find_new_loop_id(vha, fcport);
if (rc) {
ql_dbg(ql_dbg_disc, vha, 0x20e6,
"%s %d %8phC post del sess - out of loopid\n",
__func__, __LINE__, fcport->port_name);
fcport->scan_state = 0;
qlt_schedule_sess_for_deletion(fcport, true);
return;
}
}
ql_dbg(ql_dbg_disc, vha, 0x20bf, ql_dbg(ql_dbg_disc, vha, 0x20bf,
"%s %d %8phC post login\n", "%s %d %8phC post login\n",
__func__, __LINE__, fcport->port_name); __func__, __LINE__, fcport->port_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment