diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-04-07 01:33:40 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-20 18:21:07 -0400 |
commit | 2afa19a9377ca61b9489e44bf50029574fbe63be (patch) | |
tree | cdfa3878eb04d833bbcd9ce92196bc4456b5ccf5 /drivers/scsi/qla2xxx/qla_mbx.c | |
parent | 7640335ea5b1a2da0d64303e6003012c619ae01a (diff) |
[SCSI] qla2xxx: Add QoS support.
Set the number of request queues to the module paramater
ql2xmaxqueues. Each vport gets a request queue. The QoS value
set to the request queues determines priority control for queued
IOs. If QoS value is not specified, the vports use the default
queue 0.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4f7e94c4daaa..bfdc89f8569b 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -748,20 +748,20 @@ qla2x00_issue_iocb(scsi_qla_host_t *vha, void *buffer, dma_addr_t phys_addr, | |||
748 | * Kernel context. | 748 | * Kernel context. |
749 | */ | 749 | */ |
750 | int | 750 | int |
751 | qla2x00_abort_command(scsi_qla_host_t *vha, srb_t *sp, struct req_que *req) | 751 | qla2x00_abort_command(srb_t *sp) |
752 | { | 752 | { |
753 | unsigned long flags = 0; | 753 | unsigned long flags = 0; |
754 | fc_port_t *fcport; | ||
755 | int rval; | 754 | int rval; |
756 | uint32_t handle = 0; | 755 | uint32_t handle = 0; |
757 | mbx_cmd_t mc; | 756 | mbx_cmd_t mc; |
758 | mbx_cmd_t *mcp = &mc; | 757 | mbx_cmd_t *mcp = &mc; |
758 | fc_port_t *fcport = sp->fcport; | ||
759 | scsi_qla_host_t *vha = fcport->vha; | ||
759 | struct qla_hw_data *ha = vha->hw; | 760 | struct qla_hw_data *ha = vha->hw; |
761 | struct req_que *req = vha->req; | ||
760 | 762 | ||
761 | DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", vha->host_no)); | 763 | DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", vha->host_no)); |
762 | 764 | ||
763 | fcport = sp->fcport; | ||
764 | |||
765 | spin_lock_irqsave(&ha->hardware_lock, flags); | 765 | spin_lock_irqsave(&ha->hardware_lock, flags); |
766 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { | 766 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { |
767 | if (req->outstanding_cmds[handle] == sp) | 767 | if (req->outstanding_cmds[handle] == sp) |
@@ -800,7 +800,7 @@ qla2x00_abort_command(scsi_qla_host_t *vha, srb_t *sp, struct req_que *req) | |||
800 | } | 800 | } |
801 | 801 | ||
802 | int | 802 | int |
803 | qla2x00_abort_target(struct fc_port *fcport, unsigned int l) | 803 | qla2x00_abort_target(struct fc_port *fcport, unsigned int l, int tag) |
804 | { | 804 | { |
805 | int rval, rval2; | 805 | int rval, rval2; |
806 | mbx_cmd_t mc; | 806 | mbx_cmd_t mc; |
@@ -813,8 +813,8 @@ qla2x00_abort_target(struct fc_port *fcport, unsigned int l) | |||
813 | 813 | ||
814 | l = l; | 814 | l = l; |
815 | vha = fcport->vha; | 815 | vha = fcport->vha; |
816 | req = vha->hw->req_q_map[0]; | 816 | req = vha->hw->req_q_map[tag]; |
817 | rsp = vha->hw->rsp_q_map[0]; | 817 | rsp = vha->hw->rsp_q_map[tag]; |
818 | mcp->mb[0] = MBC_ABORT_TARGET; | 818 | mcp->mb[0] = MBC_ABORT_TARGET; |
819 | mcp->out_mb = MBX_9|MBX_2|MBX_1|MBX_0; | 819 | mcp->out_mb = MBX_9|MBX_2|MBX_1|MBX_0; |
820 | if (HAS_EXTENDED_IDS(vha->hw)) { | 820 | if (HAS_EXTENDED_IDS(vha->hw)) { |
@@ -850,7 +850,7 @@ qla2x00_abort_target(struct fc_port *fcport, unsigned int l) | |||
850 | } | 850 | } |
851 | 851 | ||
852 | int | 852 | int |
853 | qla2x00_lun_reset(struct fc_port *fcport, unsigned int l) | 853 | qla2x00_lun_reset(struct fc_port *fcport, unsigned int l, int tag) |
854 | { | 854 | { |
855 | int rval, rval2; | 855 | int rval, rval2; |
856 | mbx_cmd_t mc; | 856 | mbx_cmd_t mc; |
@@ -862,8 +862,8 @@ qla2x00_lun_reset(struct fc_port *fcport, unsigned int l) | |||
862 | DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->vha->host_no)); | 862 | DEBUG11(printk("%s(%ld): entered.\n", __func__, fcport->vha->host_no)); |
863 | 863 | ||
864 | vha = fcport->vha; | 864 | vha = fcport->vha; |
865 | req = vha->hw->req_q_map[0]; | 865 | req = vha->hw->req_q_map[tag]; |
866 | rsp = vha->hw->rsp_q_map[0]; | 866 | rsp = vha->hw->rsp_q_map[tag]; |
867 | mcp->mb[0] = MBC_LUN_RESET; | 867 | mcp->mb[0] = MBC_LUN_RESET; |
868 | mcp->out_mb = MBX_9|MBX_3|MBX_2|MBX_1|MBX_0; | 868 | mcp->out_mb = MBX_9|MBX_3|MBX_2|MBX_1|MBX_0; |
869 | if (HAS_EXTENDED_IDS(vha->hw)) | 869 | if (HAS_EXTENDED_IDS(vha->hw)) |
@@ -1492,9 +1492,14 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, | |||
1492 | dma_addr_t lg_dma; | 1492 | dma_addr_t lg_dma; |
1493 | uint32_t iop[2]; | 1493 | uint32_t iop[2]; |
1494 | struct qla_hw_data *ha = vha->hw; | 1494 | struct qla_hw_data *ha = vha->hw; |
1495 | struct req_que *req; | ||
1496 | struct rsp_que *rsp; | ||
1495 | 1497 | ||
1496 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); | 1498 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); |
1497 | 1499 | ||
1500 | req = vha->req; | ||
1501 | rsp = req->rsp; | ||
1502 | |||
1498 | lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma); | 1503 | lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma); |
1499 | if (lg == NULL) { | 1504 | if (lg == NULL) { |
1500 | DEBUG2_3(printk("%s(%ld): failed to allocate Login IOCB.\n", | 1505 | DEBUG2_3(printk("%s(%ld): failed to allocate Login IOCB.\n", |
@@ -1505,6 +1510,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, | |||
1505 | 1510 | ||
1506 | lg->entry_type = LOGINOUT_PORT_IOCB_TYPE; | 1511 | lg->entry_type = LOGINOUT_PORT_IOCB_TYPE; |
1507 | lg->entry_count = 1; | 1512 | lg->entry_count = 1; |
1513 | lg->handle = MAKE_HANDLE(req->id, lg->handle); | ||
1508 | lg->nport_handle = cpu_to_le16(loop_id); | 1514 | lg->nport_handle = cpu_to_le16(loop_id); |
1509 | lg->control_flags = __constant_cpu_to_le16(LCF_COMMAND_PLOGI); | 1515 | lg->control_flags = __constant_cpu_to_le16(LCF_COMMAND_PLOGI); |
1510 | if (opt & BIT_0) | 1516 | if (opt & BIT_0) |
@@ -1753,6 +1759,8 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, | |||
1753 | struct logio_entry_24xx *lg; | 1759 | struct logio_entry_24xx *lg; |
1754 | dma_addr_t lg_dma; | 1760 | dma_addr_t lg_dma; |
1755 | struct qla_hw_data *ha = vha->hw; | 1761 | struct qla_hw_data *ha = vha->hw; |
1762 | struct req_que *req; | ||
1763 | struct rsp_que *rsp; | ||
1756 | 1764 | ||
1757 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); | 1765 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); |
1758 | 1766 | ||
@@ -1764,8 +1772,14 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, | |||
1764 | } | 1772 | } |
1765 | memset(lg, 0, sizeof(struct logio_entry_24xx)); | 1773 | memset(lg, 0, sizeof(struct logio_entry_24xx)); |
1766 | 1774 | ||
1775 | if (ql2xmaxqueues > 1) | ||
1776 | req = ha->req_q_map[0]; | ||
1777 | else | ||
1778 | req = vha->req; | ||
1779 | rsp = req->rsp; | ||
1767 | lg->entry_type = LOGINOUT_PORT_IOCB_TYPE; | 1780 | lg->entry_type = LOGINOUT_PORT_IOCB_TYPE; |
1768 | lg->entry_count = 1; | 1781 | lg->entry_count = 1; |
1782 | lg->handle = MAKE_HANDLE(req->id, lg->handle); | ||
1769 | lg->nport_handle = cpu_to_le16(loop_id); | 1783 | lg->nport_handle = cpu_to_le16(loop_id); |
1770 | lg->control_flags = | 1784 | lg->control_flags = |
1771 | __constant_cpu_to_le16(LCF_COMMAND_LOGO|LCF_IMPL_LOGO); | 1785 | __constant_cpu_to_le16(LCF_COMMAND_LOGO|LCF_IMPL_LOGO); |
@@ -2204,21 +2218,21 @@ qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats, | |||
2204 | } | 2218 | } |
2205 | 2219 | ||
2206 | int | 2220 | int |
2207 | qla24xx_abort_command(scsi_qla_host_t *vha, srb_t *sp, struct req_que *req) | 2221 | qla24xx_abort_command(srb_t *sp) |
2208 | { | 2222 | { |
2209 | int rval; | 2223 | int rval; |
2210 | fc_port_t *fcport; | ||
2211 | unsigned long flags = 0; | 2224 | unsigned long flags = 0; |
2212 | 2225 | ||
2213 | struct abort_entry_24xx *abt; | 2226 | struct abort_entry_24xx *abt; |
2214 | dma_addr_t abt_dma; | 2227 | dma_addr_t abt_dma; |
2215 | uint32_t handle; | 2228 | uint32_t handle; |
2229 | fc_port_t *fcport = sp->fcport; | ||
2230 | struct scsi_qla_host *vha = fcport->vha; | ||
2216 | struct qla_hw_data *ha = vha->hw; | 2231 | struct qla_hw_data *ha = vha->hw; |
2232 | struct req_que *req = sp->que; | ||
2217 | 2233 | ||
2218 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); | 2234 | DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no)); |
2219 | 2235 | ||
2220 | fcport = sp->fcport; | ||
2221 | |||
2222 | spin_lock_irqsave(&ha->hardware_lock, flags); | 2236 | spin_lock_irqsave(&ha->hardware_lock, flags); |
2223 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { | 2237 | for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) { |
2224 | if (req->outstanding_cmds[handle] == sp) | 2238 | if (req->outstanding_cmds[handle] == sp) |
@@ -2240,6 +2254,7 @@ qla24xx_abort_command(scsi_qla_host_t *vha, srb_t *sp, struct req_que *req) | |||
2240 | 2254 | ||
2241 | abt->entry_type = ABORT_IOCB_TYPE; | 2255 | abt->entry_type = ABORT_IOCB_TYPE; |
2242 | abt->entry_count = 1; | 2256 | abt->entry_count = 1; |
2257 | abt->handle = MAKE_HANDLE(req->id, abt->handle); | ||
2243 | abt->nport_handle = cpu_to_le16(fcport->loop_id); | 2258 | abt->nport_handle = cpu_to_le16(fcport->loop_id); |
2244 | abt->handle_to_abort = handle; | 2259 | abt->handle_to_abort = handle; |
2245 | abt->port_id[0] = fcport->d_id.b.al_pa; | 2260 | abt->port_id[0] = fcport->d_id.b.al_pa; |
@@ -2281,7 +2296,7 @@ struct tsk_mgmt_cmd { | |||
2281 | 2296 | ||
2282 | static int | 2297 | static int |
2283 | __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, | 2298 | __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, |
2284 | unsigned int l) | 2299 | unsigned int l, int tag) |
2285 | { | 2300 | { |
2286 | int rval, rval2; | 2301 | int rval, rval2; |
2287 | struct tsk_mgmt_cmd *tsk; | 2302 | struct tsk_mgmt_cmd *tsk; |
@@ -2295,8 +2310,8 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, | |||
2295 | 2310 | ||
2296 | vha = fcport->vha; | 2311 | vha = fcport->vha; |
2297 | ha = vha->hw; | 2312 | ha = vha->hw; |
2298 | req = ha->req_q_map[0]; | 2313 | req = vha->req; |
2299 | rsp = ha->rsp_q_map[0]; | 2314 | rsp = req->rsp; |
2300 | tsk = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &tsk_dma); | 2315 | tsk = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &tsk_dma); |
2301 | if (tsk == NULL) { | 2316 | if (tsk == NULL) { |
2302 | DEBUG2_3(printk("%s(%ld): failed to allocate Task Management " | 2317 | DEBUG2_3(printk("%s(%ld): failed to allocate Task Management " |
@@ -2307,6 +2322,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, | |||
2307 | 2322 | ||
2308 | tsk->p.tsk.entry_type = TSK_MGMT_IOCB_TYPE; | 2323 | tsk->p.tsk.entry_type = TSK_MGMT_IOCB_TYPE; |
2309 | tsk->p.tsk.entry_count = 1; | 2324 | tsk->p.tsk.entry_count = 1; |
2325 | tsk->p.tsk.handle = MAKE_HANDLE(req->id, tsk->p.tsk.handle); | ||
2310 | tsk->p.tsk.nport_handle = cpu_to_le16(fcport->loop_id); | 2326 | tsk->p.tsk.nport_handle = cpu_to_le16(fcport->loop_id); |
2311 | tsk->p.tsk.timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); | 2327 | tsk->p.tsk.timeout = cpu_to_le16(ha->r_a_tov / 10 * 2); |
2312 | tsk->p.tsk.control_flags = cpu_to_le32(type); | 2328 | tsk->p.tsk.control_flags = cpu_to_le32(type); |
@@ -2353,15 +2369,15 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, | |||
2353 | } | 2369 | } |
2354 | 2370 | ||
2355 | int | 2371 | int |
2356 | qla24xx_abort_target(struct fc_port *fcport, unsigned int l) | 2372 | qla24xx_abort_target(struct fc_port *fcport, unsigned int l, int tag) |
2357 | { | 2373 | { |
2358 | return __qla24xx_issue_tmf("Target", TCF_TARGET_RESET, fcport, l); | 2374 | return __qla24xx_issue_tmf("Target", TCF_TARGET_RESET, fcport, l, tag); |
2359 | } | 2375 | } |
2360 | 2376 | ||
2361 | int | 2377 | int |
2362 | qla24xx_lun_reset(struct fc_port *fcport, unsigned int l) | 2378 | qla24xx_lun_reset(struct fc_port *fcport, unsigned int l, int tag) |
2363 | { | 2379 | { |
2364 | return __qla24xx_issue_tmf("Lun", TCF_LUN_RESET, fcport, l); | 2380 | return __qla24xx_issue_tmf("Lun", TCF_LUN_RESET, fcport, l, tag); |
2365 | } | 2381 | } |
2366 | 2382 | ||
2367 | int | 2383 | int |
@@ -3150,6 +3166,8 @@ qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req) | |||
3150 | WRT_REG_DWORD(®->req_q_in, 0); | 3166 | WRT_REG_DWORD(®->req_q_in, 0); |
3151 | WRT_REG_DWORD(®->req_q_out, 0); | 3167 | WRT_REG_DWORD(®->req_q_out, 0); |
3152 | } | 3168 | } |
3169 | req->req_q_in = ®->req_q_in; | ||
3170 | req->req_q_out = ®->req_q_out; | ||
3153 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 3171 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
3154 | 3172 | ||
3155 | rval = qla2x00_mailbox_command(vha, mcp); | 3173 | rval = qla2x00_mailbox_command(vha, mcp); |
@@ -3176,7 +3194,6 @@ qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) | |||
3176 | mcp->mb[6] = MSW(MSD(rsp->dma)); | 3194 | mcp->mb[6] = MSW(MSD(rsp->dma)); |
3177 | mcp->mb[7] = LSW(MSD(rsp->dma)); | 3195 | mcp->mb[7] = LSW(MSD(rsp->dma)); |
3178 | mcp->mb[5] = rsp->length; | 3196 | mcp->mb[5] = rsp->length; |
3179 | mcp->mb[11] = rsp->vp_idx; | ||
3180 | mcp->mb[14] = rsp->msix->entry; | 3197 | mcp->mb[14] = rsp->msix->entry; |
3181 | mcp->mb[13] = rsp->rid; | 3198 | mcp->mb[13] = rsp->rid; |
3182 | 3199 | ||
@@ -3188,7 +3205,7 @@ qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp) | |||
3188 | mcp->mb[8] = 0; | 3205 | mcp->mb[8] = 0; |
3189 | /* que out ptr index */ | 3206 | /* que out ptr index */ |
3190 | mcp->mb[9] = 0; | 3207 | mcp->mb[9] = 0; |
3191 | mcp->out_mb = MBX_14|MBX_13|MBX_12|MBX_11|MBX_10|MBX_9|MBX_8|MBX_7 | 3208 | mcp->out_mb = MBX_14|MBX_13|MBX_9|MBX_8|MBX_7 |
3192 | |MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; | 3209 | |MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; |
3193 | mcp->in_mb = MBX_0; | 3210 | mcp->in_mb = MBX_0; |
3194 | mcp->flags = MBX_DMA_OUT; | 3211 | mcp->flags = MBX_DMA_OUT; |