diff options
author | Chad Dupuis <chad.dupuis@qlogic.com> | 2013-01-30 03:34:37 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-02-22 06:28:49 -0500 |
commit | 8d93f5502221cc8eb420da65dc86a5ef07b038d0 (patch) | |
tree | 650bd96fe243dfbd73388b88ac8c90464f0780a3 /drivers/scsi/qla2xxx/qla_os.c | |
parent | 6d1f6621fa12800fc84f62db9e0b7a6b623eb439 (diff) |
[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_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 10d23f8b7036..53efffce13a2 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -360,6 +360,9 @@ static void qla2x00_free_req_que(struct qla_hw_data *ha, struct req_que *req) | |||
360 | (req->length + 1) * sizeof(request_t), | 360 | (req->length + 1) * sizeof(request_t), |
361 | req->ring, req->dma); | 361 | req->ring, req->dma); |
362 | 362 | ||
363 | if (req) | ||
364 | kfree(req->outstanding_cmds); | ||
365 | |||
363 | kfree(req); | 366 | kfree(req); |
364 | req = NULL; | 367 | req = NULL; |
365 | } | 368 | } |
@@ -1010,7 +1013,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, | |||
1010 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1013 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1011 | req = vha->req; | 1014 | req = vha->req; |
1012 | for (cnt = 1; status == QLA_SUCCESS && | 1015 | for (cnt = 1; status == QLA_SUCCESS && |
1013 | cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { | 1016 | cnt < req->num_outstanding_cmds; cnt++) { |
1014 | sp = req->outstanding_cmds[cnt]; | 1017 | sp = req->outstanding_cmds[cnt]; |
1015 | if (!sp) | 1018 | if (!sp) |
1016 | continue; | 1019 | continue; |
@@ -1337,7 +1340,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) | |||
1337 | req = ha->req_q_map[que]; | 1340 | req = ha->req_q_map[que]; |
1338 | if (!req) | 1341 | if (!req) |
1339 | continue; | 1342 | continue; |
1340 | for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { | 1343 | if (!req->outstanding_cmds) |
1344 | continue; | ||
1345 | for (cnt = 1; cnt < req->num_outstanding_cmds; cnt++) { | ||
1341 | sp = req->outstanding_cmds[cnt]; | 1346 | sp = req->outstanding_cmds[cnt]; |
1342 | if (sp) { | 1347 | if (sp) { |
1343 | req->outstanding_cmds[cnt] = NULL; | 1348 | req->outstanding_cmds[cnt] = NULL; |
@@ -4733,7 +4738,7 @@ qla2x00_timer(scsi_qla_host_t *vha) | |||
4733 | cpu_flags); | 4738 | cpu_flags); |
4734 | req = ha->req_q_map[0]; | 4739 | req = ha->req_q_map[0]; |
4735 | for (index = 1; | 4740 | for (index = 1; |
4736 | index < MAX_OUTSTANDING_COMMANDS; | 4741 | index < req->num_outstanding_cmds; |
4737 | index++) { | 4742 | index++) { |
4738 | fc_port_t *sfcp; | 4743 | fc_port_t *sfcp; |
4739 | 4744 | ||