Skip to content

Commit 1560baf

Browse files
Quinn Tranmartinkpetersen
authored andcommitted
scsi: qla2xxx: Use complete switch scan for RSCN events
This patch removes unnecessary code to handle RSCN, instead performs full scan everytime driver receives RSCN Fixes: d4f7a16 ("scsi: qla2xxx: Remove ASYNC GIDPN switch command") Cc: [email protected] #4.19 Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 87d6814 commit 1560baf

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

drivers/scsi/qla2xxx/qla_init.c

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,29 +1471,6 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
14711471
return 0;
14721472
}
14731473

1474-
static
1475-
void qla24xx_handle_rscn_event(fc_port_t *fcport, struct event_arg *ea)
1476-
{
1477-
fcport->rscn_gen++;
1478-
1479-
ql_dbg(ql_dbg_disc, fcport->vha, 0x210c,
1480-
"%s %8phC DS %d LS %d\n",
1481-
__func__, fcport->port_name, fcport->disc_state,
1482-
fcport->fw_login_state);
1483-
1484-
if (fcport->flags & FCF_ASYNC_SENT)
1485-
return;
1486-
1487-
switch (fcport->disc_state) {
1488-
case DSC_DELETED:
1489-
case DSC_LOGIN_COMPLETE:
1490-
qla24xx_post_gpnid_work(fcport->vha, &ea->id);
1491-
break;
1492-
default:
1493-
break;
1494-
}
1495-
}
1496-
14971474
int qla24xx_post_newsess_work(struct scsi_qla_host *vha, port_id_t *id,
14981475
u8 *port_name, u8 *node_name, void *pla, u8 fc4_type)
14991476
{
@@ -1560,8 +1537,6 @@ static void qla_handle_els_plogi_done(scsi_qla_host_t *vha,
15601537

15611538
void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea)
15621539
{
1563-
fc_port_t *f, *tf;
1564-
uint32_t id = 0, mask, rid;
15651540
fc_port_t *fcport;
15661541

15671542
switch (ea->event) {
@@ -1574,10 +1549,6 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea)
15741549
case FCME_RSCN:
15751550
if (test_bit(UNLOADING, &vha->dpc_flags))
15761551
return;
1577-
switch (ea->id.b.rsvd_1) {
1578-
case RSCN_PORT_ADDR:
1579-
#define BIGSCAN 1
1580-
#if defined BIGSCAN & BIGSCAN > 0
15811552
{
15821553
unsigned long flags;
15831554
fcport = qla2x00_find_fcport_by_nportid
@@ -1596,59 +1567,6 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea)
15961567
}
15971568
spin_unlock_irqrestore(&vha->work_lock, flags);
15981569
}
1599-
#else
1600-
{
1601-
int rc;
1602-
fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1);
1603-
if (!fcport) {
1604-
/* cable moved */
1605-
rc = qla24xx_post_gpnid_work(vha, &ea->id);
1606-
if (rc) {
1607-
ql_log(ql_log_warn, vha, 0xd044,
1608-
"RSCN GPNID work failed %06x\n",
1609-
ea->id.b24);
1610-
}
1611-
} else {
1612-
ea->fcport = fcport;
1613-
fcport->scan_needed = 1;
1614-
qla24xx_handle_rscn_event(fcport, ea);
1615-
}
1616-
}
1617-
#endif
1618-
break;
1619-
case RSCN_AREA_ADDR:
1620-
case RSCN_DOM_ADDR:
1621-
if (ea->id.b.rsvd_1 == RSCN_AREA_ADDR) {
1622-
mask = 0xffff00;
1623-
ql_dbg(ql_dbg_async, vha, 0x5044,
1624-
"RSCN: Area 0x%06x was affected\n",
1625-
ea->id.b24);
1626-
} else {
1627-
mask = 0xff0000;
1628-
ql_dbg(ql_dbg_async, vha, 0x507a,
1629-
"RSCN: Domain 0x%06x was affected\n",
1630-
ea->id.b24);
1631-
}
1632-
1633-
rid = ea->id.b24 & mask;
1634-
list_for_each_entry_safe(f, tf, &vha->vp_fcports,
1635-
list) {
1636-
id = f->d_id.b24 & mask;
1637-
if (rid == id) {
1638-
ea->fcport = f;
1639-
qla24xx_handle_rscn_event(f, ea);
1640-
}
1641-
}
1642-
break;
1643-
case RSCN_FAB_ADDR:
1644-
default:
1645-
ql_log(ql_log_warn, vha, 0xd045,
1646-
"RSCN: Fabric was affected. Addr format %d\n",
1647-
ea->id.b.rsvd_1);
1648-
qla2x00_mark_all_devices_lost(vha, 1);
1649-
set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
1650-
set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags);
1651-
}
16521570
break;
16531571
case FCME_GNL_DONE:
16541572
qla24xx_handle_gnl_done_event(vha, ea);
@@ -1709,11 +1627,7 @@ void qla_rscn_replay(fc_port_t *fcport)
17091627
ea.event = FCME_RSCN;
17101628
ea.id = fcport->d_id;
17111629
ea.id.b.rsvd_1 = RSCN_PORT_ADDR;
1712-
#if defined BIGSCAN & BIGSCAN > 0
17131630
qla2x00_fcport_event_handler(fcport->vha, &ea);
1714-
#else
1715-
qla24xx_post_gpnid_work(fcport->vha, &ea.id);
1716-
#endif
17171631
}
17181632
}
17191633

0 commit comments

Comments
 (0)