diff options
author | Chad Dupuis <chad.dupuis@qlogic.com> | 2013-01-30 12:34:37 +0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-02-22 15:28:49 +0400 |
commit | 8d93f5502221cc8eb420da65dc86a5ef07b038d0 (patch) | |
tree | 650bd96fe243dfbd73388b88ac8c90464f0780a3 /drivers/scsi/qla2xxx/qla_mid.c | |
parent | 6d1f6621fa12800fc84f62db9e0b7a6b623eb439 (diff) | |
download | linux-8d93f5502221cc8eb420da65dc86a5ef07b038d0.tar.xz |
[SCSI] qla2xxx: Determine the number of outstanding commands based on available resources.
Base the number of outstanding requests the driver will keep track of on the
available resources instead of being hard-coded.
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mid.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 20fd974f903a..95cb6e78bbcd 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c @@ -523,6 +523,7 @@ qla25xx_free_req_que(struct scsi_qla_host *vha, struct req_que *req) clear_bit(que_id, ha->req_qid_map); mutex_unlock(&ha->vport_lock); } + kfree(req->outstanding_cmds); kfree(req); req = NULL; } @@ -649,6 +650,10 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, goto que_failed; } + ret = qla2x00_alloc_outstanding_cmds(ha, req); + if (ret != QLA_SUCCESS) + goto que_failed; + mutex_lock(&ha->vport_lock); que_id = find_first_zero_bit(ha->req_qid_map, ha->max_req_queues); if (que_id >= ha->max_req_queues) { @@ -685,7 +690,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, "options=0x%x.\n", req->options); ql_dbg(ql_dbg_init, base_vha, 0x00dd, "options=0x%x.\n", req->options); - for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) + for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) req->outstanding_cmds[cnt] = NULL; req->current_outstanding_cmd = 1; |