aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_attr.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-08-03 12:36:24 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-14 09:42:12 -0400
commitbf8dae83fea151ebd74492740733e2ed62dc9f51 (patch)
tree85a04b04a8546bc542c10dd92135845712050cca /drivers/scsi/lpfc/lpfc_attr.c
parent67d1273385d454a3f1b083b807f2cdda95e995ec (diff)
[SCSI] lpfc 8.3.33: Allow per-hba interrupt rate tuning
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 2910208b5dfa..f7c5531d984c 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -3643,14 +3643,21 @@ lpfc_fcp_imax_store(struct device *dev, struct device_attribute *attr,
3643 struct lpfc_hba *phba = vport->phba; 3643 struct lpfc_hba *phba = vport->phba;
3644 int val = 0, i; 3644 int val = 0, i;
3645 3645
3646 /* fcp_imax is only valid for SLI4 */
3647 if (phba->sli_rev != LPFC_SLI_REV4)
3648 return -EINVAL;
3649
3646 /* Sanity check on user data */ 3650 /* Sanity check on user data */
3647 if (!isdigit(buf[0])) 3651 if (!isdigit(buf[0]))
3648 return -EINVAL; 3652 return -EINVAL;
3649 if (sscanf(buf, "%i", &val) != 1) 3653 if (sscanf(buf, "%i", &val) != 1)
3650 return -EINVAL; 3654 return -EINVAL;
3651 3655
3652 /* Value range is [636,651042] */ 3656 /*
3653 if (val < LPFC_MIM_IMAX || val > LPFC_DMULT_CONST) 3657 * Value range for the HBA is [5000,5000000]
3658 * The value for each EQ depends on how many EQs are configured.
3659 */
3660 if (val < LPFC_MIN_IMAX || val > LPFC_MAX_IMAX)
3654 return -EINVAL; 3661 return -EINVAL;
3655 3662
3656 phba->cfg_fcp_imax = (uint32_t)val; 3663 phba->cfg_fcp_imax = (uint32_t)val;
@@ -3662,13 +3669,14 @@ lpfc_fcp_imax_store(struct device *dev, struct device_attribute *attr,
3662 3669
3663/* 3670/*
3664# lpfc_fcp_imax: The maximum number of fast-path FCP interrupts per second 3671# lpfc_fcp_imax: The maximum number of fast-path FCP interrupts per second
3672# for the HBA.
3665# 3673#
3666# Value range is [636,651042]. Default value is 10000. 3674# Value range is [5,000 to 5,000,000]. Default value is 50,000.
3667*/ 3675*/
3668static int lpfc_fcp_imax = LPFC_FP_DEF_IMAX; 3676static int lpfc_fcp_imax = LPFC_DEF_IMAX;
3669module_param(lpfc_fcp_imax, int, S_IRUGO|S_IWUSR); 3677module_param(lpfc_fcp_imax, int, S_IRUGO|S_IWUSR);
3670MODULE_PARM_DESC(lpfc_fcp_imax, 3678MODULE_PARM_DESC(lpfc_fcp_imax,
3671 "Set the maximum number of fast-path FCP interrupts per second"); 3679 "Set the maximum number of FCP interrupts per second per HBA");
3672lpfc_param_show(fcp_imax) 3680lpfc_param_show(fcp_imax)
3673 3681
3674/** 3682/**
@@ -3687,14 +3695,19 @@ lpfc_param_show(fcp_imax)
3687static int 3695static int
3688lpfc_fcp_imax_init(struct lpfc_hba *phba, int val) 3696lpfc_fcp_imax_init(struct lpfc_hba *phba, int val)
3689{ 3697{
3690 if (val >= LPFC_MIM_IMAX && val <= LPFC_DMULT_CONST) { 3698 if (phba->sli_rev != LPFC_SLI_REV4) {
3699 phba->cfg_fcp_imax = 0;
3700 return 0;
3701 }
3702
3703 if (val >= LPFC_MIN_IMAX && val <= LPFC_MAX_IMAX) {
3691 phba->cfg_fcp_imax = val; 3704 phba->cfg_fcp_imax = val;
3692 return 0; 3705 return 0;
3693 } 3706 }
3694 3707
3695 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 3708 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3696 "3016 fcp_imax: %d out of range, using default\n", val); 3709 "3016 fcp_imax: %d out of range, using default\n", val);
3697 phba->cfg_fcp_imax = LPFC_FP_DEF_IMAX; 3710 phba->cfg_fcp_imax = LPFC_DEF_IMAX;
3698 3711
3699 return 0; 3712 return 0;
3700} 3713}