Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: qla2xxx: Inline the qla2x00_fcport_event_handler() function

Instead of calling qla2x00_fcport_event_handler() and letting the switch
statement inside that function decide which other function to call, call
the latter function directly. Remove the event member from the event_arg
structure because it is no longer needed. Remove the
qla_handle_els_plogi_done() function because it is never called.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
897def20 72436192

+45 -133
-17
drivers/scsi/qla2xxx/qla_def.h
··· 2363 2363 DSC_LS_LOGO_PEND, 2364 2364 }; 2365 2365 2366 - enum fcport_mgt_event { 2367 - FCME_RELOGIN = 1, 2368 - FCME_RSCN, 2369 - FCME_PLOGI_DONE, /* Initiator side sent LLIOCB */ 2370 - FCME_PRLI_DONE, 2371 - FCME_GNL_DONE, 2372 - FCME_GPSC_DONE, 2373 - FCME_GPDB_DONE, 2374 - FCME_GPNID_DONE, 2375 - FCME_GFFID_DONE, 2376 - FCME_ADISC_DONE, 2377 - FCME_GNNID_DONE, 2378 - FCME_GFPNID_DONE, 2379 - FCME_ELS_PLOGI_DONE, 2380 - }; 2381 - 2382 2366 enum rscn_addr_format { 2383 2367 RSCN_PORT_ADDR, 2384 2368 RSCN_AREA_ADDR, ··· 2480 2496 #define QLA_FCPORT_FOUND 2 2481 2497 2482 2498 struct event_arg { 2483 - enum fcport_mgt_event event; 2484 2499 fc_port_t *fcport; 2485 2500 srb_t *sp; 2486 2501 port_id_t id;
+5 -1
drivers/scsi/qla2xxx/qla_gbl.h
··· 96 96 extern struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *, 97 97 int, int, bool); 98 98 extern int qla2xxx_delete_qpair(struct scsi_qla_host *, struct qla_qpair *); 99 - void qla2x00_fcport_event_handler(scsi_qla_host_t *, struct event_arg *); 99 + void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea); 100 + void qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, 101 + struct event_arg *ea); 102 + void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, 103 + struct event_arg *ea); 100 104 int qla24xx_async_gpdb(struct scsi_qla_host *, fc_port_t *, u8); 101 105 int qla24xx_async_prli(struct scsi_qla_host *, fc_port_t *); 102 106 int qla24xx_async_notify_ack(scsi_qla_host_t *, fc_port_t *,
+5 -10
drivers/scsi/qla2xxx/qla_gs.c
··· 3031 3031 be16_to_cpu(ct_rsp->rsp.gpsc.speed)); 3032 3032 } 3033 3033 memset(&ea, 0, sizeof(ea)); 3034 - ea.event = FCME_GPSC_DONE; 3035 3034 ea.rc = res; 3036 3035 ea.fcport = fcport; 3037 3036 ea.sp = sp; 3038 - qla2x00_fcport_event_handler(vha, &ea); 3037 + qla24xx_handle_gpsc_event(vha, &ea); 3039 3038 3040 3039 done: 3041 3040 sp->free(sp); ··· 3282 3283 ea.sp = sp; 3283 3284 ea.id = be_to_port_id(ct_req->req.port_id.port_id); 3284 3285 ea.rc = res; 3285 - ea.event = FCME_GPNID_DONE; 3286 3286 3287 3287 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); 3288 3288 list_del(&sp->elem); ··· 3300 3302 return; 3301 3303 } 3302 3304 3303 - qla2x00_fcport_event_handler(vha, &ea); 3305 + qla24xx_handle_gpnid_event(vha, &ea); 3304 3306 3305 3307 e = qla2x00_alloc_work(vha, QLA_EVT_UNMAP); 3306 3308 if (!e) { ··· 3479 3481 ea.sp = sp; 3480 3482 ea.fcport = sp->fcport; 3481 3483 ea.rc = res; 3482 - ea.event = FCME_GFFID_DONE; 3483 3484 3484 - qla2x00_fcport_event_handler(vha, &ea); 3485 + qla24xx_handle_gffid_event(vha, &ea); 3485 3486 sp->free(sp); 3486 3487 } 3487 3488 ··· 4260 4263 ea.fcport = fcport; 4261 4264 ea.sp = sp; 4262 4265 ea.rc = res; 4263 - ea.event = FCME_GNNID_DONE; 4264 4266 4265 4267 ql_dbg(ql_dbg_disc, vha, 0x204f, 4266 4268 "Async done-%s res %x, WWPN %8phC %8phC\n", 4267 4269 sp->name, res, fcport->port_name, fcport->node_name); 4268 4270 4269 - qla2x00_fcport_event_handler(vha, &ea); 4271 + qla24xx_handle_gnnid_event(vha, &ea); 4270 4272 4271 4273 sp->free(sp); 4272 4274 } ··· 4390 4394 ea.fcport = fcport; 4391 4395 ea.sp = sp; 4392 4396 ea.rc = res; 4393 - ea.event = FCME_GFPNID_DONE; 4394 4397 4395 4398 ql_dbg(ql_dbg_disc, vha, 0x204f, 4396 4399 "Async done-%s res %x, WWPN %8phC %8phC\n", 4397 4400 sp->name, res, fcport->port_name, fcport->fabric_port_name); 4398 4401 4399 - qla2x00_fcport_event_handler(vha, &ea); 4402 + qla24xx_handle_gfpnid_event(vha, &ea); 4400 4403 4401 4404 sp->free(sp); 4402 4405 }
+32 -99
drivers/scsi/qla2xxx/qla_init.c
··· 37 37 static int qla84xx_init_chip(scsi_qla_host_t *); 38 38 static int qla25xx_init_queues(struct qla_hw_data *); 39 39 static int qla24xx_post_prli_work(struct scsi_qla_host*, fc_port_t *); 40 - static void qla24xx_handle_plogi_done_event(struct scsi_qla_host *, 41 - struct event_arg *); 40 + static void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, 41 + struct event_arg *ea); 42 42 static void qla24xx_handle_prli_done_event(struct scsi_qla_host *, 43 43 struct event_arg *); 44 44 static void __qla24xx_handle_gpdb_event(scsi_qla_host_t *, struct event_arg *); ··· 263 263 264 264 if (!test_bit(UNLOADING, &vha->dpc_flags)) { 265 265 memset(&ea, 0, sizeof(ea)); 266 - ea.event = FCME_PLOGI_DONE; 267 266 ea.fcport = sp->fcport; 268 267 ea.data[0] = lio->u.logio.data[0]; 269 268 ea.data[1] = lio->u.logio.data[1]; 270 269 ea.iop[0] = lio->u.logio.iop[0]; 271 270 ea.iop[1] = lio->u.logio.iop[1]; 272 271 ea.sp = sp; 273 - qla2x00_fcport_event_handler(vha, &ea); 272 + qla24xx_handle_plogi_done_event(vha, &ea); 274 273 } 275 274 276 275 sp->free(sp); ··· 534 535 sp->fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); 535 536 536 537 memset(&ea, 0, sizeof(ea)); 537 - ea.event = FCME_ADISC_DONE; 538 538 ea.rc = res; 539 539 ea.data[0] = lio->u.logio.data[0]; 540 540 ea.data[1] = lio->u.logio.data[1]; ··· 542 544 ea.fcport = sp->fcport; 543 545 ea.sp = sp; 544 546 545 - qla2x00_fcport_event_handler(vha, &ea); 547 + qla24xx_handle_adisc_event(vha, &ea); 546 548 547 549 sp->free(sp); 548 550 } ··· 948 950 memset(&ea, 0, sizeof(ea)); 949 951 ea.sp = sp; 950 952 ea.rc = res; 951 - ea.event = FCME_GNL_DONE; 952 953 953 954 if (sp->u.iocb_cmd.u.mbx.in_mb[1] >= 954 955 sizeof(struct get_name_list_extended)) { ··· 986 989 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 987 990 ea.fcport = fcport; 988 991 989 - qla2x00_fcport_event_handler(vha, &ea); 992 + qla24xx_handle_gnl_done_event(vha, &ea); 990 993 } 991 994 992 995 /* create new fcport if fw has knowledge of new sessions */ ··· 1131 1134 1132 1135 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); 1133 1136 memset(&ea, 0, sizeof(ea)); 1134 - ea.event = FCME_GPDB_DONE; 1135 1137 ea.fcport = fcport; 1136 1138 ea.sp = sp; 1137 1139 1138 - qla2x00_fcport_event_handler(vha, &ea); 1140 + qla24xx_handle_gpdb_event(vha, &ea); 1139 1141 1140 1142 dma_pool_free(ha->s_dma_pool, sp->u.iocb_cmd.u.mbx.in, 1141 1143 sp->u.iocb_cmd.u.mbx.in_dma); ··· 1169 1173 1170 1174 if (!test_bit(UNLOADING, &vha->dpc_flags)) { 1171 1175 memset(&ea, 0, sizeof(ea)); 1172 - ea.event = FCME_PRLI_DONE; 1173 1176 ea.fcport = sp->fcport; 1174 1177 ea.data[0] = lio->u.logio.data[0]; 1175 1178 ea.data[1] = lio->u.logio.data[1]; ··· 1176 1181 ea.iop[1] = lio->u.logio.iop[1]; 1177 1182 ea.sp = sp; 1178 1183 1179 - qla2x00_fcport_event_handler(vha, &ea); 1184 + qla24xx_handle_prli_done_event(vha, &ea); 1180 1185 } 1181 1186 1182 1187 sp->free(sp); ··· 1639 1644 return qla2x00_post_work(vha, e); 1640 1645 } 1641 1646 1642 - static 1647 + void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea) 1648 + { 1649 + fc_port_t *fcport; 1650 + unsigned long flags; 1651 + 1652 + fcport = qla2x00_find_fcport_by_nportid(vha, &ea->id, 1); 1653 + if (fcport) { 1654 + fcport->scan_needed = 1; 1655 + fcport->rscn_gen++; 1656 + } 1657 + 1658 + spin_lock_irqsave(&vha->work_lock, flags); 1659 + if (vha->scan.scan_flags == 0) { 1660 + ql_dbg(ql_dbg_disc, vha, 0xffff, "%s: schedule\n", __func__); 1661 + vha->scan.scan_flags |= SF_QUEUED; 1662 + schedule_delayed_work(&vha->scan.scan_work, 5); 1663 + } 1664 + spin_unlock_irqrestore(&vha->work_lock, flags); 1665 + } 1666 + 1643 1667 void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, 1644 1668 struct event_arg *ea) 1645 1669 { 1646 1670 fc_port_t *fcport = ea->fcport; 1671 + 1672 + if (test_bit(UNLOADING, &vha->dpc_flags)) 1673 + return; 1647 1674 1648 1675 ql_dbg(ql_dbg_disc, vha, 0x2102, 1649 1676 "%s %8phC DS %d LS %d P %d del %d cnfl %p rscn %d|%d login %d|%d fl %x\n", ··· 1697 1680 qla24xx_fcport_handle_login(vha, fcport); 1698 1681 } 1699 1682 1700 - 1701 - static void qla_handle_els_plogi_done(scsi_qla_host_t *vha, 1702 - struct event_arg *ea) 1703 - { 1704 - ql_dbg(ql_dbg_disc, vha, 0x2118, 1705 - "%s %d %8phC post PRLI\n", 1706 - __func__, __LINE__, ea->fcport->port_name); 1707 - qla24xx_post_prli_work(vha, ea->fcport); 1708 - } 1709 - 1710 - void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) 1711 - { 1712 - fc_port_t *fcport; 1713 - 1714 - switch (ea->event) { 1715 - case FCME_RELOGIN: 1716 - if (test_bit(UNLOADING, &vha->dpc_flags)) 1717 - return; 1718 - 1719 - qla24xx_handle_relogin_event(vha, ea); 1720 - break; 1721 - case FCME_RSCN: 1722 - if (test_bit(UNLOADING, &vha->dpc_flags)) 1723 - return; 1724 - { 1725 - unsigned long flags; 1726 - 1727 - fcport = qla2x00_find_fcport_by_nportid 1728 - (vha, &ea->id, 1); 1729 - if (fcport) { 1730 - fcport->scan_needed = 1; 1731 - fcport->rscn_gen++; 1732 - } 1733 - 1734 - spin_lock_irqsave(&vha->work_lock, flags); 1735 - if (vha->scan.scan_flags == 0) { 1736 - ql_dbg(ql_dbg_disc, vha, 0xffff, 1737 - "%s: schedule\n", __func__); 1738 - vha->scan.scan_flags |= SF_QUEUED; 1739 - schedule_delayed_work(&vha->scan.scan_work, 5); 1740 - } 1741 - spin_unlock_irqrestore(&vha->work_lock, flags); 1742 - } 1743 - break; 1744 - case FCME_GNL_DONE: 1745 - qla24xx_handle_gnl_done_event(vha, ea); 1746 - break; 1747 - case FCME_GPSC_DONE: 1748 - qla24xx_handle_gpsc_event(vha, ea); 1749 - break; 1750 - case FCME_PLOGI_DONE: /* Initiator side sent LLIOCB */ 1751 - qla24xx_handle_plogi_done_event(vha, ea); 1752 - break; 1753 - case FCME_PRLI_DONE: 1754 - qla24xx_handle_prli_done_event(vha, ea); 1755 - break; 1756 - case FCME_GPDB_DONE: 1757 - qla24xx_handle_gpdb_event(vha, ea); 1758 - break; 1759 - case FCME_GPNID_DONE: 1760 - qla24xx_handle_gpnid_event(vha, ea); 1761 - break; 1762 - case FCME_GFFID_DONE: 1763 - qla24xx_handle_gffid_event(vha, ea); 1764 - break; 1765 - case FCME_ADISC_DONE: 1766 - qla24xx_handle_adisc_event(vha, ea); 1767 - break; 1768 - case FCME_GNNID_DONE: 1769 - qla24xx_handle_gnnid_event(vha, ea); 1770 - break; 1771 - case FCME_GFPNID_DONE: 1772 - qla24xx_handle_gfpnid_event(vha, ea); 1773 - break; 1774 - case FCME_ELS_PLOGI_DONE: 1775 - qla_handle_els_plogi_done(vha, ea); 1776 - break; 1777 - default: 1778 - BUG_ON(1); 1779 - break; 1780 - } 1781 - } 1782 - 1783 1683 /* 1784 1684 * RSCN(s) came in for this fcport, but the RSCN(s) was not able 1785 1685 * to be consumed by the fcport ··· 1714 1780 1715 1781 if (fcport->scan_needed) { 1716 1782 memset(&ea, 0, sizeof(ea)); 1717 - ea.event = FCME_RSCN; 1718 1783 ea.id = fcport->d_id; 1719 1784 ea.id.b.rsvd_1 = RSCN_PORT_ADDR; 1720 - qla2x00_fcport_event_handler(fcport->vha, &ea); 1785 + qla2x00_handle_rscn(fcport->vha, &ea); 1721 1786 } 1722 1787 } 1723 1788 ··· 1871 1938 } 1872 1939 } 1873 1940 1874 - static void 1941 + void 1875 1942 qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) 1876 1943 { 1877 1944 port_id_t cid; /* conflict Nport id */
+1 -2
drivers/scsi/qla2xxx/qla_iocb.c
··· 2741 2741 memset(&ea, 0, sizeof(ea)); 2742 2742 ea.fcport = fcport; 2743 2743 ea.rc = res; 2744 - ea.event = FCME_ELS_PLOGI_DONE; 2745 - qla2x00_fcport_event_handler(vha, &ea); 2744 + qla24xx_handle_plogi_done_event(vha, &ea); 2746 2745 } 2747 2746 2748 2747 e = qla2x00_alloc_work(vha, QLA_EVT_UNMAP);
+1 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 1118 1118 struct event_arg ea; 1119 1119 1120 1120 memset(&ea, 0, sizeof(ea)); 1121 - ea.event = FCME_RSCN; 1122 1121 ea.id.b24 = rscn_entry; 1123 1122 ea.id.b.rsvd_1 = rscn_entry >> 24; 1124 - qla2x00_fcport_event_handler(vha, &ea); 1123 + qla2x00_handle_rscn(vha, &ea); 1125 1124 qla2x00_post_aen_work(vha, FCH_EVT_RSCN, rscn_entry); 1126 1125 } 1127 1126 break;
+1 -2
drivers/scsi/qla2xxx/qla_os.c
··· 5328 5328 } else { 5329 5329 if (vha->hw->current_topology != ISP_CFG_NL) { 5330 5330 memset(&ea, 0, sizeof(ea)); 5331 - ea.event = FCME_RELOGIN; 5332 5331 ea.fcport = fcport; 5333 - qla2x00_fcport_event_handler(vha, &ea); 5332 + qla24xx_handle_relogin_event(vha, &ea); 5334 5333 } else if (vha->hw->current_topology == 5335 5334 ISP_CFG_NL) { 5336 5335 fcport->login_retry--;