aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2009-04-07 01:33:40 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-05-20 18:21:07 -0400
commit2afa19a9377ca61b9489e44bf50029574fbe63be (patch)
treecdfa3878eb04d833bbcd9ce92196bc4456b5ccf5 /drivers/scsi/qla2xxx/qla_init.c
parent7640335ea5b1a2da0d64303e6003012c619ae01a (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_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 9a343ec67567..059909c9f29b 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -786,7 +786,6 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
786 sizeof(uint32_t); 786 sizeof(uint32_t);
787 if (ha->mqenable) 787 if (ha->mqenable)
788 mq_size = sizeof(struct qla2xxx_mq_chain); 788 mq_size = sizeof(struct qla2xxx_mq_chain);
789
790 /* Allocate memory for Fibre Channel Event Buffer. */ 789 /* Allocate memory for Fibre Channel Event Buffer. */
791 if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha)) 790 if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))
792 goto try_eft; 791 goto try_eft;
@@ -850,8 +849,7 @@ cont_alloc:
850 rsp_q_size = rsp->length * sizeof(response_t); 849 rsp_q_size = rsp->length * sizeof(response_t);
851 850
852 dump_size = offsetof(struct qla2xxx_fw_dump, isp); 851 dump_size = offsetof(struct qla2xxx_fw_dump, isp);
853 dump_size += fixed_size + mem_size + req_q_size + rsp_q_size + 852 dump_size += fixed_size + mem_size + req_q_size + rsp_q_size + eft_size;
854 eft_size;
855 ha->chain_offset = dump_size; 853 ha->chain_offset = dump_size;
856 dump_size += mq_size + fce_size; 854 dump_size += mq_size + fce_size;
857 855
@@ -1013,12 +1011,14 @@ qla2x00_init_response_q_entries(struct rsp_que *rsp)
1013 uint16_t cnt; 1011 uint16_t cnt;
1014 response_t *pkt; 1012 response_t *pkt;
1015 1013
1014 rsp->ring_ptr = rsp->ring;
1015 rsp->ring_index = 0;
1016 rsp->status_srb = NULL;
1016 pkt = rsp->ring_ptr; 1017 pkt = rsp->ring_ptr;
1017 for (cnt = 0; cnt < rsp->length; cnt++) { 1018 for (cnt = 0; cnt < rsp->length; cnt++) {
1018 pkt->signature = RESPONSE_PROCESSED; 1019 pkt->signature = RESPONSE_PROCESSED;
1019 pkt++; 1020 pkt++;
1020 } 1021 }
1021
1022} 1022}
1023 1023
1024/** 1024/**
@@ -1176,7 +1176,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
1176 if (ha->flags.msix_enabled) { 1176 if (ha->flags.msix_enabled) {
1177 msix = &ha->msix_entries[1]; 1177 msix = &ha->msix_entries[1];
1178 DEBUG2_17(printk(KERN_INFO 1178 DEBUG2_17(printk(KERN_INFO
1179 "Reistering vector 0x%x for base que\n", msix->entry)); 1179 "Registering vector 0x%x for base que\n", msix->entry));
1180 icb->msix = cpu_to_le16(msix->entry); 1180 icb->msix = cpu_to_le16(msix->entry);
1181 } 1181 }
1182 /* Use alternate PCI bus number */ 1182 /* Use alternate PCI bus number */
@@ -1230,14 +1230,14 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
1230 spin_lock_irqsave(&ha->hardware_lock, flags); 1230 spin_lock_irqsave(&ha->hardware_lock, flags);
1231 1231
1232 /* Clear outstanding commands array. */ 1232 /* Clear outstanding commands array. */
1233 for (que = 0; que < ha->max_queues; que++) { 1233 for (que = 0; que < ha->max_req_queues; que++) {
1234 req = ha->req_q_map[que]; 1234 req = ha->req_q_map[que];
1235 if (!req) 1235 if (!req)
1236 continue; 1236 continue;
1237 for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) 1237 for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++)
1238 req->outstanding_cmds[cnt] = NULL; 1238 req->outstanding_cmds[cnt] = NULL;
1239 1239
1240 req->current_outstanding_cmd = 0; 1240 req->current_outstanding_cmd = 1;
1241 1241
1242 /* Initialize firmware. */ 1242 /* Initialize firmware. */
1243 req->ring_ptr = req->ring; 1243 req->ring_ptr = req->ring;
@@ -1245,13 +1245,10 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
1245 req->cnt = req->length; 1245 req->cnt = req->length;
1246 } 1246 }
1247 1247
1248 for (que = 0; que < ha->max_queues; que++) { 1248 for (que = 0; que < ha->max_rsp_queues; que++) {
1249 rsp = ha->rsp_q_map[que]; 1249 rsp = ha->rsp_q_map[que];
1250 if (!rsp) 1250 if (!rsp)
1251 continue; 1251 continue;
1252 rsp->ring_ptr = rsp->ring;
1253 rsp->ring_index = 0;
1254
1255 /* Initialize response queue entries */ 1252 /* Initialize response queue entries */
1256 qla2x00_init_response_q_entries(rsp); 1253 qla2x00_init_response_q_entries(rsp);
1257 } 1254 }
@@ -3180,8 +3177,7 @@ qla2x00_loop_resync(scsi_qla_host_t *vha)
3180{ 3177{
3181 int rval = QLA_SUCCESS; 3178 int rval = QLA_SUCCESS;
3182 uint32_t wait_time; 3179 uint32_t wait_time;
3183 struct qla_hw_data *ha = vha->hw; 3180 struct req_que *req = vha->req;
3184 struct req_que *req = ha->req_q_map[vha->req_ques[0]];
3185 struct rsp_que *rsp = req->rsp; 3181 struct rsp_que *rsp = req->rsp;
3186 3182
3187 atomic_set(&vha->loop_state, LOOP_UPDATE); 3183 atomic_set(&vha->loop_state, LOOP_UPDATE);
@@ -3448,7 +3444,7 @@ qla25xx_init_queues(struct qla_hw_data *ha)
3448 int ret = -1; 3444 int ret = -1;
3449 int i; 3445 int i;
3450 3446
3451 for (i = 1; i < ha->max_queues; i++) { 3447 for (i = 1; i < ha->max_rsp_queues; i++) {
3452 rsp = ha->rsp_q_map[i]; 3448 rsp = ha->rsp_q_map[i];
3453 if (rsp) { 3449 if (rsp) {
3454 rsp->options &= ~BIT_0; 3450 rsp->options &= ~BIT_0;
@@ -3462,6 +3458,8 @@ qla25xx_init_queues(struct qla_hw_data *ha)
3462 "%s Rsp que:%d inited\n", __func__, 3458 "%s Rsp que:%d inited\n", __func__,
3463 rsp->id)); 3459 rsp->id));
3464 } 3460 }
3461 }
3462 for (i = 1; i < ha->max_req_queues; i++) {
3465 req = ha->req_q_map[i]; 3463 req = ha->req_q_map[i];
3466 if (req) { 3464 if (req) {
3467 /* Clear outstanding commands array. */ 3465 /* Clear outstanding commands array. */
@@ -4165,7 +4163,7 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha)
4165 uint16_t mb[MAILBOX_REGISTER_COUNT]; 4163 uint16_t mb[MAILBOX_REGISTER_COUNT];
4166 struct qla_hw_data *ha = vha->hw; 4164 struct qla_hw_data *ha = vha->hw;
4167 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); 4165 struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
4168 struct req_que *req = ha->req_q_map[vha->req_ques[0]]; 4166 struct req_que *req = vha->req;
4169 struct rsp_que *rsp = req->rsp; 4167 struct rsp_que *rsp = req->rsp;
4170 4168
4171 if (!vha->vp_idx) 4169 if (!vha->vp_idx)