Skip to content

Commit 3b1bef6

Browse files
Chad DupuisJames Bottomley
authored andcommitted
[SCSI] qla2xxx: Set host can_queue value based on available resources.
Tell the mid-layer that number of commands we can queue is the available resources we have minus a small amount for internal commands. 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>
1 parent 965c77a commit 3b1bef6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,10 +2561,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
25612561

25622562
host = base_vha->host;
25632563
base_vha->req = req;
2564-
if (IS_QLAFX00(ha))
2565-
host->can_queue = QLAFX00_MAX_CANQUEUE;
2566-
else
2567-
host->can_queue = req->length + 128;
25682564
if (IS_QLA2XXX_MIDTYPE(ha))
25692565
base_vha->mgmt_svr_loop_id = 10 + base_vha->vp_idx;
25702566
else
@@ -2587,11 +2583,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
25872583
if (!IS_QLA82XX(ha))
25882584
host->sg_tablesize = QLA_SG_ALL;
25892585
}
2590-
ql_dbg(ql_dbg_init, base_vha, 0x0032,
2591-
"can_queue=%d, req=%p, "
2592-
"mgmt_svr_loop_id=%d, sg_tablesize=%d.\n",
2593-
host->can_queue, base_vha->req,
2594-
base_vha->mgmt_svr_loop_id, host->sg_tablesize);
25952586
host->max_id = ha->max_fibre_devices;
25962587
host->cmd_per_lun = 3;
25972588
host->unique_id = host->host_no;
@@ -2707,6 +2698,16 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
27072698
goto probe_failed;
27082699
}
27092700

2701+
if (IS_QLAFX00(ha))
2702+
host->can_queue = QLAFX00_MAX_CANQUEUE;
2703+
else
2704+
host->can_queue = req->num_outstanding_cmds - 10;
2705+
2706+
ql_dbg(ql_dbg_init, base_vha, 0x0032,
2707+
"can_queue=%d, req=%p, mgmt_svr_loop_id=%d, sg_tablesize=%d.\n",
2708+
host->can_queue, base_vha->req,
2709+
base_vha->mgmt_svr_loop_id, host->sg_tablesize);
2710+
27102711
if (ha->mqenable) {
27112712
if (qla25xx_setup_mode(base_vha)) {
27122713
ql_log(ql_log_warn, base_vha, 0x00ec,

0 commit comments

Comments
 (0)