aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-08-14 14:25:43 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-09-14 12:59:23 -0400
commite3d2b802ad4f4d405ec81c56cb099f0b29ba5bb1 (patch)
tree05273344edf6572608c930fea4ca464f2a140469 /drivers/scsi/lpfc
parent90695ee0e984ef425b9f5a9845314b925357ffdf (diff)
[SCSI] lpfc 8.3.34: Fix parameter field in CQE to mask for LOCAL_REJECT status
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_bsg.c6
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c16
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c17
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_hw4.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c17
7 files changed, 38 insertions, 23 deletions
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index 830f6cc9964a..f7368eb80415 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -195,7 +195,7 @@ lpfc_bsg_send_mgmt_cmd_cmp(struct lpfc_hba *phba,
195 195
196 if (rsp->ulpStatus) { 196 if (rsp->ulpStatus) {
197 if (rsp->ulpStatus == IOSTAT_LOCAL_REJECT) { 197 if (rsp->ulpStatus == IOSTAT_LOCAL_REJECT) {
198 switch (rsp->un.ulpWord[4] & 0xff) { 198 switch (rsp->un.ulpWord[4] & IOERR_PARAM_MASK) {
199 case IOERR_SEQUENCE_TIMEOUT: 199 case IOERR_SEQUENCE_TIMEOUT:
200 rc = -ETIMEDOUT; 200 rc = -ETIMEDOUT;
201 break; 201 break;
@@ -1234,7 +1234,7 @@ lpfc_issue_ct_rsp_cmp(struct lpfc_hba *phba,
1234 1234
1235 if (rsp->ulpStatus) { 1235 if (rsp->ulpStatus) {
1236 if (rsp->ulpStatus == IOSTAT_LOCAL_REJECT) { 1236 if (rsp->ulpStatus == IOSTAT_LOCAL_REJECT) {
1237 switch (rsp->un.ulpWord[4] & 0xff) { 1237 switch (rsp->un.ulpWord[4] & IOERR_PARAM_MASK) {
1238 case IOERR_SEQUENCE_TIMEOUT: 1238 case IOERR_SEQUENCE_TIMEOUT:
1239 rc = -ETIMEDOUT; 1239 rc = -ETIMEDOUT;
1240 break; 1240 break;
@@ -4798,7 +4798,7 @@ lpfc_bsg_menlo_cmd_cmp(struct lpfc_hba *phba,
4798 menlo_resp->xri = rsp->ulpContext; 4798 menlo_resp->xri = rsp->ulpContext;
4799 if (rsp->ulpStatus) { 4799 if (rsp->ulpStatus) {
4800 if (rsp->ulpStatus == IOSTAT_LOCAL_REJECT) { 4800 if (rsp->ulpStatus == IOSTAT_LOCAL_REJECT) {
4801 switch (rsp->un.ulpWord[4] & 0xff) { 4801 switch (rsp->un.ulpWord[4] & IOERR_PARAM_MASK) {
4802 case IOERR_SEQUENCE_TIMEOUT: 4802 case IOERR_SEQUENCE_TIMEOUT:
4803 rc = -ETIMEDOUT; 4803 rc = -ETIMEDOUT;
4804 break; 4804 break;
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 93e96b3c9097..7ffabb7e3afa 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -104,7 +104,8 @@ lpfc_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
104 if (unlikely(icmd->ulpStatus == IOSTAT_NEED_BUFFER)) { 104 if (unlikely(icmd->ulpStatus == IOSTAT_NEED_BUFFER)) {
105 lpfc_sli_hbqbuf_add_hbqs(phba, LPFC_ELS_HBQ); 105 lpfc_sli_hbqbuf_add_hbqs(phba, LPFC_ELS_HBQ);
106 } else if ((icmd->ulpStatus == IOSTAT_LOCAL_REJECT) && 106 } else if ((icmd->ulpStatus == IOSTAT_LOCAL_REJECT) &&
107 ((icmd->un.ulpWord[4] & 0xff) == IOERR_RCV_BUFFER_WAITING)) { 107 ((icmd->un.ulpWord[4] & IOERR_PARAM_MASK) ==
108 IOERR_RCV_BUFFER_WAITING)) {
108 /* Not enough posted buffers; Try posting more buffers */ 109 /* Not enough posted buffers; Try posting more buffers */
109 phba->fc_stat.NoRcvBuf++; 110 phba->fc_stat.NoRcvBuf++;
110 if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) 111 if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED))
@@ -633,7 +634,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
633 /* Check for retry */ 634 /* Check for retry */
634 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { 635 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) {
635 if (irsp->ulpStatus != IOSTAT_LOCAL_REJECT || 636 if (irsp->ulpStatus != IOSTAT_LOCAL_REJECT ||
636 irsp->un.ulpWord[4] != IOERR_NO_RESOURCES) 637 (irsp->un.ulpWord[4] && IOERR_PARAM_MASK) !=
638 IOERR_NO_RESOURCES)
637 vport->fc_ns_retry++; 639 vport->fc_ns_retry++;
638 640
639 /* CT command is being retried */ 641 /* CT command is being retried */
@@ -783,7 +785,9 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
783 if (cmdiocb->retry < LPFC_MAX_NS_RETRY) { 785 if (cmdiocb->retry < LPFC_MAX_NS_RETRY) {
784 retry = 1; 786 retry = 1;
785 if (irsp->ulpStatus == IOSTAT_LOCAL_REJECT) { 787 if (irsp->ulpStatus == IOSTAT_LOCAL_REJECT) {
786 switch (irsp->un.ulpWord[4]) { 788 switch ((irsp->un.ulpWord[4] &
789 IOERR_PARAM_MASK)) {
790
787 case IOERR_NO_RESOURCES: 791 case IOERR_NO_RESOURCES:
788 /* We don't increment the retry 792 /* We don't increment the retry
789 * count for this case. 793 * count for this case.
@@ -908,8 +912,10 @@ lpfc_cmpl_ct(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
908 cmdcode, irsp->ulpStatus, irsp->un.ulpWord[4]); 912 cmdcode, irsp->ulpStatus, irsp->un.ulpWord[4]);
909 913
910 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && 914 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
911 ((irsp->un.ulpWord[4] == IOERR_SLI_DOWN) || 915 (((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
912 (irsp->un.ulpWord[4] == IOERR_SLI_ABORTED))) 916 IOERR_SLI_DOWN) ||
917 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
918 IOERR_SLI_ABORTED)))
913 goto out; 919 goto out;
914 920
915 retry = cmdiocb->retry; 921 retry = cmdiocb->retry;
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index e0e0dd0a5df2..cfe533bc9790 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -962,7 +962,8 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
962 if ((phba->fcoe_cvl_eventtag_attn == 962 if ((phba->fcoe_cvl_eventtag_attn ==
963 phba->fcoe_cvl_eventtag) && 963 phba->fcoe_cvl_eventtag) &&
964 (irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && 964 (irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
965 (irsp->un.ulpWord[4] == IOERR_SLI_ABORTED)) 965 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
966 IOERR_SLI_ABORTED))
966 goto stop_rr_fcf_flogi; 967 goto stop_rr_fcf_flogi;
967 else 968 else
968 phba->fcoe_cvl_eventtag_attn = 969 phba->fcoe_cvl_eventtag_attn =
@@ -1108,8 +1109,10 @@ flogifail:
1108 /* Start discovery */ 1109 /* Start discovery */
1109 lpfc_disc_start(vport); 1110 lpfc_disc_start(vport);
1110 } else if (((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) || 1111 } else if (((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) ||
1111 ((irsp->un.ulpWord[4] != IOERR_SLI_ABORTED) && 1112 (((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) !=
1112 (irsp->un.ulpWord[4] != IOERR_SLI_DOWN))) && 1113 IOERR_SLI_ABORTED) &&
1114 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) !=
1115 IOERR_SLI_DOWN))) &&
1113 (phba->link_state != LPFC_CLEAR_LA)) { 1116 (phba->link_state != LPFC_CLEAR_LA)) {
1114 /* If FLOGI failed enable link interrupt. */ 1117 /* If FLOGI failed enable link interrupt. */
1115 lpfc_issue_clear_la(phba, vport); 1118 lpfc_issue_clear_la(phba, vport);
@@ -3070,7 +3073,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
3070 } 3073 }
3071 break; 3074 break;
3072 case IOSTAT_LOCAL_REJECT: 3075 case IOSTAT_LOCAL_REJECT:
3073 switch ((irsp->un.ulpWord[4] & 0xff)) { 3076 switch ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK)) {
3074 case IOERR_LOOP_OPEN_FAILURE: 3077 case IOERR_LOOP_OPEN_FAILURE:
3075 if (cmd == ELS_CMD_FLOGI) { 3078 if (cmd == ELS_CMD_FLOGI) {
3076 if (PCI_DEVICE_ID_HORNET == 3079 if (PCI_DEVICE_ID_HORNET ==
@@ -3277,7 +3280,8 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
3277 3280
3278 if (((cmd == ELS_CMD_PLOGI) || (cmd == ELS_CMD_ADISC)) && 3281 if (((cmd == ELS_CMD_PLOGI) || (cmd == ELS_CMD_ADISC)) &&
3279 ((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) || 3282 ((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) ||
3280 ((irsp->un.ulpWord[4] & 0xff) != IOERR_NO_RESOURCES))) { 3283 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) !=
3284 IOERR_NO_RESOURCES))) {
3281 /* Don't reset timer for no resources */ 3285 /* Don't reset timer for no resources */
3282 3286
3283 /* If discovery / RSCN timer is running, reset it */ 3287 /* If discovery / RSCN timer is running, reset it */
@@ -6870,7 +6874,8 @@ lpfc_els_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
6870 if (icmd->ulpStatus == IOSTAT_NEED_BUFFER) { 6874 if (icmd->ulpStatus == IOSTAT_NEED_BUFFER) {
6871 lpfc_sli_hbqbuf_add_hbqs(phba, LPFC_ELS_HBQ); 6875 lpfc_sli_hbqbuf_add_hbqs(phba, LPFC_ELS_HBQ);
6872 } else if (icmd->ulpStatus == IOSTAT_LOCAL_REJECT && 6876 } else if (icmd->ulpStatus == IOSTAT_LOCAL_REJECT &&
6873 (icmd->un.ulpWord[4] & 0xff) == IOERR_RCV_BUFFER_WAITING) { 6877 (icmd->un.ulpWord[4] & IOERR_PARAM_MASK) ==
6878 IOERR_RCV_BUFFER_WAITING) {
6874 phba->fc_stat.NoRcvBuf++; 6879 phba->fc_stat.NoRcvBuf++;
6875 /* Not enough posted buffers; Try posting more buffers */ 6880 /* Not enough posted buffers; Try posting more buffers */
6876 if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED)) 6881 if (!(phba->sli3_options & LPFC_SLI3_HBQ_ENABLED))
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 9ff188e1ca32..7398ca862e97 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -3245,6 +3245,7 @@ typedef struct {
3245#define IOERR_SLI_DOWN 0x101 /* ulpStatus - Driver defined */ 3245#define IOERR_SLI_DOWN 0x101 /* ulpStatus - Driver defined */
3246#define IOERR_SLI_BRESET 0x102 3246#define IOERR_SLI_BRESET 0x102
3247#define IOERR_SLI_ABORTED 0x103 3247#define IOERR_SLI_ABORTED 0x103
3248#define IOERR_PARAM_MASK 0x1ff
3248} PARM_ERR; 3249} PARM_ERR;
3249 3250
3250typedef union { 3251typedef union {
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index dc13612b8f3b..834b699cac76 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -344,7 +344,7 @@ struct lpfc_cqe {
344 * Define mask value for xri_aborted and wcqe completed CQE extended status. 344 * Define mask value for xri_aborted and wcqe completed CQE extended status.
345 * Currently, extended status is limited to 9 bits (0x0 -> 0x103) . 345 * Currently, extended status is limited to 9 bits (0x0 -> 0x103) .
346 */ 346 */
347#define WCQE_PARAM_MASK 0x1FF; 347#define WCQE_PARAM_MASK 0x1FF
348 348
349/* completion queue entry for wqe completions */ 349/* completion queue entry for wqe completions */
350struct lpfc_wcqe_complete { 350struct lpfc_wcqe_complete {
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index f035f3c7ec09..217a0ab06e85 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -3615,7 +3615,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
3615 cmd = lpfc_cmd->pCmd; 3615 cmd = lpfc_cmd->pCmd;
3616 shost = cmd->device->host; 3616 shost = cmd->device->host;
3617 3617
3618 lpfc_cmd->result = pIocbOut->iocb.un.ulpWord[4]; 3618 lpfc_cmd->result = (pIocbOut->iocb.un.ulpWord[4] & IOERR_PARAM_MASK);
3619 lpfc_cmd->status = pIocbOut->iocb.ulpStatus; 3619 lpfc_cmd->status = pIocbOut->iocb.ulpStatus;
3620 /* pick up SLI4 exhange busy status from HBA */ 3620 /* pick up SLI4 exhange busy status from HBA */
3621 lpfc_cmd->exch_busy = pIocbOut->iocb_flag & LPFC_EXCHANGE_BUSY; 3621 lpfc_cmd->exch_busy = pIocbOut->iocb_flag & LPFC_EXCHANGE_BUSY;
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 148a062d97c5..6bacbdf156d8 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -2963,7 +2963,8 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
2963 * queuedepths of the SCSI device. 2963 * queuedepths of the SCSI device.
2964 */ 2964 */
2965 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && 2965 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
2966 (irsp->un.ulpWord[4] == IOERR_NO_RESOURCES)) { 2966 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
2967 IOERR_NO_RESOURCES)) {
2967 spin_unlock_irqrestore(&phba->hbalock, iflag); 2968 spin_unlock_irqrestore(&phba->hbalock, iflag);
2968 phba->lpfc_rampdown_queue_depth(phba); 2969 phba->lpfc_rampdown_queue_depth(phba);
2969 spin_lock_irqsave(&phba->hbalock, iflag); 2970 spin_lock_irqsave(&phba->hbalock, iflag);
@@ -3135,7 +3136,8 @@ lpfc_sli_sp_handle_rspiocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3135 * queuedepths of the SCSI device. 3136 * queuedepths of the SCSI device.
3136 */ 3137 */
3137 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && 3138 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
3138 (irsp->un.ulpWord[4] == IOERR_NO_RESOURCES)) { 3139 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
3140 IOERR_NO_RESOURCES)) {
3139 spin_unlock_irqrestore(&phba->hbalock, iflag); 3141 spin_unlock_irqrestore(&phba->hbalock, iflag);
3140 phba->lpfc_rampdown_queue_depth(phba); 3142 phba->lpfc_rampdown_queue_depth(phba);
3141 spin_lock_irqsave(&phba->hbalock, iflag); 3143 spin_lock_irqsave(&phba->hbalock, iflag);
@@ -8642,7 +8644,7 @@ lpfc_sli4_abts_err_handler(struct lpfc_hba *phba,
8642 * LOCAL_REJECT and 0 for a failed ABTS exchange and later OCe and 8644 * LOCAL_REJECT and 0 for a failed ABTS exchange and later OCe and
8643 * LPe FW releases returned LOCAL_REJECT and SEQUENCE_TIMEOUT. 8645 * LPe FW releases returned LOCAL_REJECT and SEQUENCE_TIMEOUT.
8644 */ 8646 */
8645 ext_status = axri->parameter & WCQE_PARAM_MASK; 8647 ext_status = axri->parameter & IOERR_PARAM_MASK;
8646 if ((bf_get(lpfc_wcqe_xa_status, axri) == IOSTAT_LOCAL_REJECT) && 8648 if ((bf_get(lpfc_wcqe_xa_status, axri) == IOSTAT_LOCAL_REJECT) &&
8647 ((ext_status == IOERR_SEQUENCE_TIMEOUT) || (ext_status == 0))) 8649 ((ext_status == IOERR_SEQUENCE_TIMEOUT) || (ext_status == 0)))
8648 lpfc_sli_abts_recover_port(vport, ndlp); 8650 lpfc_sli_abts_recover_port(vport, ndlp);
@@ -11579,11 +11581,12 @@ lpfc_sli4_fp_handle_fcp_wcqe(struct lpfc_hba *phba, struct lpfc_queue *cq,
11579 /* If resource errors reported from HBA, reduce queue 11581 /* If resource errors reported from HBA, reduce queue
11580 * depth of the SCSI device. 11582 * depth of the SCSI device.
11581 */ 11583 */
11582 if ((bf_get(lpfc_wcqe_c_status, wcqe) == 11584 if (((bf_get(lpfc_wcqe_c_status, wcqe) ==
11583 IOSTAT_LOCAL_REJECT) && 11585 IOSTAT_LOCAL_REJECT)) &&
11584 (wcqe->parameter == IOERR_NO_RESOURCES)) { 11586 ((wcqe->parameter & IOERR_PARAM_MASK) ==
11587 IOERR_NO_RESOURCES))
11585 phba->lpfc_rampdown_queue_depth(phba); 11588 phba->lpfc_rampdown_queue_depth(phba);
11586 } 11589
11587 /* Log the error status */ 11590 /* Log the error status */
11588 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 11591 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
11589 "0373 FCP complete error: status=x%x, " 11592 "0373 FCP complete error: status=x%x, "