From f7b58c97a7ad6633f430d8c493322867fd30efa1 Mon Sep 17 00:00:00 2001 From: sleybo Date: Tue, 10 Oct 2006 17:27:42 +0000 Subject: [PATCH] [MTHCA] update the vendor specific field for of QP async event git-svn-id: svn://openib.tc.cornell.edu/gen1@518 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mthca/kernel/hca_data.c | 1 + trunk/hw/mthca/kernel/ib_verbs.h | 1 + trunk/hw/mthca/kernel/mthca_dev.h | 4 ++-- trunk/hw/mthca/kernel/mthca_eq.c | 23 +++++++++++++++-------- trunk/hw/mthca/kernel/mthca_qp.c | 9 +++++++-- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/trunk/hw/mthca/kernel/hca_data.c b/trunk/hw/mthca/kernel/hca_data.c index 19f0892f..3b8014bb 100644 --- a/trunk/hw/mthca/kernel/hca_data.c +++ b/trunk/hw/mthca/kernel/hca_data.c @@ -364,6 +364,7 @@ void qp_event_handler(struct ib_event *ev, void *context) // prepare parameters event_rec.type = ev->event; + event_rec.vendor_specific = ev->vendor_specific; qp_p = (struct mthca_qp *)ev->element.qp; event_rec.context = qp_p->qp_context; diff --git a/trunk/hw/mthca/kernel/ib_verbs.h b/trunk/hw/mthca/kernel/ib_verbs.h index 4301c9e7..2f83bf19 100644 --- a/trunk/hw/mthca/kernel/ib_verbs.h +++ b/trunk/hw/mthca/kernel/ib_verbs.h @@ -253,6 +253,7 @@ struct ib_event { u8 port_num; } element; enum ib_event_type event; + uint64_t vendor_specific; }; struct ib_event_handler { diff --git a/trunk/hw/mthca/kernel/mthca_dev.h b/trunk/hw/mthca/kernel/mthca_dev.h index 60f34842..941931a6 100644 --- a/trunk/hw/mthca/kernel/mthca_dev.h +++ b/trunk/hw/mthca/kernel/mthca_dev.h @@ -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" +#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); diff --git a/trunk/hw/mthca/kernel/mthca_eq.c b/trunk/hw/mthca/kernel/mthca_eq.c index 45c312ea..7c33e3d4 100644 --- a/trunk/hw/mthca/kernel/mthca_eq.c +++ b/trunk/hw/mthca/kernel/mthca_eq.c @@ -171,6 +171,11 @@ struct mthca_eqe { } cmd; struct { __be32 qpn; + u32 reserved1; + u32 reserved2; + u8 reserved3[1]; + u8 vendor_code; + u8 reserved4[2]; } qp; struct { __be32 srqn; @@ -331,22 +336,22 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq) case MTHCA_EVENT_TYPE_PATH_MIG: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_PATH_MIG); + IB_EVENT_PATH_MIG, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_COMM_EST: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_COMM_EST); + IB_EVENT_COMM_EST, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_SQ_DRAINED: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_SQ_DRAINED); + IB_EVENT_SQ_DRAINED, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_SRQ_QP_LAST_WQE: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_QP_LAST_WQE_REACHED); + IB_EVENT_QP_LAST_WQE_REACHED, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_SRQ_LIMIT: @@ -356,22 +361,22 @@ static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq) case MTHCA_EVENT_TYPE_WQ_CATAS_ERROR: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_QP_FATAL); + IB_EVENT_QP_FATAL, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_PATH_MIG_FAILED: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_PATH_MIG_ERR); + IB_EVENT_PATH_MIG_ERR, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_WQ_INVAL_REQ_ERROR: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_QP_REQ_ERR); + IB_EVENT_QP_REQ_ERR, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_WQ_ACCESS_ERROR: mthca_qp_event(dev, cl_ntoh32(eqe->event.qp.qpn) & 0xffffff, - IB_EVENT_QP_ACCESS_ERR); + IB_EVENT_QP_ACCESS_ERR, eqe->event.qp.vendor_code); break; case MTHCA_EVENT_TYPE_CMD: @@ -1087,3 +1092,5 @@ void mthca_cleanup_eq_table(struct mthca_dev *dev) } + + diff --git a/trunk/hw/mthca/kernel/mthca_qp.c b/trunk/hw/mthca/kernel/mthca_qp.c index 9725c5b4..276c5872 100644 --- a/trunk/hw/mthca/kernel/mthca_qp.c +++ b/trunk/hw/mthca/kernel/mthca_qp.c @@ -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); } + + -- 2.41.0