[openib-general][PATCH] mthca & ib_verbs.h client reregister event support

Leonid Arsh leonida at voltaire.com
Sun Apr 2 06:05:34 PDT 2006


This is the fixed patch:

Signed-off-by: Leonid Arsh <leonida at voltaire.com>

Index: linux-kernel/infiniband/include/rdma/ib_verbs.h
===================================================================
--- linux-kernel/infiniband/include/rdma/ib_verbs.h	(revision 8165)
+++ linux-kernel/infiniband/include/rdma/ib_verbs.h	(working copy)
@@ -283,7 +283,8 @@
 	IB_EVENT_SM_CHANGE,
 	IB_EVENT_SRQ_ERR,
 	IB_EVENT_SRQ_LIMIT_REACHED,
-	IB_EVENT_QP_LAST_WQE_REACHED
+	IB_EVENT_QP_LAST_WQE_REACHED,
+	IB_EVENT_CLIENT_REREGISTER
 };
 
 struct ib_event {
Index: linux-kernel/infiniband/hw/mthca/mthca_eq.c
===================================================================
--- linux-kernel/infiniband/hw/mthca/mthca_eq.c	(revision 8504)
+++ linux-kernel/infiniband/hw/mthca/mthca_eq.c	(working copy)
@@ -93,6 +93,7 @@
 	MTHCA_EVENT_TYPE_WQ_INVAL_REQ_ERROR = 0x10,
 	MTHCA_EVENT_TYPE_WQ_ACCESS_ERROR    = 0x11,
 	MTHCA_EVENT_TYPE_SRQ_CATAS_ERROR    = 0x12,
+	MTHCA_EVENT_TYPE_CLIENT_REREGISTER  = 0x16,
 	MTHCA_EVENT_TYPE_LOCAL_CATAS_ERROR  = 0x08,
 	MTHCA_EVENT_TYPE_PORT_CHANGE        = 0x09,
 	MTHCA_EVENT_TYPE_EQ_OVERFLOW        = 0x0f,
@@ -111,6 +112,7 @@
 				(1ULL << MTHCA_EVENT_TYPE_WQ_ACCESS_ERROR)    | \
 				(1ULL << MTHCA_EVENT_TYPE_LOCAL_CATAS_ERROR)  | \
 				(1ULL << MTHCA_EVENT_TYPE_PORT_CHANGE)        | \
+				(1ULL << MTHCA_EVENT_TYPE_CLIENT_REREGISTER)  | \
 				(1ULL << MTHCA_EVENT_TYPE_ECC_DETECT))
 #define MTHCA_SRQ_EVENT_MASK   ((1ULL << MTHCA_EVENT_TYPE_SRQ_CATAS_ERROR)    | \
 				(1ULL << MTHCA_EVENT_TYPE_SRQ_QP_LAST_WQE)    | \
@@ -274,6 +276,20 @@
 	ib_dispatch_event(&record);
 }
 
+static void client_reregister_event(struct mthca_dev *dev, int port)
+{
+	struct ib_event record;
+
+	mthca_dbg(dev, "Client reregister for port %d\n",
+		  port);
+
+	record.device = &dev->ib_dev;
+	record.event  = IB_EVENT_CLIENT_REREGISTER;
+	record.element.port_num = port;
+
+	ib_dispatch_event(&record);
+}
+
 static int mthca_eq_int(struct mthca_dev *dev, struct mthca_eq *eq)
 {
 	struct mthca_eqe *eqe;
@@ -365,7 +381,12 @@
 		case MTHCA_EVENT_TYPE_EQ_OVERFLOW:
 			mthca_warn(dev, "EQ overrun on EQN %d\n", eq->eqn);
 			break;
-
+		case MTHCA_EVENT_TYPE_CLIENT_REREGISTER:
+			client_reregister_event(dev,
+						(be32_to_cpu
+						 (eqe->event.port_change.
+						  port) >> 28) & 3);
+			break;
 		case MTHCA_EVENT_TYPE_EEC_CATAS_ERROR:
 		case MTHCA_EVENT_TYPE_SRQ_CATAS_ERROR:
 		case MTHCA_EVENT_TYPE_LOCAL_CATAS_ERROR:



More information about the general mailing list