[MTHCA] update the vendor specific field for of QP async event
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 10 Oct 2006 17:27:42 +0000 (17:27 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 10 Oct 2006 17:27:42 +0000 (17:27 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@518 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/hca_data.c
hw/mthca/kernel/ib_verbs.h
hw/mthca/kernel/mthca_dev.h
hw/mthca/kernel/mthca_eq.c
hw/mthca/kernel/mthca_qp.c

index 19f0892..3b8014b 100644 (file)
@@ -364,6 +364,7 @@ void qp_event_handler(struct ib_event *ev, void *context)
 \r
        // prepare parameters\r
        event_rec.type = ev->event;\r
+       event_rec.vendor_specific = ev->vendor_specific;\r
        qp_p = (struct mthca_qp *)ev->element.qp;\r
        event_rec.context = qp_p->qp_context;\r
 \r
index 4301c9e..2f83bf1 100644 (file)
@@ -253,6 +253,7 @@ struct ib_event {
                u8              port_num;
        } element;
        enum ib_event_type      event;
+       uint64_t                vendor_specific;
 };
 
 struct ib_event_handler {
index 60f3484..941931a 100644 (file)
@@ -49,7 +49,7 @@
 #define DRV_NAME       "mthca"
 #define PFX            DRV_NAME ": "
 #define DRV_VERSION    "1.0.0000.506"
-#define DRV_RELDATE    "09/19/2006"\r
+#define DRV_RELDATE    "09/19/2006"
 
 #define HZ             1000000 /* 1 sec in usecs */
 
@@ -500,7 +500,7 @@ int mthca_arbel_post_srq_recv(struct ib_srq *srq, struct _ib_recv_wr *wr,
                              struct _ib_recv_wr **bad_wr);
 
 void mthca_qp_event(struct mthca_dev *dev, u32 qpn,
-                   enum ib_event_type event_type);
+                   enum ib_event_type event_type, u8 vendor_code);
 int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask);
 int mthca_tavor_post_send(struct ib_qp *ibqp, struct _ib_send_wr *wr,
                          struct _ib_send_wr **bad_wr);
index 45c312e..7c33e3d 100644 (file)
@@ -171,6 +171,11 @@ struct mthca_eqe {
                } cmd;\r
                struct {\r
                        __be32 qpn;\r
+                       u32    reserved1;\r
+                       u32    reserved2;\r
+                       u8     reserved3[1];\r
+                       u8     vendor_code;\r
+                       u8     reserved4[2];\r
                } qp;\r
                struct {                        \r
                        __be32 srqn;            \r
@@ -331,22 +336,22 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq)
 \r
                case MTHCA_EVENT_TYPE_PATH_MIG:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_PATH_MIG);\r
+                                      IB_EVENT_PATH_MIG, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_COMM_EST:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_COMM_EST);\r
+                                      IB_EVENT_COMM_EST, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_SQ_DRAINED:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_SQ_DRAINED);\r
+                                      IB_EVENT_SQ_DRAINED, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_SRQ_QP_LAST_WQE:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_QP_LAST_WQE_REACHED);\r
+                                      IB_EVENT_QP_LAST_WQE_REACHED, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_SRQ_LIMIT:\r
@@ -356,22 +361,22 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq)
 \r
                case MTHCA_EVENT_TYPE_WQ_CATAS_ERROR:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_QP_FATAL);\r
+                                      IB_EVENT_QP_FATAL, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_PATH_MIG_FAILED:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_PATH_MIG_ERR);\r
+                                      IB_EVENT_PATH_MIG_ERR, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_WQ_INVAL_REQ_ERROR:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_QP_REQ_ERR);\r
+                                      IB_EVENT_QP_REQ_ERR, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_WQ_ACCESS_ERROR:\r
                        mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff,\r
-                                      IB_EVENT_QP_ACCESS_ERR);\r
+                                      IB_EVENT_QP_ACCESS_ERR, eqe->event.qp.vendor_code);\r
                        break;\r
 \r
                case MTHCA_EVENT_TYPE_CMD:\r
@@ -1087,3 +1092,5 @@ void mthca_cleanup_eq_table(struct mthca_dev *dev)
 }\r
 \r
 \r
+\r
+\r
index 9725c5b..276c587 100644 (file)
@@ -387,7 +387,7 @@ static void mthca_wq_init(struct mthca_wq *wq)
 }
 
 void mthca_qp_event(struct mthca_dev *dev, u32 qpn,
-                   enum ib_event_type event_type)
+                   enum ib_event_type event_type, u8 vendor_code)
 {
        struct mthca_qp *qp;
        struct ib_event event;
@@ -400,13 +400,16 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn,
        spin_unlock(&lh);
 
        if (!qp) {
-               HCA_PRINT(TRACE_LEVEL_WARNING  ,HCA_DBG_QP  ,("QP %06x Async event for bogus \n", qpn));
+               HCA_PRINT(TRACE_LEVEL_WARNING,HCA_DBG_QP,("QP %06x Async event for bogus \n", qpn));
                return;
        }
 
        event.device      = &dev->ib_dev;
        event.event       = event_type;
        event.element.qp  = &qp->ibqp;
+       event.vendor_specific = vendor_code;
+       HCA_PRINT(TRACE_LEVEL_WARNING,HCA_DBG_QP,("QP %06x Async event  event_type 0x%x vendor_code 0x%x\n",
+               qpn,event_type,vendor_code));
        if (qp->ibqp.event_handler)
                qp->ibqp.event_handler(&event, qp->ibqp.qp_context);
 
@@ -2297,3 +2300,5 @@ void mthca_cleanup_qp_table(struct mthca_dev *dev)
        mthca_alloc_cleanup(&dev->qp_table.alloc);
 }
 
+
+