diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-10-02 15:17:02 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:01:42 -0500 |
commit | 45ed119035b27f240345b06e090d559874e3677a (patch) | |
tree | 14466c52a644d73ea90f30b885cfe4e3fc88d12e /drivers/scsi/lpfc/lpfc_attr.c | |
parent | 0d87841997125971b7a39d21d1435054f91884c3 (diff) |
[SCSI] lpfc 8.3.5: fix fcp command polling, add FIP mode, performance optimisations and devloss timout fixes
This patch includes the following changes:
- Fixed Panic/Hang when using polling mode for fcp commands
- Added support for Read_rev mbox bits indicating FIP mode of HBA
- Optimize performance of slow-path handling of els responses
- Add code to cleanup orphaned unsolicited receive sequences
- Fixed Devloss timeout when multiple initiators are in same zone
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 82005b8ad957..d55befb7cf4c 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -100,6 +100,28 @@ lpfc_drvr_version_show(struct device *dev, struct device_attribute *attr, | |||
100 | return snprintf(buf, PAGE_SIZE, LPFC_MODULE_DESC "\n"); | 100 | return snprintf(buf, PAGE_SIZE, LPFC_MODULE_DESC "\n"); |
101 | } | 101 | } |
102 | 102 | ||
103 | /** | ||
104 | * lpfc_enable_fip_show - Return the fip mode of the HBA | ||
105 | * @dev: class unused variable. | ||
106 | * @attr: device attribute, not used. | ||
107 | * @buf: on return contains the module description text. | ||
108 | * | ||
109 | * Returns: size of formatted string. | ||
110 | **/ | ||
111 | static ssize_t | ||
112 | lpfc_enable_fip_show(struct device *dev, struct device_attribute *attr, | ||
113 | char *buf) | ||
114 | { | ||
115 | struct Scsi_Host *shost = class_to_shost(dev); | ||
116 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | ||
117 | struct lpfc_hba *phba = vport->phba; | ||
118 | |||
119 | if (phba->hba_flag & HBA_FIP_SUPPORT) | ||
120 | return snprintf(buf, PAGE_SIZE, "1\n"); | ||
121 | else | ||
122 | return snprintf(buf, PAGE_SIZE, "0\n"); | ||
123 | } | ||
124 | |||
103 | static ssize_t | 125 | static ssize_t |
104 | lpfc_bg_info_show(struct device *dev, struct device_attribute *attr, | 126 | lpfc_bg_info_show(struct device *dev, struct device_attribute *attr, |
105 | char *buf) | 127 | char *buf) |
@@ -1134,6 +1156,9 @@ lpfc_poll_store(struct device *dev, struct device_attribute *attr, | |||
1134 | if ((val & 0x3) != val) | 1156 | if ((val & 0x3) != val) |
1135 | return -EINVAL; | 1157 | return -EINVAL; |
1136 | 1158 | ||
1159 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
1160 | val = 0; | ||
1161 | |||
1137 | spin_lock_irq(&phba->hbalock); | 1162 | spin_lock_irq(&phba->hbalock); |
1138 | 1163 | ||
1139 | old_val = phba->cfg_poll; | 1164 | old_val = phba->cfg_poll; |
@@ -1597,6 +1622,7 @@ static DEVICE_ATTR(num_discovered_ports, S_IRUGO, | |||
1597 | static DEVICE_ATTR(menlo_mgmt_mode, S_IRUGO, lpfc_mlomgmt_show, NULL); | 1622 | static DEVICE_ATTR(menlo_mgmt_mode, S_IRUGO, lpfc_mlomgmt_show, NULL); |
1598 | static DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); | 1623 | static DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); |
1599 | static DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, NULL); | 1624 | static DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, NULL); |
1625 | static DEVICE_ATTR(lpfc_enable_fip, S_IRUGO, lpfc_enable_fip_show, NULL); | ||
1600 | static DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, | 1626 | static DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, |
1601 | lpfc_board_mode_show, lpfc_board_mode_store); | 1627 | lpfc_board_mode_show, lpfc_board_mode_store); |
1602 | static DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset); | 1628 | static DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset); |
@@ -3128,15 +3154,6 @@ LPFC_ATTR_R(enable_hba_heartbeat, 1, 0, 1, "Enable HBA Heartbeat."); | |||
3128 | LPFC_ATTR_R(enable_bg, 0, 0, 1, "Enable BlockGuard Support"); | 3154 | LPFC_ATTR_R(enable_bg, 0, 0, 1, "Enable BlockGuard Support"); |
3129 | 3155 | ||
3130 | /* | 3156 | /* |
3131 | # lpfc_enable_fip: When set, FIP is required to start discovery. If not | ||
3132 | # set, the driver will add an FCF record manually if the port has no | ||
3133 | # FCF records available and start discovery. | ||
3134 | # Value range is [0,1]. Default value is 1 (enabled) | ||
3135 | */ | ||
3136 | LPFC_ATTR_RW(enable_fip, 0, 0, 1, "Enable FIP Discovery"); | ||
3137 | |||
3138 | |||
3139 | /* | ||
3140 | # lpfc_prot_mask: i | 3157 | # lpfc_prot_mask: i |
3141 | # - Bit mask of host protection capabilities used to register with the | 3158 | # - Bit mask of host protection capabilities used to register with the |
3142 | # SCSI mid-layer | 3159 | # SCSI mid-layer |
@@ -3194,6 +3211,7 @@ struct device_attribute *lpfc_hba_attrs[] = { | |||
3194 | &dev_attr_num_discovered_ports, | 3211 | &dev_attr_num_discovered_ports, |
3195 | &dev_attr_menlo_mgmt_mode, | 3212 | &dev_attr_menlo_mgmt_mode, |
3196 | &dev_attr_lpfc_drvr_version, | 3213 | &dev_attr_lpfc_drvr_version, |
3214 | &dev_attr_lpfc_enable_fip, | ||
3197 | &dev_attr_lpfc_temp_sensor, | 3215 | &dev_attr_lpfc_temp_sensor, |
3198 | &dev_attr_lpfc_log_verbose, | 3216 | &dev_attr_lpfc_log_verbose, |
3199 | &dev_attr_lpfc_lun_queue_depth, | 3217 | &dev_attr_lpfc_lun_queue_depth, |
@@ -3201,7 +3219,6 @@ struct device_attribute *lpfc_hba_attrs[] = { | |||
3201 | &dev_attr_lpfc_peer_port_login, | 3219 | &dev_attr_lpfc_peer_port_login, |
3202 | &dev_attr_lpfc_nodev_tmo, | 3220 | &dev_attr_lpfc_nodev_tmo, |
3203 | &dev_attr_lpfc_devloss_tmo, | 3221 | &dev_attr_lpfc_devloss_tmo, |
3204 | &dev_attr_lpfc_enable_fip, | ||
3205 | &dev_attr_lpfc_fcp_class, | 3222 | &dev_attr_lpfc_fcp_class, |
3206 | &dev_attr_lpfc_use_adisc, | 3223 | &dev_attr_lpfc_use_adisc, |
3207 | &dev_attr_lpfc_ack0, | 3224 | &dev_attr_lpfc_ack0, |
@@ -3256,7 +3273,6 @@ struct device_attribute *lpfc_vport_attrs[] = { | |||
3256 | &dev_attr_lpfc_lun_queue_depth, | 3273 | &dev_attr_lpfc_lun_queue_depth, |
3257 | &dev_attr_lpfc_nodev_tmo, | 3274 | &dev_attr_lpfc_nodev_tmo, |
3258 | &dev_attr_lpfc_devloss_tmo, | 3275 | &dev_attr_lpfc_devloss_tmo, |
3259 | &dev_attr_lpfc_enable_fip, | ||
3260 | &dev_attr_lpfc_hba_queue_depth, | 3276 | &dev_attr_lpfc_hba_queue_depth, |
3261 | &dev_attr_lpfc_peer_port_login, | 3277 | &dev_attr_lpfc_peer_port_login, |
3262 | &dev_attr_lpfc_restrict_login, | 3278 | &dev_attr_lpfc_restrict_login, |
@@ -4412,13 +4428,15 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) | |||
4412 | lpfc_enable_hba_reset_init(phba, lpfc_enable_hba_reset); | 4428 | lpfc_enable_hba_reset_init(phba, lpfc_enable_hba_reset); |
4413 | lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat); | 4429 | lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat); |
4414 | lpfc_enable_bg_init(phba, lpfc_enable_bg); | 4430 | lpfc_enable_bg_init(phba, lpfc_enable_bg); |
4431 | if (phba->sli_rev == LPFC_SLI_REV4) | ||
4432 | phba->cfg_poll = 0; | ||
4433 | else | ||
4415 | phba->cfg_poll = lpfc_poll; | 4434 | phba->cfg_poll = lpfc_poll; |
4416 | phba->cfg_soft_wwnn = 0L; | 4435 | phba->cfg_soft_wwnn = 0L; |
4417 | phba->cfg_soft_wwpn = 0L; | 4436 | phba->cfg_soft_wwpn = 0L; |
4418 | lpfc_sg_seg_cnt_init(phba, lpfc_sg_seg_cnt); | 4437 | lpfc_sg_seg_cnt_init(phba, lpfc_sg_seg_cnt); |
4419 | lpfc_prot_sg_seg_cnt_init(phba, lpfc_prot_sg_seg_cnt); | 4438 | lpfc_prot_sg_seg_cnt_init(phba, lpfc_prot_sg_seg_cnt); |
4420 | lpfc_hba_queue_depth_init(phba, lpfc_hba_queue_depth); | 4439 | lpfc_hba_queue_depth_init(phba, lpfc_hba_queue_depth); |
4421 | lpfc_enable_fip_init(phba, lpfc_enable_fip); | ||
4422 | lpfc_hba_log_verbose_init(phba, lpfc_log_verbose); | 4440 | lpfc_hba_log_verbose_init(phba, lpfc_log_verbose); |
4423 | lpfc_aer_support_init(phba, lpfc_aer_support); | 4441 | lpfc_aer_support_init(phba, lpfc_aer_support); |
4424 | 4442 | ||