Skip to content

Commit bb2ca6b

Browse files
Quinn Tranmartinkpetersen
authored andcommitted
scsi: qla2xxx: Relogin during fabric disturbance
For RSCN of type "Area, Domain, or Fabric", which indicate a portion or entire fabric was disturbed, current driver does not set the scan_need flag to indicate a session was affected by the disturbance. This in turn can lead to I/O timeout and delay of relogin. Hence initiate relogin in the event of fabric disturbance. Link: https://lore.kernel.org/r/20211026115412.27691-2-njavali@marvell.com Fixes: 1560baf ("scsi: qla2xxx: Use complete switch scan for RSCN events") Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Nilesh Javali <njavali@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2c2934c commit bb2ca6b

1 file changed

Lines changed: 45 additions & 9 deletions

File tree

‎drivers/scsi/qla2xxx/qla_init.c‎

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,16 +1786,52 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
17861786
fc_port_t *fcport;
17871787
unsigned long flags;
17881788

1789-
fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
1790-
if (fcport) {
1791-
if (fcport->flags & FCF_FCP2_DEVICE) {
1792-
ql_dbg(ql_dbg_disc, vha, 0x2115,
1793-
"Delaying session delete for FCP2 portid=%06x %8phC ",
1794-
fcport->d_id.b24, fcport->port_name);
1795-
return;
1789+
switch (ea->id.b.rsvd_1) {
1790+
case RSCN_PORT_ADDR:
1791+
fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
1792+
if (fcport) {
1793+
if (fcport->flags & FCF_FCP2_DEVICE) {
1794+
ql_dbg(ql_dbg_disc, vha, 0x2115,
1795+
"Delaying session delete for FCP2 portid=%06x %8phC ",
1796+
fcport->d_id.b24, fcport->port_name);
1797+
return;
1798+
}
1799+
fcport->scan_needed = 1;
1800+
fcport->rscn_gen++;
1801+
}
1802+
break;
1803+
case RSCN_AREA_ADDR:
1804+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
1805+
if (fcport->flags & FCF_FCP2_DEVICE)
1806+
continue;
1807+
1808+
if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) {
1809+
fcport->scan_needed = 1;
1810+
fcport->rscn_gen++;
1811+
}
17961812
}
1797-
fcport->scan_needed = 1;
1798-
fcport->rscn_gen++;
1813+
break;
1814+
case RSCN_DOM_ADDR:
1815+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
1816+
if (fcport->flags & FCF_FCP2_DEVICE)
1817+
continue;
1818+
1819+
if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) {
1820+
fcport->scan_needed = 1;
1821+
fcport->rscn_gen++;
1822+
}
1823+
}
1824+
break;
1825+
case RSCN_FAB_ADDR:
1826+
default:
1827+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
1828+
if (fcport->flags & FCF_FCP2_DEVICE)
1829+
continue;
1830+
1831+
fcport->scan_needed = 1;
1832+
fcport->rscn_gen++;
1833+
}
1834+
break;
17991835
}
18001836

18011837
spin_lock_irqsave(&vha->work_lock, flags);

0 commit comments

Comments
 (0)