aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic/fnic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/fnic/fnic_main.c')
-rw-r--r--drivers/scsi/fnic/fnic_main.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 835a9cdbac8b..bbf81ea3a252 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -74,6 +74,10 @@ module_param(fnic_trace_max_pages, uint, S_IRUGO|S_IWUSR);
74MODULE_PARM_DESC(fnic_trace_max_pages, "Total allocated memory pages " 74MODULE_PARM_DESC(fnic_trace_max_pages, "Total allocated memory pages "
75 "for fnic trace buffer"); 75 "for fnic trace buffer");
76 76
77static unsigned int fnic_max_qdepth = FNIC_DFLT_QUEUE_DEPTH;
78module_param(fnic_max_qdepth, uint, S_IRUGO|S_IWUSR);
79MODULE_PARM_DESC(fnic_max_qdepth, "Queue depth to report for each LUN");
80
77static struct libfc_function_template fnic_transport_template = { 81static struct libfc_function_template fnic_transport_template = {
78 .frame_send = fnic_send, 82 .frame_send = fnic_send,
79 .lport_set_port_id = fnic_set_port_id, 83 .lport_set_port_id = fnic_set_port_id,
@@ -91,7 +95,7 @@ static int fnic_slave_alloc(struct scsi_device *sdev)
91 if (!rport || fc_remote_port_chkready(rport)) 95 if (!rport || fc_remote_port_chkready(rport))
92 return -ENXIO; 96 return -ENXIO;
93 97
94 scsi_activate_tcq(sdev, FNIC_DFLT_QUEUE_DEPTH); 98 scsi_activate_tcq(sdev, fnic_max_qdepth);
95 return 0; 99 return 0;
96} 100}
97 101
@@ -552,13 +556,6 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
552 556
553 host->transportt = fnic_fc_transport; 557 host->transportt = fnic_fc_transport;
554 558
555 err = scsi_init_shared_tag_map(host, FNIC_MAX_IO_REQ);
556 if (err) {
557 shost_printk(KERN_ERR, fnic->lport->host,
558 "Unable to alloc shared tag map\n");
559 goto err_out_free_hba;
560 }
561
562 /* Setup PCI resources */ 559 /* Setup PCI resources */
563 pci_set_drvdata(pdev, fnic); 560 pci_set_drvdata(pdev, fnic);
564 561
@@ -671,6 +668,22 @@ static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
671 "aborting.\n"); 668 "aborting.\n");
672 goto err_out_dev_close; 669 goto err_out_dev_close;
673 } 670 }
671
672 /* Configure Maximum Outstanding IO reqs*/
673 if (fnic->config.io_throttle_count != FNIC_UCSM_DFLT_THROTTLE_CNT_BLD) {
674 host->can_queue = min_t(u32, FNIC_MAX_IO_REQ,
675 max_t(u32, FNIC_MIN_IO_REQ,
676 fnic->config.io_throttle_count));
677 }
678 fnic->fnic_max_tag_id = host->can_queue;
679
680 err = scsi_init_shared_tag_map(host, fnic->fnic_max_tag_id);
681 if (err) {
682 shost_printk(KERN_ERR, fnic->lport->host,
683 "Unable to alloc shared tag map\n");
684 goto err_out_dev_close;
685 }
686
674 host->max_lun = fnic->config.luns_per_tgt; 687 host->max_lun = fnic->config.luns_per_tgt;
675 host->max_id = FNIC_MAX_FCP_TARGET; 688 host->max_id = FNIC_MAX_FCP_TARGET;
676 host->max_cmd_len = FCOE_MAX_CMD_LEN; 689 host->max_cmd_len = FCOE_MAX_CMD_LEN;