[openib-general] [PATCH] Add vendor OUI support to MAD layer

Roland Dreier roland at topspin.com
Fri Dec 3 07:00:45 PST 2004


This exposes the OUI support to userspace... I bumped the ABI version
because the size of the reg request changed.

Index: infiniband/include/ib_user_mad.h
===================================================================
--- infiniband/include/ib_user_mad.h	(revision 1310)
+++ infiniband/include/ib_user_mad.h	(working copy)
@@ -31,7 +31,7 @@
  * Increment this value if any changes that break userspace ABI
  * compatibility are made.
  */
-#define IB_USER_MAD_ABI_VERSION	1
+#define IB_USER_MAD_ABI_VERSION	2
 
 /*
  * Make sure that all structs defined in this file remain laid out so
@@ -90,6 +90,8 @@
  *   receive unsolicited MADs, otherwise it should be 0.
  * @mgmt_class_version - Indicates which version of MADs for the given
  *   management class to receive.
+ * @oui: Indicates IEEE OUI when mgmt_class is a vendor class
+ *   in the range from 0x30 to 0x4f. Otherwise not used.
  */
 struct ib_user_mad_reg_req {
 	__u32	id;
@@ -97,6 +99,7 @@
 	__u8	qpn;
 	__u8	mgmt_class;
 	__u8	mgmt_class_version;
+	__u8    oui[3];
 };
 
 #define IB_IOCTL_MAGIC		0x1b
Index: infiniband/core/user_mad.c
===================================================================
--- infiniband/core/user_mad.c	(revision 1310)
+++ infiniband/core/user_mad.c	(working copy)
@@ -352,6 +352,7 @@
 	req.mgmt_class         = ureq.mgmt_class;
 	req.mgmt_class_version = ureq.mgmt_class_version;
 	memcpy(req.method_mask, ureq.method_mask, sizeof req.method_mask);
+	memcpy(req.oui,         ureq.oui,         sizeof req.oui);
 
 	agent = ib_register_mad_agent(file->port->ib_dev, file->port->port_num,
 				      ureq.qpn ? IB_QPT_GSI : IB_QPT_SMI,





More information about the general mailing list