[openib-general] [PATCH] [RFC] group devices by type

Sean Hefty sean.hefty at intel.com
Wed Jan 25 12:28:02 PST 2006


I'd like to get some feedback about adding the ability to group devices
by some higher level type.  This would permit identifying all devices
that are of type "Infiniband" from devices of other RDMA transports.

I've included the patch to ib_verbs.h to do this, along with changes to
mad.c to show how it would be used.  If this is okay, then similar changes
would be needed by a dozen or so other files, which I would do before
submitting a final patch.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>

----

Index: include/rdma/ib_verbs.h
===================================================================
--- include/rdma/ib_verbs.h	(revision 5098)
+++ include/rdma/ib_verbs.h	(working copy)
@@ -57,7 +57,8 @@ union ib_gid {
 };
 
 enum ib_node_type {
-	IB_NODE_CA 	= 1,
+	IB_NODE_IB = 0x10,		/* mask for all IB node types */
+	IB_NODE_CA,
 	IB_NODE_SWITCH,
 	IB_NODE_ROUTER
 };
Index: core/mad.c
===================================================================
--- core/mad.c	(revision 5098)
+++ core/mad.c	(working copy)
@@ -2661,7 +2661,9 @@ static void ib_mad_init_device(struct ib
 {
 	int start, end, i;
 
-	if (device->node_type == IB_NODE_SWITCH) {
+	if ((device->node_type & IB_NODE_IB) != IB_NODE_IB)
+		return;
+	else if (device->node_type == IB_NODE_SWITCH) {
 		start = 0;
 		end   = 0;
 	} else {






More information about the general mailing list