Skip to content

Commit cbe3114

Browse files
Quinn Trangregkh
authored andcommitted
scsi: qla2xxx: Relogin during fabric disturbance
[ Upstream commit bb2ca6b ] 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/[email protected] Fixes: 1560baf ("scsi: qla2xxx: Use complete switch scan for RSCN events") Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Nilesh Javali <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent bc3f207 commit cbe3114

File tree

1 file changed

+46
-10
lines changed

1 file changed

+46
-10
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,16 +1708,52 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
17081708
fc_port_t *fcport;
17091709
unsigned long flags;
17101710

1711-
fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
1712-
if (fcport) {
1713-
if (fcport->flags & FCF_FCP2_DEVICE) {
1714-
ql_dbg(ql_dbg_disc, vha, 0x2115,
1715-
"Delaying session delete for FCP2 portid=%06x %8phC ",
1716-
fcport->d_id.b24, fcport->port_name);
1717-
return;
1718-
}
1719-
fcport->scan_needed = 1;
1720-
fcport->rscn_gen++;
1711+
switch (ea->id.b.rsvd_1) {
1712+
case RSCN_PORT_ADDR:
1713+
fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
1714+
if (fcport) {
1715+
if (fcport->flags & FCF_FCP2_DEVICE) {
1716+
ql_dbg(ql_dbg_disc, vha, 0x2115,
1717+
"Delaying session delete for FCP2 portid=%06x %8phC ",
1718+
fcport->d_id.b24, fcport->port_name);
1719+
return;
1720+
}
1721+
fcport->scan_needed = 1;
1722+
fcport->rscn_gen++;
1723+
}
1724+
break;
1725+
case RSCN_AREA_ADDR:
1726+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
1727+
if (fcport->flags & FCF_FCP2_DEVICE)
1728+
continue;
1729+
1730+
if ((ea->id.b24 & 0xffff00) == (fcport->d_id.b24 & 0xffff00)) {
1731+
fcport->scan_needed = 1;
1732+
fcport->rscn_gen++;
1733+
}
1734+
}
1735+
break;
1736+
case RSCN_DOM_ADDR:
1737+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
1738+
if (fcport->flags & FCF_FCP2_DEVICE)
1739+
continue;
1740+
1741+
if ((ea->id.b24 & 0xff0000) == (fcport->d_id.b24 & 0xff0000)) {
1742+
fcport->scan_needed = 1;
1743+
fcport->rscn_gen++;
1744+
}
1745+
}
1746+
break;
1747+
case RSCN_FAB_ADDR:
1748+
default:
1749+
list_for_each_entry(fcport, &vha->vp_fcports, list) {
1750+
if (fcport->flags & FCF_FCP2_DEVICE)
1751+
continue;
1752+
1753+
fcport->scan_needed = 1;
1754+
fcport->rscn_gen++;
1755+
}
1756+
break;
17211757
}
17221758

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

0 commit comments

Comments
 (0)