cnic: Fix parity error code conflict
authorMichael Chan <mchan@broadcom.com>
Wed, 21 Mar 2012 15:38:34 +0000 (15:38 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Mar 2012 01:57:36 +0000 (21:57 -0400)
The recently added parity error handling used an error code that was
already defined for a different error.  This could lead to bnx2x
firmware assert.  We need to fix this with new error codes that are
defined for parity error only.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Eddie Wai <eddie.wai@broadcom.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/cnic.c
drivers/net/ethernet/broadcom/cnic_defs.h
drivers/net/ethernet/broadcom/cnic_if.h
drivers/scsi/bnx2fc/bnx2fc_constants.h
drivers/scsi/bnx2i/57xx_iscsi_constants.h

index 7b65716b8734451356d9f49584db8bdb55615776..c95e7b5e2b85589db86db943c3c77b697394312b 100644 (file)
@@ -47,6 +47,7 @@
 #include "bnx2x/bnx2x_hsi.h"
 #include "../../../scsi/bnx2i/57xx_iscsi_constants.h"
 #include "../../../scsi/bnx2i/57xx_iscsi_hsi.h"
+#include "../../../scsi/bnx2fc/bnx2fc_constants.h"
 #include "cnic.h"
 #include "cnic_defs.h"
 
@@ -2547,7 +2548,7 @@ static void cnic_bnx2x_kwqe_err(struct cnic_dev *dev, struct kwqe *kwqe)
                }
                kcqe.kcqe_op_flag = kcqe_op << KCQE_FLAGS_OPCODE_SHIFT;
                kcqe.kcqe_op_flag |= KCQE_FLAGS_LAYER_MASK_L5_FCOE;
-               kcqe.kcqe_info1 = FCOE_KCQE_COMPLETION_STATUS_NIC_ERROR;
+               kcqe.kcqe_info1 = FCOE_KCQE_COMPLETION_STATUS_PARITY_ERROR;
                kcqe.kcqe_info2 = cid;
                kcqe.kcqe_info0 = l5_cid;
 
@@ -2558,7 +2559,7 @@ static void cnic_bnx2x_kwqe_err(struct cnic_dev *dev, struct kwqe *kwqe)
 
                kcqe.kcqe_op_flag = (opcode + 0x10) << KCQE_FLAGS_OPCODE_SHIFT;
                kcqe.kcqe_op_flag |= KCQE_FLAGS_LAYER_MASK_L5_ISCSI;
-               kcqe.kcqe_info1 = ISCSI_KCQE_COMPLETION_STATUS_NIC_ERROR;
+               kcqe.kcqe_info1 = ISCSI_KCQE_COMPLETION_STATUS_PARITY_ERR;
                kcqe.kcqe_info2 = cid;
                cnic_get_l5_cid(cp, BNX2X_SW_CID(cid), &kcqe.kcqe_info0);
 
@@ -2577,7 +2578,7 @@ static void cnic_bnx2x_kwqe_err(struct cnic_dev *dev, struct kwqe *kwqe)
 
                kcqe.kcqe_op_flag = (kcqe_op << KCQE_FLAGS_OPCODE_SHIFT) |
                                    KCQE_FLAGS_LAYER_MASK_L4;
-               l4kcqe->status = L4_KCQE_COMPLETION_STATUS_NIC_ERROR;
+               l4kcqe->status = L4_KCQE_COMPLETION_STATUS_PARITY_ERROR;
                l4kcqe->cid = cid;
                cnic_get_l5_cid(cp, BNX2X_SW_CID(cid), &l4kcqe->conn_id);
        } else {
@@ -3933,7 +3934,8 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
        case L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE:
                if (l4kcqe->status == 0)
                        set_bit(SK_F_OFFLD_COMPLETE, &csk->flags);
-               else if (l4kcqe->status == L4_KCQE_COMPLETION_STATUS_NIC_ERROR)
+               else if (l4kcqe->status ==
+                        L4_KCQE_COMPLETION_STATUS_PARITY_ERROR)
                        set_bit(SK_F_HW_ERR, &csk->flags);
 
                smp_mb__before_clear_bit();
@@ -3946,7 +3948,7 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
        case L4_KCQE_OPCODE_VALUE_RESET_COMP:
        case L5CM_RAMROD_CMD_ID_SEARCHER_DELETE:
        case L5CM_RAMROD_CMD_ID_TERMINATE_OFFLOAD:
-               if (l4kcqe->status == L4_KCQE_COMPLETION_STATUS_NIC_ERROR)
+               if (l4kcqe->status == L4_KCQE_COMPLETION_STATUS_PARITY_ERROR)
                        set_bit(SK_F_HW_ERR, &csk->flags);
 
                cp->close_conn(csk, opcode);
index 06ca00266d70fee861473830cfda954995cce27e..382c98b0cc0c6feb959cd0f4e9dca7a078159c84 100644 (file)
 #define L5CM_RAMROD_CMD_ID_SEARCHER_DELETE     (L5CM_RAMROD_CMD_ID_BASE + 14)
 #define L5CM_RAMROD_CMD_ID_TERMINATE_OFFLOAD   (L5CM_RAMROD_CMD_ID_BASE + 15)
 
-#define FCOE_KCQE_OPCODE_INIT_FUNC                     (0x10)
-#define FCOE_KCQE_OPCODE_DESTROY_FUNC                  (0x11)
-#define FCOE_KCQE_OPCODE_STAT_FUNC                     (0x12)
-#define FCOE_KCQE_OPCODE_OFFLOAD_CONN                  (0x15)
-#define FCOE_KCQE_OPCODE_ENABLE_CONN                   (0x16)
-#define FCOE_KCQE_OPCODE_DISABLE_CONN                  (0x17)
-#define FCOE_KCQE_OPCODE_DESTROY_CONN                  (0x18)
-#define FCOE_KCQE_OPCODE_CQ_EVENT_NOTIFICATION  (0x20)
-#define FCOE_KCQE_OPCODE_FCOE_ERROR                            (0x21)
-
 #define FCOE_RAMROD_CMD_ID_INIT_FUNC           (FCOE_KCQE_OPCODE_INIT_FUNC)
 #define FCOE_RAMROD_CMD_ID_DESTROY_FUNC                (FCOE_KCQE_OPCODE_DESTROY_FUNC)
 #define FCOE_RAMROD_CMD_ID_STAT_FUNC           (FCOE_KCQE_OPCODE_STAT_FUNC)
 #define FCOE_RAMROD_CMD_ID_DESTROY_CONN                (FCOE_KCQE_OPCODE_DESTROY_CONN)
 #define FCOE_RAMROD_CMD_ID_TERMINATE_CONN      (0x81)
 
-#define FCOE_KWQE_OPCODE_INIT1                  (0)
-#define FCOE_KWQE_OPCODE_INIT2                  (1)
-#define FCOE_KWQE_OPCODE_INIT3                  (2)
-#define FCOE_KWQE_OPCODE_OFFLOAD_CONN1  (3)
-#define FCOE_KWQE_OPCODE_OFFLOAD_CONN2  (4)
-#define FCOE_KWQE_OPCODE_OFFLOAD_CONN3  (5)
-#define FCOE_KWQE_OPCODE_OFFLOAD_CONN4  (6)
-#define FCOE_KWQE_OPCODE_ENABLE_CONN   (7)
-#define FCOE_KWQE_OPCODE_DISABLE_CONN  (8)
-#define FCOE_KWQE_OPCODE_DESTROY_CONN  (9)
-#define FCOE_KWQE_OPCODE_DESTROY               (10)
-#define FCOE_KWQE_OPCODE_STAT                  (11)
-
-#define FCOE_KCQE_COMPLETION_STATUS_ERROR      (0x1)
-#define FCOE_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE  (0x3)
-#define FCOE_KCQE_COMPLETION_STATUS_NIC_ERROR  (0x5)
-
 /* KCQ (kernel completion queue) response op codes */
 #define L4_KCQE_OPCODE_VALUE_CLOSE_COMP             (53)
 #define L4_KCQE_OPCODE_VALUE_RESET_COMP             (54)
@@ -87,6 +60,7 @@
 /* KCQ (kernel completion queue) completion status */
 #define L4_KCQE_COMPLETION_STATUS_SUCCESS           (0)
 #define L4_KCQE_COMPLETION_STATUS_NIC_ERROR         (4)
+#define L4_KCQE_COMPLETION_STATUS_PARITY_ERROR     (0x81)
 #define L4_KCQE_COMPLETION_STATUS_TIMEOUT           (0x93)
 
 #define L4_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAIL    (0x83)
index 60deb84d36bd651d0f09d08cc5792165dfdd0674..289274e546beea4346181a2252794627eba5fd7e 100644 (file)
@@ -12,8 +12,8 @@
 #ifndef CNIC_IF_H
 #define CNIC_IF_H
 
-#define CNIC_MODULE_VERSION    "2.5.9"
-#define CNIC_MODULE_RELDATE    "Feb 8, 2012"
+#define CNIC_MODULE_VERSION    "2.5.10"
+#define CNIC_MODULE_RELDATE    "March 21, 2012"
 
 #define CNIC_ULP_RDMA          0
 #define CNIC_ULP_ISCSI         1
index c12702bb16d6b22b352a7cf4acc33ce566316923..dad9924abbbb61d32cd0efc80f7fe33f24f1a285 100644 (file)
@@ -47,6 +47,7 @@
 #define FCOE_KCQE_COMPLETION_STATUS_CTX_FREE_FAILURE   (0x4)
 #define FCOE_KCQE_COMPLETION_STATUS_NIC_ERROR                  (0x5)
 #define FCOE_KCQE_COMPLETION_STATUS_WRONG_HSI_VERSION   (0x6)
+#define FCOE_KCQE_COMPLETION_STATUS_PARITY_ERROR       (0x81)
 
 /* CQE type */
 #define FCOE_PENDING_CQE_TYPE                  0
index 57515f1f1690aa7ef6ccd71ba01d3125a7b2ebf0..495a841645f99dd2dc8c281219c96f162ac81ccb 100644 (file)
 #define ISCSI_KCQE_COMPLETION_STATUS_LOM_ISCSI_NOT_ENABLED              (0x51)
 
 #define ISCSI_KCQE_COMPLETION_STATUS_CID_BUSY                          (0x80)
+#define ISCSI_KCQE_COMPLETION_STATUS_PARITY_ERR                         (0x81)
 
 /* SQ/RQ/CQ DB structure sizes */
 #define ISCSI_SQ_DB_SIZE    (16)