aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_attr.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2008-09-07 11:52:04 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-13 09:28:57 -0400
commit977b5a0af6d22a1a0170057c19cde37eeac68acd (patch)
tree247128ab00aa554eca5366ff8fb3505930729eaf /drivers/scsi/lpfc/lpfc_attr.c
parentb522d7d42d7ce843885d4c6740c5bd50876a2971 (diff)
[SCSI] lpfc 8.2.8 v2 : Add sysfs control of target queue depth handling
Added new sysfs attribute lpfc_max_scsicmpl_time. Attribute, when enabled, will control target queue depth based on I/O completion time. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 21397f37010d..343b0b36ed22 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2297,6 +2297,48 @@ LPFC_VPORT_ATTR_RW(use_adisc, 0, 0, 1,
2297 "Use ADISC on rediscovery to authenticate FCP devices"); 2297 "Use ADISC on rediscovery to authenticate FCP devices");
2298 2298
2299/* 2299/*
2300# lpfc_max_scsicmpl_time: Use scsi command completion time to control I/O queue
2301# depth. Default value is 0. When the value of this parameter is zero the
2302# SCSI command completion time is not used for controlling I/O queue depth. When
2303# the parameter is set to a non-zero value, the I/O queue depth is controlled
2304# to limit the I/O completion time to the parameter value.
2305# The value is set in milliseconds.
2306*/
2307static int lpfc_max_scsicmpl_time;
2308module_param(lpfc_max_scsicmpl_time, int, 0);
2309MODULE_PARM_DESC(lpfc_max_scsicmpl_time,
2310 "Use command completion time to control queue depth");
2311lpfc_vport_param_show(max_scsicmpl_time);
2312lpfc_vport_param_init(max_scsicmpl_time, 0, 0, 60000);
2313static int
2314lpfc_max_scsicmpl_time_set(struct lpfc_vport *vport, int val)
2315{
2316 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2317 struct lpfc_nodelist *ndlp, *next_ndlp;
2318
2319 if (val == vport->cfg_max_scsicmpl_time)
2320 return 0;
2321 if ((val < 0) || (val > 60000))
2322 return -EINVAL;
2323 vport->cfg_max_scsicmpl_time = val;
2324
2325 spin_lock_irq(shost->host_lock);
2326 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
2327 if (!NLP_CHK_NODE_ACT(ndlp))
2328 continue;
2329 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
2330 continue;
2331 ndlp->cmd_qdepth = LPFC_MAX_TGT_QDEPTH;
2332 }
2333 spin_unlock_irq(shost->host_lock);
2334 return 0;
2335}
2336lpfc_vport_param_store(max_scsicmpl_time);
2337static DEVICE_ATTR(lpfc_max_scsicmpl_time, S_IRUGO | S_IWUSR,
2338 lpfc_max_scsicmpl_time_show,
2339 lpfc_max_scsicmpl_time_store);
2340
2341/*
2300# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value 2342# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value
2301# range is [0,1]. Default value is 0. 2343# range is [0,1]. Default value is 0.
2302*/ 2344*/
@@ -2459,6 +2501,7 @@ struct device_attribute *lpfc_hba_attrs[] = {
2459 &dev_attr_lpfc_enable_hba_reset, 2501 &dev_attr_lpfc_enable_hba_reset,
2460 &dev_attr_lpfc_enable_hba_heartbeat, 2502 &dev_attr_lpfc_enable_hba_heartbeat,
2461 &dev_attr_lpfc_sg_seg_cnt, 2503 &dev_attr_lpfc_sg_seg_cnt,
2504 &dev_attr_lpfc_max_scsicmpl_time,
2462 NULL, 2505 NULL,
2463}; 2506};
2464 2507
@@ -3580,6 +3623,7 @@ lpfc_get_vport_cfgparam(struct lpfc_vport *vport)
3580 lpfc_restrict_login_init(vport, lpfc_restrict_login); 3623 lpfc_restrict_login_init(vport, lpfc_restrict_login);
3581 lpfc_fcp_class_init(vport, lpfc_fcp_class); 3624 lpfc_fcp_class_init(vport, lpfc_fcp_class);
3582 lpfc_use_adisc_init(vport, lpfc_use_adisc); 3625 lpfc_use_adisc_init(vport, lpfc_use_adisc);
3626 lpfc_max_scsicmpl_time_init(vport, lpfc_max_scsicmpl_time);
3583 lpfc_fdmi_on_init(vport, lpfc_fdmi_on); 3627 lpfc_fdmi_on_init(vport, lpfc_fdmi_on);
3584 lpfc_discovery_threads_init(vport, lpfc_discovery_threads); 3628 lpfc_discovery_threads_init(vport, lpfc_discovery_threads);
3585 lpfc_max_luns_init(vport, lpfc_max_luns); 3629 lpfc_max_luns_init(vport, lpfc_max_luns);