All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/12] ib-mgmt: port madeye to user space
@ 2010-10-23  6:48 Hefty, Sean
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  6:48 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky, Hefty, Sean
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

In short, this series ports the kernel madeye debug utility to
user space.  It builds on the updated kernel MAD snooping functionality
patches recently submitted to this list.  In length, the series
adds the following to the ib-mgmt tree:

* Adds the ability to snoop MADs to libibumad.
* Adds new header files to libibumad that define various MAD
  data structures and definitions.  The headers define a minimal
  number of definitions, basically only what was needed for madeye.
* Starts the process of updating libibmad and opensm to use the
  new definitions.  mad.h and ib_types.h are updated to reference
  values in the new header file, but the names of existing defines
  did not change.
* Adds madeye as a new ib-diag.

The kernel and user space patches are both barely tested.  They compile
and run, but I didn't check the results in any detail.  The new header files
define the MAD headers, but do not define any of the data fields, such as
SA attributes.  Those are left for further discussion.

Porting madeye to user space is simply a quick and useful way to verify
that the snooping capability is working.  My ultimate goal is to allow
the IBACM to detect and react to CM timeouts.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [RFC 1/12] IB/mgmt: Add API to register for MAD snooping
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-10-23  6:51   ` Hefty, Sean
  2010-10-23  7:00   ` [RFC 2/12] ib-mgmt: provide MAD definitions with libibumad Hefty, Sean
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  6:51 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Add a new call to libibumad that allows a user to register
for snooping MADs.  Snooped MADs are returned to the user
through the umad_recv routine.

A user can specify a filter for snooped MADs through the
new API.  To support possible future extensions to the filter,
the size of the structure is also provided.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibumad/Makefile.am               |    1 +
 libibumad/include/infiniband/umad.h |   10 ++++++
 libibumad/man/umad_register_snoop.3 |   52 ++++++++++++++++++++++++++++++++++
 libibumad/src/libibumad.map         |    1 +
 libibumad/src/umad.c                |   54 ++++++++++++++++++++++++++++++++++-
 5 files changed, 117 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 libibumad/include/infiniband/umad.h
 create mode 100755 libibumad/man/umad_register_snoop.3
 mode change 100644 => 100755 libibumad/src/umad.c

diff --git a/libibumad/Makefile.am b/libibumad/Makefile.am
index 6e3f518..9c84f0c 100644
--- a/libibumad/Makefile.am
+++ b/libibumad/Makefile.am
@@ -14,6 +14,7 @@ man_MANS = man/umad_debug.3 man/umad_get_ca.3 \
 	   man/umad_set_addr_net.3 man/umad_set_addr.3 man/umad_set_pkey.3 \
 	   man/umad_get_pkey.3 \
 	   man/umad_register.3 man/umad_register_oui.3 man/umad_unregister.3 \
+	   man/umad_register_snoop.3 \
 	   man/umad_send.3 man/umad_recv.3 man/umad_poll.3 \
 	   man/umad_get_issm_path.3
 
diff --git a/libibumad/include/infiniband/umad.h b/libibumad/include/infiniband/umad.h
old mode 100644
new mode 100755
index 7ad5e4a..153c5f1
--- a/libibumad/include/infiniband/umad.h
+++ b/libibumad/include/infiniband/umad.h
@@ -148,6 +148,14 @@ typedef struct umad_ca {
 	umad_port_t *ports[UMAD_CA_MAX_PORTS];
 } umad_ca_t;
 
+typedef struct umad_filter {
+	uint8_t  mgmt_class;
+	uint8_t  mgmt_version;
+	uint16_t attr_id;
+	uint8_t  errors;
+	uint8_t  oui[3];
+} umad_filter_t;
+
 int umad_init(void);
 int umad_done(void);
 
@@ -186,6 +194,8 @@ int umad_register(int portid, int mgmt_class, int mgmt_version,
 		  uint8_t rmpp_version, long method_mask[16 / sizeof(long)]);
 int umad_register_oui(int portid, int mgmt_class, uint8_t rmpp_version,
 		      uint8_t oui[3], long method_mask[16 / sizeof(long)]);
+int umad_register_snoop(int portid, umad_filter_t *filter,
+			size_t filter_length);
 int umad_unregister(int portid, int agentid);
 
 int umad_debug(int level);
diff --git a/libibumad/man/umad_register_snoop.3 b/libibumad/man/umad_register_snoop.3
new file mode 100755
index 0000000..00b361d
--- /dev/null
+++ b/libibumad/man/umad_register_snoop.3
@@ -0,0 +1,52 @@
+.\" -*- nroff -*-
+.\"
+.TH UMAD_REGISTER_SNOOP 3  "October 15, 2010" "OpenIB" "OpenIB Programmer\'s Manual"
+.SH "NAME"
+umad_register_snoop \- register to capture sent and received MADs
+.SH "SYNOPSIS"
+.nf
+.B #include <infiniband/umad.h>
+.sp
+.BI "int umad_register_snoop(int " "portid" ", umad_filter_t " "filter" ", size_t " "filter_length");
+.fi
+.SH "DESCRIPTION"
+.B umad_register_snoop()
+Registers to snoop MADs that meet the specified filter.
+MAD snooping occurs after RMPP segmentation has occurred on sent MADs,
+and before RMPP reassembly occurs on received MADs.  Snooped MADs
+are returned to the user through the umad_recv interface.
+.SH "FILTER"
+Users specify a filter through the umad_filter_t routine.
+Only MADs which pass all indicated filtering restrictions are reported
+to the user.  The definition for the umad_filter_t fields are:
+.IP mgmt_class
+Only MADs for the specified management class are reported to the user.
+If mgmt_class is set to 0, then MADs for all management classes
+sent or received on the GSI interface (QP1) are reported.
+.IP mgmt_version
+Restricts reported MADs to the specified management class version.
+A user may set mgmt_version to 0 to report MADs of all versions.
+This field is ignored if mgmt_class is set to 0. 
+.IP attr_id
+Restricts MADs to those containing the specified attribute identifier.
+A user may set attr_id to 0 to report MADs referencing any attribute ID.
+This field is ignored if mgmt_class is set to 0. 
+.IP errors
+If non-zero, only reports sent MADs that complete in error or MADs
+containing a non-zero status value.  Sent MADs which complete as successful
+or canceled are not reported.
+.IP oui
+If non-zero, only reports MADs that contain the specified OUI.
+This field is ignored if the mgmt_class is not in the vendor
+class 2 range.
+.SH "RETURN VALUE"
+.B umad_register_snoop()
+returns non-negative agent id number on success, and a negative value on error as follows:
+ -EINVAL invalid port handle, filter, or filter_length
+ -EPERM  registration failed
+.SH "SEE ALSO"
+.BR umad_register(3),
+.BR umad_unregister(3)
+.SH "AUTHOR"
+.TP
+Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
diff --git a/libibumad/src/libibumad.map b/libibumad/src/libibumad.map
index 0154b7f..b4b0b4b 100644
--- a/libibumad/src/libibumad.map
+++ b/libibumad/src/libibumad.map
@@ -30,5 +30,6 @@ IBUMAD_1.0 {
 		umad_debug;
 		umad_addr_dump;
 		umad_dump;
+		umad_register_snoop;
 	local: *;
 };
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
old mode 100644
new mode 100755
index d16e750..6eb476d
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -67,9 +67,24 @@
 #  define VALGRIND_MAKE_MEM_DEFINED(addr,len)
 #endif
 
+struct ib_user_mad_snoop_filter {
+	uint16_t attr_id;
+	uint8_t	 errors;
+	uint8_t	 reserved[13];
+};
+
+enum {
+	UMAD_SNOOP_QP  = 0x80,
+	UMAD_SNOOP_QP0 = 0x80,
+	UMAD_SNOOP_QP1 = 0x81
+};
+
 typedef struct ib_user_mad_reg_req {
 	uint32_t id;
-	uint32_t method_mask[4];
+	union {
+		uint32_t method_mask[4];
+		struct ib_user_mad_snoop_filter filter;
+	};
 	uint8_t qpn;
 	uint8_t mgmt_class;
 	uint8_t mgmt_class_version;
@@ -879,6 +894,43 @@ int umad_get_fd(int fd)
 	return fd;
 }
 
+int umad_register_snoop(int fd, umad_filter_t *filter,
+			size_t filter_length)
+{
+	struct ib_user_mad_reg_req req;
+
+	if (filter_length != sizeof(struct umad_filter))
+		return -EINVAL;
+
+	TRACE("fd %d mgmt_class %u mgmt_version %d oui 0x%x%x%x attr_id %d errors %d",
+	      fd, filter->mgmt_class, filter->mgmt_version,
+	      (int) filter->oui[0], (int) filter->oui[1], (int) filter->oui[2],
+	      filter->attr_id, filter->errors);
+
+	memset(&req, 0, sizeof req);
+	req.qpn = (filter->mgmt_class == 0x1 || filter->mgmt_class == 0x81) ?
+		  UMAD_SNOOP_QP0 : UMAD_SNOOP_QP1;
+	req.mgmt_class = filter->mgmt_class;
+	req.mgmt_class_version = filter->mgmt_version;
+	memcpy(req.oui, filter->oui, sizeof req.oui);
+	req.filter.attr_id = filter->attr_id;
+	req.filter.errors = filter->errors;
+
+	VALGRIND_MAKE_MEM_DEFINED(&req, sizeof req);
+
+	if (!ioctl(fd, IB_USER_MAD_REGISTER_AGENT, (void *)&req)) {
+		DEBUG("fd %d registered to use agent %d qp %d class 0x%x oui 0x%x%x%x",
+		      fd, req.id, req.qpn & ~UMAD_SNOOP_QP, req.mgmt_class,
+		      (int) filter->oui[0], (int) filter->oui[1], (int) filter->oui[2]);
+		return req.id;	/* return agentid */
+	}
+
+	DEBUG("fd %d registering qp %d class 0x%x oui 0x%x%x%x failed: %m",
+	      fd, req.qpn & ~UMAD_SNOOP_QP, req.mgmt_class,
+	      (int) filter->oui[0], (int) filter->oui[1], (int) filter->oui[2]);
+	return -EPERM;
+}
+
 int umad_register_oui(int fd, int mgmt_class, uint8_t rmpp_version,
 		      uint8_t oui[3], long method_mask[])
 {


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 2/12] ib-mgmt: provide MAD definitions with libibumad
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2010-10-23  6:51   ` [RFC 1/12] IB/mgmt: Add API to register for MAD snooping Hefty, Sean
@ 2010-10-23  7:00   ` Hefty, Sean
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2010-10-23  7:02   ` [RFC 3/12] ib-mgmt: add SA MAD definitions to umad Hefty, Sean
                     ` (9 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:00 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

The only definitions for MAD data types are in ib_types.h, which
is an opensm file.  The libibumad interface is essentially useless
without these data types.  Add new header files to libibumad
with basic MAD data types.

The definitions and structures are based on those defined in
the linux kernel.  Only an initial framework is given, basically
the values for various methods, attributes, etc. along with
structure definitions for the common, rmpp, and vendor specific
headers.  Other data structures are left for future development.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
Rather than try to move definitions around in the management.git tree, it
seemed easier to give umad its own definitions, then update the callers.
This gives us more freedom when defining additional structures.

libibumad/include/infiniband/umad_types.h |  191 +++++++++++++++++++++++++++++
 1 files changed, 191 insertions(+), 0 deletions(-)
create mode 100755 libibumad/include/infiniband/umad_types.h

diff --git a/libibumad/include/infiniband/umad_types.h b/libibumad/include/infiniband/umad_types.h
new file mode 100755
index 0000000..6305215
--- /dev/null
+++ b/libibumad/include/infiniband/umad_types.h
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2004 Mellanox Technologies Ltd.  All rights reserved.
+ * Copyright (c) 2004 Infinicon Corporation.  All rights reserved.
+ * Copyright (c) 2004, 2010 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
+ * Copyright (c) 2004-2006 Voltaire Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+#ifndef _UMAD_TYPES_H
+#define _UMAD_TYPES_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+#  define BEGIN_C_DECLS extern "C" {
+#  define END_C_DECLS   }
+#else				/* !__cplusplus */
+#  define BEGIN_C_DECLS
+#  define END_C_DECLS
+#endif				/* __cplusplus */
+
+BEGIN_C_DECLS
+
+/* Management base version */
+#define UMAD_BASE_VERSION		1
+
+/* Management classes */
+enum {
+	UMAD_CLASS_SUBN_LID_ROUTED	= 0x01,
+	UMAD_CLASS_SUBN_DIRECTED_ROUTE	= 0x81,
+	UMAD_CLASS_SUBN_ADM		= 0x03,
+	UMAD_CLASS_PERF_MGMT		= 0x04,
+	UMAD_CLASS_BM			= 0x05,
+	UMAD_CLASS_DEVICE_MGMT		= 0x06,
+	UMAD_CLASS_CM			= 0x07,
+	UMAD_CLASS_SNMP			= 0x08,
+	UMAD_CLASS_VENDOR_RANGE1_START	= 0x09,
+	UMAD_CLASS_VENDOR_RANGE1_END	= 0x0F,
+	UMAD_CLASS_DEVICE_ADM		= 0x10,
+	UMAD_CLASS_BOOT_MGMT		= 0x11,
+	UMAD_CLASS_BIS			= 0x12,
+	UMAD_CLASS_CONG_MGMT		= 0x21,
+	UMAD_CLASS_VENDOR_RANGE2_START	= 0x30,
+	UMAD_CLASS_VENDOR_RANGE2_END	= 0x4F
+};
+
+/* Management methods */
+enum {
+	UMAD_METHOD_GET			= 0x01,
+	UMAD_METHOD_SET			= 0x02,
+	UMAD_METHOD_GET_RESP		= 0x81,
+	UMAD_METHOD_SEND		= 0x03,
+	UMAD_METHOD_TRAP		= 0x05,
+	UMAD_METHOD_REPORT		= 0x06,
+	UMAD_METHOD_REPORT_RESP		= 0x86,
+	UMAD_METHOD_TRAP_REPRESS	= 0x07,
+	UMAD_METHOD_RESP		= 0x80
+};
+
+enum {
+	UMAD_STATUS_SUCCESS  = 0x0000,
+	UMAD_STATUS_BUSY     = 0x0001,
+	UMAD_STATUS_REDIRECT = 0x0002,
+
+	/* Invalid fields, bits 2-4 */
+	UMAD_STATUS_BAD_VERSION          = (1 << 2),
+	UMAD_STATUS_METHOD_NOT_SUPPORTED = (2 << 2),
+	UMAD_STATUS_ATTR_NOT_SUPPORTED   = (3 << 2),
+	UMAD_STATUS_INVALID_ATTR_VALUE   = (7 << 2),
+
+	UMAD_STATUS_CLASS_MASK = 0xFF00
+};
+
+/* Attributes common to multiple classes */
+enum {
+	UMAD_ATTR_CLASS_PORT_INFO	= 0x0001,
+	UMAD_ATTR_NOTICE		= 0x0002,
+	UMAD_ATTR_INFORM_INFO		= 0x0003
+};
+
+/* RMPP information */
+#define UMAD_RMPP_VERSION		1
+enum {
+	UMAD_RMPP_TYPE_DATA		= 1,
+	UMAD_RMPP_TYPE_ACK		= 2,
+	UMAD_RMPP_TYPE_STOP		= 3,
+	UMAD_RMPP_TYPE_ABORT		= 4,
+
+	UMAD_RMPP_FLAG_MASK		= 0x07,
+	UMAD_RMPP_FLAG_ACTIVE		= 1,
+	UMAD_RMPP_FLAG_FIRST		= (1 << 1),
+	UMAD_RMPP_FLAG_LAST		= (1 << 2),
+
+	UMAD_RMPP_RESP_TIME_SHIFT	= 3,
+	UMAD_RMPP_NO_RESP_TIME		= 0x1F,
+
+	UMAD_RMPP_STATUS_SUCCESS	= 0,
+	UMAD_RMPP_STATUS_RESX		= 1,
+	UMAD_RMPP_STATUS_ABORT_MIN	= 118,
+	UMAD_RMPP_STATUS_T2L		= 118,
+	UMAD_RMPP_STATUS_BAD_LEN	= 119,
+	UMAD_RMPP_STATUS_BAD_SEG	= 120,
+	UMAD_RMPP_STATUS_BADT		= 121,
+	UMAD_RMPP_STATUS_W2S		= 122,
+	UMAD_RMPP_STATUS_S2B		= 123,
+	UMAD_RMPP_STATUS_BAD_STATUS	= 124,
+	UMAD_RMPP_STATUS_UNV		= 125,
+	UMAD_RMPP_STATUS_TMR		= 126,
+	UMAD_RMPP_STATUS_UNSPEC		= 127,
+	UMAD_RMPP_STATUS_ABORT_MAX	= 127
+};
+
+enum {
+	UMAD_LEN_DATA			= 232,
+	UMAD_LEN_RMPP_DATA		= 220,
+	UMAD_LEN_VENDOR_DATA		= 216,
+};
+
+struct umad_hdr {
+	uint8_t	 base_version;
+	uint8_t	 mgmt_class;
+	uint8_t	 class_version;
+	uint8_t	 method;
+	uint16_t status;
+	uint16_t class_specific;
+	uint64_t tid;
+	uint16_t attr_id;
+	uint16_t resv;
+	uint32_t attr_mod;
+};
+
+struct umad_rmpp_hdr {
+	uint8_t	 rmpp_version;
+	uint8_t	 rmpp_type;
+	uint8_t	 rmpp_rtime_flags;
+	uint8_t	 rmpp_status;
+	uint32_t seg_num;
+	uint32_t paylen_newwin;
+};
+
+struct umad_packet {
+	struct umad_hdr		mad_hdr;
+	uint8_t			data[UMAD_LEN_DATA];
+};
+
+struct umad_rmpp_packet {
+	struct umad_hdr		mad_hdr;
+	struct umad_rmpp_hdr	rmpp_hdr;
+	uint8_t			data[UMAD_LEN_RMPP_DATA];
+};
+
+struct umad_vendor_packet {
+	struct umad_hdr		mad_hdr;
+	struct umad_rmpp_hdr	rmpp_hdr;
+	uint8_t			reserved;
+	uint8_t			oui[3];
+	uint8_t			data[UMAD_LEN_VENDOR_DATA];
+};
+
+#define	UMAD_OPENIB_OUI		(0x001405)
+
+END_C_DECLS
+#endif				/* _UMAD_TYPES_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 3/12] ib-mgmt: add SA MAD definitions to umad
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2010-10-23  6:51   ` [RFC 1/12] IB/mgmt: Add API to register for MAD snooping Hefty, Sean
  2010-10-23  7:00   ` [RFC 2/12] ib-mgmt: provide MAD definitions with libibumad Hefty, Sean
@ 2010-10-23  7:02   ` Hefty, Sean
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F2-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2010-10-23  7:03   ` [RFC 4/12] ib-mgmt: Add basic SM " Hefty, Sean
                     ` (8 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:02 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Add a new header file, umad_sa.h, to libibumad that contains
basic SA MAD definitions.

Only the SA attributes values, new methods, and base SA MAD
format are given.  SA attribute structure definitions are
left for future development.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibumad/include/infiniband/umad_sa.h |  101 ++++++++++++++++++++++++++++++++
 1 files changed, 101 insertions(+), 0 deletions(-)
 create mode 100755 libibumad/include/infiniband/umad_sa.h

diff --git a/libibumad/include/infiniband/umad_sa.h b/libibumad/include/infiniband/umad_sa.h
new file mode 100755
index 0000000..f3e161e
--- /dev/null
+++ b/libibumad/include/infiniband/umad_sa.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2004 Topspin Communications.  All rights reserved.
+ * Copyright (c) 2005 Voltaire, Inc.  All rights reserved.
+ * Copyright (c) 2006, 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ */
+#ifndef _UMAD_SA_H
+#define _UMAD_SA_H
+
+#include <infiniband/umad_types.h>
+
+#ifdef __cplusplus
+#  define BEGIN_C_DECLS extern "C" {
+#  define END_C_DECLS   }
+#else				/* !__cplusplus */
+#  define BEGIN_C_DECLS
+#  define END_C_DECLS
+#endif				/* __cplusplus */
+
+BEGIN_C_DECLS
+
+/* SA specific methods */
+enum {
+	UMAD_SA_CLASS_VERSION		= 2,	/* IB spec version 1.1/1.2 */
+
+	UMAD_SA_METHOD_GET_TABLE	= 0x12,
+	UMAD_SA_METHOD_GET_TABLE_RESP	= 0x92,
+	UMAD_SA_METHOD_DELETE		= 0x15,
+	UMAD_SA_METHOD_DELETE_RESP	= 0x95,
+	UMAD_SA_METHOD_GET_MULTI	= 0x14,
+	UMAD_SA_METHOD_GET_MULTI_RESP	= 0x94,
+	UMAD_SA_METHOD_GET_TRACE_TABLE	= 0x13
+};
+
+/* SA attributes */
+enum {
+	UMAD_SA_ATTR_NODE_REC		= 0x0011,
+	UMAD_SA_ATTR_PORT_INFO_REC	= 0x0012,
+	UMAD_SA_ATTR_SLVL_REC		= 0x0013,
+	UMAD_SA_ATTR_SWITCH_INFO_REC	= 0x0014,
+	UMAD_SA_ATTR_LINEAR_FT_REC	= 0x0015,
+	UMAD_SA_ATTR_RANDOM_FT_REC	= 0x0016,
+	UMAD_SA_ATTR_MCAST_FT_REC	= 0x0017,
+	UMAD_SA_ATTR_SM_INFO_REC	= 0x0018,
+	UMAD_SA_ATTR_INFORM_INFO_REC	= 0x00F3,
+	UMAD_SA_ATTR_LINK_REC		= 0x0020,
+	UMAD_SA_ATTR_GUID_INFO_REC	= 0x0030,
+	UMAD_SA_ATTR_SERVICE_REC	= 0x0031,
+	UMAD_SA_ATTR_PKEY_TABLE_REC	= 0x0033,
+	UMAD_SA_ATTR_PATH_REC		= 0x0035,
+	UMAD_SA_ATTR_VL_ARB_REC		= 0x0036,
+	UMAD_SA_ATTR_MCMEMBER_REC	= 0x0038,
+	UMAD_SA_ATTR_TRACE_REC		= 0x0039,
+	UMAD_SA_ATTR_MULTI_PATH_REC	= 0x003A,
+	UMAD_SA_ATTR_SERVICE_ASSOC_REC	= 0x003B
+};
+
+enum {
+	UMAD_LEN_SA_DATA		= 200
+};
+
+struct umad_sa_packet {
+	struct umad_hdr		mad_hdr;
+	struct umad_rmpp_hdr	rmpp_hdr;
+	uint8_t			sm_key[8];
+	uint16_t		attr_offset;
+	uint16_t		reserved;
+	uint64_t		comp_mask;
+	uint8_t 		data[UMAD_LEN_SA_DATA];
+};
+
+END_C_DECLS
+#endif				/* _UMAD_SA_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 4/12] ib-mgmt: Add basic SM definitions to umad
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (2 preceding siblings ...)
  2010-10-23  7:02   ` [RFC 3/12] ib-mgmt: add SA MAD definitions to umad Hefty, Sean
@ 2010-10-23  7:03   ` Hefty, Sean
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F3-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2010-10-23  7:04   ` [RFC 5/12]ib-mgmt: add CM " Hefty, Sean
                     ` (7 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:03 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Add a new header file, umad_sm.h, to libibumad that contains
basic SM MAD definitions.

Only the SM attributes values, new methods, and base SM MAD
format are given.  SM attribute structure definitions are
left for future development.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibumad/include/infiniband/umad_sm.h |  102 ++++++++++++++++++++++++++++++++
 1 files changed, 102 insertions(+), 0 deletions(-)
 create mode 100755 libibumad/include/infiniband/umad_sm.h

diff --git a/libibumad/include/infiniband/umad_sm.h b/libibumad/include/infiniband/umad_sm.h
new file mode 100755
index 0000000..62c75da
--- /dev/null
+++ b/libibumad/include/infiniband/umad_sm.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2004 Mellanox Technologies Ltd.  All rights reserved.
+ * Copyright (c) 2004 Infinicon Corporation.  All rights reserved.
+ * Copyright (c) 2004 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
+ * Copyright (c) 2004 Voltaire Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef _UMAD_SM_H
+#define _UMAD_SM_H
+
+#include <infiniband/umad_types.h>
+
+#ifdef __cplusplus
+#  define BEGIN_C_DECLS extern "C" {
+#  define END_C_DECLS   }
+#else				/* !__cplusplus */
+#  define BEGIN_C_DECLS
+#  define END_C_DECLS
+#endif				/* __cplusplus */
+
+BEGIN_C_DECLS
+
+enum {
+	UMAD_SMP_DIRECTION		= 0x8000,
+};
+
+/* Subnet management attributes */
+enum {
+	UMAD_SMP_ATTR_NODE_DESC		= 0x0010,
+	UMAD_SMP_ATTR_NODE_INFO		= 0x0011,
+	UMAD_SMP_ATTR_SWITCH_INFO	= 0x0012,
+	UMAD_SMP_ATTR_GUID_INFO		= 0x0014,
+	UMAD_SMP_ATTR_PORT_INFO		= 0x0015,
+	UMAD_SMP_ATTR_PKEY_TABLE	= 0x0016,
+	UMAD_SMP_ATTR_SLVL_TABLE	= 0x0017,
+	UMAD_SMP_ATTR_VL_ARB_TABLE	= 0x0018,
+	UMAD_SMP_ATTR_LINEAR_FT		= 0x0019,
+	UMAD_SMP_ATTR_RANDOM_FT		= 0x001A,
+	UMAD_SMP_ATTR_MCAST_FT		= 0x001B,
+	UMAD_SMP_ATTR_SM_INFO		= 0x0020,
+	UMAD_SMP_ATTR_VENDOR_DIAG	= 0x0030,
+	UMAD_SMP_ATTR_LED_INFO		= 0x0031,
+	UMAD_SMP_ATTR_VENDOR_MASK	= 0xFF00
+};
+
+enum {
+	UMAD_LEN_SMP_DATA		= 64,
+	UMAD_SMP_MAX_HOPS		= 64
+};
+
+struct umad_smp {
+	uint8_t	 base_version;
+	uint8_t	 mgmt_class;
+	uint8_t	 class_version;
+	uint8_t	 method;
+	uint16_t status;
+	uint8_t  hop_ptr;
+	uint8_t  hop_cnt;
+	uint64_t tid;
+	uint16_t attr_id;
+	uint16_t resv;
+	uint32_t attr_mod;
+	uint64_t mkey;
+	uint16_t dr_slid;
+	uint16_t dr_dlid;
+	uint8_t  reserved[28];
+	uint8_t  data[UMAD_LEN_SMP_DATA];
+	uint8_t  initial_path[UMAD_SMP_MAX_HOPS];
+	uint8_t  return_path[UMAD_SMP_MAX_HOPS];
+};
+
+END_C_DECLS
+#endif				/* _UMAD_SM_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 5/12]ib-mgmt: add CM definitions to umad
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (3 preceding siblings ...)
  2010-10-23  7:03   ` [RFC 4/12] ib-mgmt: Add basic SM " Hefty, Sean
@ 2010-10-23  7:04   ` Hefty, Sean
  2010-10-23  7:06   ` [RFC 6/12] ib-mgmt: add new umad header files to release Hefty, Sean
                     ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:04 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

To support the madeye diag and ibacm, add CM MAD definitions
to umad.  Only minimal definitions are added for now.  Additional
structure definitions will be added later.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibumad/include/infiniband/umad_cm.h |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100755 libibumad/include/infiniband/umad_cm.h

diff --git a/libibumad/include/infiniband/umad_cm.h b/libibumad/include/infiniband/umad_cm.h
new file mode 100755
index 0000000..d48ecee
--- /dev/null
+++ b/libibumad/include/infiniband/umad_cm.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2010 Intel Corporation.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef _UMAD_CM_H
+#define _UMAD_CM_H
+
+#include <infiniband/umad_types.h>
+
+#ifdef __cplusplus
+#  define BEGIN_C_DECLS extern "C" {
+#  define END_C_DECLS   }
+#else				/* !__cplusplus */
+#  define BEGIN_C_DECLS
+#  define END_C_DECLS
+#endif				/* __cplusplus */
+
+BEGIN_C_DECLS
+
+/* Communication management attributes */
+enum {
+	UMAD_CM_ATTR_REQ		= 0x0010,
+	UMAD_CM_ATTR_MRA		= 0x0011,
+	UMAD_CM_ATTR_REJ		= 0x0012,
+	UMAD_CM_ATTR_REP		= 0x0013,
+	UMAD_CM_ATTR_RTU		= 0x0014,
+	UMAD_CM_ATTR_DREQ		= 0x0015,
+	UMAD_CM_ATTR_DREP		= 0x0016,
+	UMAD_CM_ATTR_SIDR_REQ		= 0x0017,
+	UMAD_CM_ATTR_SIDR_REP		= 0x0018,
+	UMAD_CM_ATTR_LAP		= 0x0019,
+	UMAD_CM_ATTR_APR		= 0x001A,
+};
+
+END_C_DECLS
+#endif				/* _UMAD_CM_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 6/12] ib-mgmt: add new umad header files to release
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (4 preceding siblings ...)
  2010-10-23  7:04   ` [RFC 5/12]ib-mgmt: add CM " Hefty, Sean
@ 2010-10-23  7:06   ` Hefty, Sean
  2010-10-23  7:07   ` [RFC 7/12] ib-mgmt: update mad.h to use umad_types.h Hefty, Sean
                     ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:06 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

What good are the new header files if we don't install them?
Not much, so let's install 'em.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibumad/Makefile.am |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libibumad/Makefile.am b/libibumad/Makefile.am
index 9c84f0c..78b8bdc 100644
--- a/libibumad/Makefile.am
+++ b/libibumad/Makefile.am
@@ -35,7 +35,11 @@ libibumad_la_DEPENDENCIES = $(srcdir)/src/libibumad.map
 
 libibumadincludedir = $(includedir)/infiniband
 
-libibumadinclude_HEADERS = $(srcdir)/include/infiniband/umad.h
+libibumadinclude_HEADERS = $(srcdir)/include/infiniband/umad.h \
+	$(srcdir)/include/infiniband/umad_types.h \
+	$(srcdir)/include/infiniband/umad_sa.h \
+	$(srcdir)/include/infiniband/umad_sm.h \
+	$(srcdir)/include/infiniband/umad_cm.h
 
 EXTRA_DIST = $(srcdir)/include/infiniband/umad.h \
 	libibumad.spec.in libibumad.spec \


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 7/12] ib-mgmt: update mad.h to use umad_types.h
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (5 preceding siblings ...)
  2010-10-23  7:06   ` [RFC 6/12] ib-mgmt: add new umad header files to release Hefty, Sean
@ 2010-10-23  7:07   ` Hefty, Sean
  2010-10-23  7:09   ` [RFC 8/12] ib-mgmt: fix trace table response Hefty, Sean
                     ` (4 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:07 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Update mad.h to include umad_types.h and use the umad
definitions.  The data type names in mad.h are kept for
backwards compatibility, until all applications update
to using the umad names.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibmad/include/infiniband/mad.h |  173 +++++++++++++++++++------------------
 1 files changed, 89 insertions(+), 84 deletions(-)

diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index 7571a61..4a29c98 100755
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -36,6 +36,9 @@
 #define _MAD_H_
 
 #include <infiniband/mad_osd.h>
+#include <infiniband/umad_sa.h>
+#include <infiniband/umad_sm.h>
+#include <infiniband/umad_types.h>
 
 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
@@ -56,7 +59,7 @@ BEGIN_C_DECLS
 #define IB_VENDOR_RANGE1_DATA_SIZE	(IB_MAD_SIZE - IB_VENDOR_RANGE1_DATA_OFFS)
 #define IB_VENDOR_RANGE2_DATA_OFFS	40
 #define IB_VENDOR_RANGE2_DATA_SIZE	(IB_MAD_SIZE - IB_VENDOR_RANGE2_DATA_OFFS)
-#define IB_SA_DATA_SIZE		200
+#define IB_SA_DATA_SIZE		UMAD_LEN_SA_DATA
 #define IB_SA_DATA_OFFS		56
 #define IB_PC_DATA_OFFS		64
 #define IB_PC_DATA_SZ		(IB_MAD_SIZE - IB_PC_DATA_OFFS)
@@ -68,98 +71,98 @@ BEGIN_C_DECLS
 #define IB_BM_BKEY_AND_DATA_SZ	(IB_MAD_SIZE - IB_BM_BKEY_OFFS)
 
 enum MAD_CLASSES {
-	IB_SMI_CLASS = 0x1,
-	IB_SMI_DIRECT_CLASS = 0x81,
-	IB_SA_CLASS = 0x3,
-	IB_PERFORMANCE_CLASS = 0x4,
-	IB_BOARD_MGMT_CLASS = 0x5,
-	IB_DEVICE_MGMT_CLASS = 0x6,
-	IB_CM_CLASS = 0x7,
-	IB_SNMP_CLASS = 0x8,
-	IB_VENDOR_RANGE1_START_CLASS = 0x9,
-	IB_VENDOR_RANGE1_END_CLASS = 0x0f,
-	IB_CC_CLASS = 0x21,
-	IB_VENDOR_RANGE2_START_CLASS = 0x30,
-	IB_VENDOR_RANGE2_END_CLASS = 0x4f,
+	IB_SMI_CLASS = UMAD_CLASS_SUBN_LID_ROUTED,
+	IB_SMI_DIRECT_CLASS = UMAD_CLASS_SUBN_DIRECTED_ROUTE,
+	IB_SA_CLASS = UMAD_CLASS_SUBN_ADM,
+	IB_PERFORMANCE_CLASS = UMAD_CLASS_PERF_MGMT,
+	IB_BOARD_MGMT_CLASS = UMAD_CLASS_BM,
+	IB_DEVICE_MGMT_CLASS = UMAD_CLASS_DEVICE_MGMT,
+	IB_CM_CLASS = UMAD_CLASS_CM,
+	IB_SNMP_CLASS = UMAD_CLASS_SNMP,
+	IB_VENDOR_RANGE1_START_CLASS = UMAD_CLASS_VENDOR_RANGE1_START,
+	IB_VENDOR_RANGE1_END_CLASS = UMAD_CLASS_VENDOR_RANGE1_END,
+	IB_CC_CLASS = UMAD_CLASS_CONG_MGMT,
+	IB_VENDOR_RANGE2_START_CLASS = UMAD_CLASS_VENDOR_RANGE2_START,
+	IB_VENDOR_RANGE2_END_CLASS = UMAD_CLASS_VENDOR_RANGE2_END,
 };
 
 enum MAD_METHODS {
-	IB_MAD_METHOD_GET = 0x1,
-	IB_MAD_METHOD_SET = 0x2,
-	IB_MAD_METHOD_GET_RESPONSE = 0x81,
-
-	IB_MAD_METHOD_SEND = 0x3,
-	IB_MAD_METHOD_TRAP = 0x5,
-	IB_MAD_METHOD_TRAP_REPRESS = 0x7,
-
-	IB_MAD_METHOD_REPORT = 0x6,
-	IB_MAD_METHOD_REPORT_RESPONSE = 0x86,
-	IB_MAD_METHOD_GET_TABLE = 0x12,
-	IB_MAD_METHOD_GET_TABLE_RESPONSE = 0x92,
-	IB_MAD_METHOD_GET_TRACE_TABLE = 0x13,
-	IB_MAD_METHOD_GET_TRACE_TABLE_RESPONSE = 0x93,
-	IB_MAD_METHOD_GETMULTI = 0x14,
-	IB_MAD_METHOD_GETMULTI_RESPONSE = 0x94,
-	IB_MAD_METHOD_DELETE = 0x15,
-	IB_MAD_METHOD_DELETE_RESPONSE = 0x95,
-
-	IB_MAD_RESPONSE = 0x80,
+	IB_MAD_METHOD_GET = UMAD_METHOD_GET,
+	IB_MAD_METHOD_SET = UMAD_METHOD_SET,
+	IB_MAD_METHOD_GET_RESPONSE = UMAD_METHOD_GET_RESP,
+
+	IB_MAD_METHOD_SEND = UMAD_METHOD_SEND,
+	IB_MAD_METHOD_TRAP = UMAD_METHOD_TRAP,
+	IB_MAD_METHOD_TRAP_REPRESS = UMAD_METHOD_TRAP_REPRESS,
+
+	IB_MAD_METHOD_REPORT = UMAD_METHOD_REPORT,
+	IB_MAD_METHOD_REPORT_RESPONSE = UMAD_METHOD_REPORT_RESP,
+	IB_MAD_METHOD_GET_TABLE = UMAD_SA_METHOD_GET_TABLE,
+	IB_MAD_METHOD_GET_TABLE_RESPONSE = UMAD_SA_METHOD_GET_TABLE_RESP,
+	IB_MAD_METHOD_GET_TRACE_TABLE = UMAD_SA_METHOD_GET_TRACE_TABLE,
+	IB_MAD_METHOD_GET_TRACE_TABLE_RESPONSE = 0x93, /* Not in spec */
+	IB_MAD_METHOD_GETMULTI = UMAD_SA_METHOD_GET_MULTI,
+	IB_MAD_METHOD_GETMULTI_RESPONSE = UMAD_SA_METHOD_GET_MULTI_RESP,
+	IB_MAD_METHOD_DELETE = UMAD_SA_METHOD_DELETE,
+	IB_MAD_METHOD_DELETE_RESPONSE = UMAD_SA_METHOD_DELETE_RESP,
+
+	IB_MAD_RESPONSE = UMAD_METHOD_RESP,
 };
 
 enum MAD_ATTR_ID {
-	CLASS_PORT_INFO = 0x1,
-	NOTICE = 0x2,
-	INFORM_INFO = 0x3,
+	CLASS_PORT_INFO = UMAD_ATTR_CLASS_PORT_INFO,
+	NOTICE = UMAD_ATTR_NOTICE,
+	INFORM_INFO = UMAD_ATTR_INFORM_INFO,
 };
 
 enum MAD_STATUS {
-	IB_MAD_STS_OK = (0 << 2),
-	IB_MAD_STS_BUSY = (1 << 0),
-	IB_MAD_STS_REDIRECT = (1 << 1),
-	IB_MAD_STS_BAD_BASE_VER_OR_CLASS = (1 << 2),
-	IB_MAD_STS_METHOD_NOT_SUPPORTED = (2 << 2),
-	IB_MAD_STS_METHOD_ATTR_NOT_SUPPORTED = (3 << 2),
-	IB_MAD_STS_INV_ATTR_VALUE = (7 << 2),
+	IB_MAD_STS_OK = UMAD_STATUS_SUCCESS,
+	IB_MAD_STS_BUSY = UMAD_STATUS_BUSY,
+	IB_MAD_STS_REDIRECT = UMAD_STATUS_REDIRECT,
+	IB_MAD_STS_BAD_BASE_VER_OR_CLASS = UMAD_STATUS_BAD_VERSION,
+	IB_MAD_STS_METHOD_NOT_SUPPORTED = UMAD_STATUS_METHOD_NOT_SUPPORTED,
+	IB_MAD_STS_METHOD_ATTR_NOT_SUPPORTED = UMAD_STATUS_ATTR_NOT_SUPPORTED,
+	IB_MAD_STS_INV_ATTR_VALUE = UMAD_STATUS_INVALID_ATTR_VALUE,
 };
 
 enum SMI_ATTR_ID {
-	IB_ATTR_NODE_DESC = 0x10,
-	IB_ATTR_NODE_INFO = 0x11,
-	IB_ATTR_SWITCH_INFO = 0x12,
-	IB_ATTR_GUID_INFO = 0x14,
-	IB_ATTR_PORT_INFO = 0x15,
-	IB_ATTR_PKEY_TBL = 0x16,
-	IB_ATTR_SLVL_TABLE = 0x17,
-	IB_ATTR_VL_ARBITRATION = 0x18,
-	IB_ATTR_LINEARFORWTBL = 0x19,
-	IB_ATTR_MULTICASTFORWTBL = 0x1b,
+	IB_ATTR_NODE_DESC = UMAD_SMP_ATTR_NODE_DESC,
+	IB_ATTR_NODE_INFO = UMAD_SMP_ATTR_NODE_INFO,
+	IB_ATTR_SWITCH_INFO = UMAD_SMP_ATTR_SWITCH_INFO,
+	IB_ATTR_GUID_INFO = UMAD_SMP_ATTR_GUID_INFO,
+	IB_ATTR_PORT_INFO = UMAD_SMP_ATTR_PORT_INFO,
+	IB_ATTR_PKEY_TBL = UMAD_SMP_ATTR_PKEY_TABLE,
+	IB_ATTR_SLVL_TABLE = UMAD_SMP_ATTR_SLVL_TABLE,
+	IB_ATTR_VL_ARBITRATION = UMAD_SMP_ATTR_VL_ARB_TABLE,
+	IB_ATTR_LINEARFORWTBL = UMAD_SMP_ATTR_LINEAR_FT,
+	IB_ATTR_MULTICASTFORWTBL = UMAD_SMP_ATTR_MCAST_FT,
 	IB_ATTR_LINKSPEEDWIDTHPAIRSTBL = 0x1c,
 	IB_ATTR_VENDORMADSTBL = 0x1d,
-	IB_ATTR_SMINFO = 0x20,
+	IB_ATTR_SMINFO = UMAD_SMP_ATTR_SM_INFO,
 
 	IB_ATTR_LAST
 };
 
 enum SA_ATTR_ID {
-	IB_SA_ATTR_NOTICE = 0x02,
-	IB_SA_ATTR_INFORMINFO = 0x03,
-	IB_SA_ATTR_NODERECORD = 0x11,
-	IB_SA_ATTR_PORTINFORECORD = 0x12,
-	IB_SA_ATTR_SL2VLTABLERECORD = 0x13,
-	IB_SA_ATTR_SWITCHINFORECORD = 0x14,
-	IB_SA_ATTR_LFTRECORD = 0x15,
-	IB_SA_ATTR_RFTRECORD = 0x16,
-	IB_SA_ATTR_MFTRECORD = 0x17,
-	IB_SA_ATTR_SMINFORECORD = 0x18,
-	IB_SA_ATTR_LINKRECORD = 0x20,
-	IB_SA_ATTR_GUIDINFORECORD = 0x30,
-	IB_SA_ATTR_SERVICERECORD = 0x31,
-	IB_SA_ATTR_PKEYTABLERECORD = 0x33,
-	IB_SA_ATTR_PATHRECORD = 0x35,
-	IB_SA_ATTR_VLARBTABLERECORD = 0x36,
-	IB_SA_ATTR_MCRECORD = 0x38,
-	IB_SA_ATTR_MULTIPATH = 0x3a,
-	IB_SA_ATTR_INFORMINFORECORD = 0xf3,
+	IB_SA_ATTR_NOTICE = UMAD_ATTR_NOTICE,
+	IB_SA_ATTR_INFORMINFO = UMAD_ATTR_INFORM_INFO,
+	IB_SA_ATTR_NODERECORD = UMAD_SA_ATTR_NODE_REC,
+	IB_SA_ATTR_PORTINFORECORD = UMAD_SA_ATTR_PORT_INFO_REC,
+	IB_SA_ATTR_SL2VLTABLERECORD = UMAD_SA_ATTR_SLVL_REC,
+	IB_SA_ATTR_SWITCHINFORECORD = UMAD_SA_ATTR_SWITCH_INFO_REC,
+	IB_SA_ATTR_LFTRECORD = UMAD_SA_ATTR_LINEAR_FT_REC,
+	IB_SA_ATTR_RFTRECORD = UMAD_SA_ATTR_RANDOM_FT_REC,
+	IB_SA_ATTR_MFTRECORD = UMAD_SA_ATTR_MCAST_FT_REC,
+	IB_SA_ATTR_SMINFORECORD = UMAD_SA_ATTR_SM_INFO_REC,
+	IB_SA_ATTR_LINKRECORD = UMAD_SA_ATTR_LINK_REC,
+	IB_SA_ATTR_GUIDINFORECORD = UMAD_SA_ATTR_GUID_INFO_REC,
+	IB_SA_ATTR_SERVICERECORD = UMAD_SA_ATTR_SERVICE_REC,
+	IB_SA_ATTR_PKEYTABLERECORD = UMAD_SA_ATTR_PKEY_TABLE_REC,
+	IB_SA_ATTR_PATHRECORD = UMAD_SA_ATTR_PATH_REC,
+	IB_SA_ATTR_VLARBTABLERECORD = UMAD_SA_ATTR_VL_ARB_REC,
+	IB_SA_ATTR_MCRECORD = UMAD_SA_ATTR_MCMEMBER_REC,
+	IB_SA_ATTR_MULTIPATH = UMAD_SA_ATTR_MULTI_PATH_REC,
+	IB_SA_ATTR_INFORMINFORECORD = UMAD_SA_ATTR_INFORM_INFO_REC,
 
 	IB_SA_ATTR_LAST
 };
@@ -200,7 +203,7 @@ enum BM_ATTR_ID {
 
 #define IB_VENDOR_OPENIB_PING_CLASS	(IB_VENDOR_RANGE2_START_CLASS + 2)
 #define IB_VENDOR_OPENIB_SYSSTAT_CLASS	(IB_VENDOR_RANGE2_START_CLASS + 3)
-#define IB_OPENIB_OUI			(0x001405)
+#define IB_OPENIB_OUI			UMAD_OPENIB_OUI
 
 typedef uint8_t ibmad_gid_t[16];
 #ifdef USE_DEPRECATED_IB_GID_T
@@ -714,16 +717,16 @@ enum MAD_FIELDS {
  */
 enum RMPP_TYPE_ENUM {
 	IB_RMPP_TYPE_NONE,
-	IB_RMPP_TYPE_DATA,
-	IB_RMPP_TYPE_ACK,
-	IB_RMPP_TYPE_STOP,
-	IB_RMPP_TYPE_ABORT,
+	IB_RMPP_TYPE_DATA = UMAD_RMPP_TYPE_DATA,
+	IB_RMPP_TYPE_ACK = UMAD_RMPP_TYPE_ACK,
+	IB_RMPP_TYPE_STOP = UMAD_RMPP_TYPE_STOP,
+	IB_RMPP_TYPE_ABORT = UMAD_RMPP_TYPE_ABORT,
 };
 
 enum RMPP_FLAGS_ENUM {
-	IB_RMPP_FLAG_ACTIVE = 1 << 0,
-	IB_RMPP_FLAG_FIRST = 1 << 1,
-	IB_RMPP_FLAG_LAST = 1 << 2,
+	IB_RMPP_FLAG_ACTIVE = UMAD_RMPP_FLAG_ACTIVE,
+	IB_RMPP_FLAG_FIRST = UMAD_RMPP_FLAG_FIRST,
+	IB_RMPP_FLAG_LAST = UMAD_RMPP_FLAG_LAST,
 };
 
 typedef struct {
@@ -928,12 +931,14 @@ MAD_EXPORT uint8_t *ib_vendor_call_via(void *data, ib_portid_t * portid,
 
 static inline int mad_is_vendor_range1(int mgmt)
 {
-	return mgmt >= 0x9 && mgmt <= 0xf;
+	return mgmt >= UMAD_CLASS_VENDOR_RANGE1_START &&
+	       mgmt <= UMAD_CLASS_VENDOR_RANGE1_END;
 }
 
 static inline int mad_is_vendor_range2(int mgmt)
 {
-	return mgmt >= 0x30 && mgmt <= 0x4f;
+	return mgmt >= UMAD_CLASS_VENDOR_RANGE2_START &&
+	       mgmt <= UMAD_CLASS_VENDOR_RANGE2_END;
 }
 
 /* rpc.c */


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 8/12] ib-mgmt: fix trace table response
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (6 preceding siblings ...)
  2010-10-23  7:07   ` [RFC 7/12] ib-mgmt: update mad.h to use umad_types.h Hefty, Sean
@ 2010-10-23  7:09   ` Hefty, Sean
  2010-10-23  7:10   ` [RFC 9/12] ib-mgmt: convert ib_types.h to use umad types Hefty, Sean
                     ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:09 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

A response to a get trace table request is a get table response.
There is no 'get trace table response'.  See IB spec 1.2.1,
section 15.4.9.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
Separating out this change, so the 'fix' is clear.

 libibmad/include/infiniband/mad.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index 4a29c98..f3733a2 100755
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -100,7 +100,7 @@ enum MAD_METHODS {
 	IB_MAD_METHOD_GET_TABLE = UMAD_SA_METHOD_GET_TABLE,
 	IB_MAD_METHOD_GET_TABLE_RESPONSE = UMAD_SA_METHOD_GET_TABLE_RESP,
 	IB_MAD_METHOD_GET_TRACE_TABLE = UMAD_SA_METHOD_GET_TRACE_TABLE,
-	IB_MAD_METHOD_GET_TRACE_TABLE_RESPONSE = 0x93, /* Not in spec */
+	IB_MAD_METHOD_GET_TRACE_TABLE_RESPONSE = UMAD_SA_METHOD_GET_TABLE_RESP,
 	IB_MAD_METHOD_GETMULTI = UMAD_SA_METHOD_GET_MULTI,
 	IB_MAD_METHOD_GETMULTI_RESPONSE = UMAD_SA_METHOD_GET_MULTI_RESP,
 	IB_MAD_METHOD_DELETE = UMAD_SA_METHOD_DELETE,


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 9/12] ib-mgmt: convert ib_types.h to use umad types
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (7 preceding siblings ...)
  2010-10-23  7:09   ` [RFC 8/12] ib-mgmt: fix trace table response Hefty, Sean
@ 2010-10-23  7:10   ` Hefty, Sean
  2010-10-23  7:11   ` [RFC 10/12] ib-mgmt: remove duplicate definition of IB_MAD_STATUS_CLASS_MASK Hefty, Sean
                     ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:10 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Several data type definitions have been added to umad.
Update ib_types.h to make use of these definitions.  For
backwards compatibility, the existing names in ib_types.h
are kept until they can be deprecated.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 opensm/include/iba/ib_types.h |  186 +++++++++++++++++++++--------------------
 1 files changed, 94 insertions(+), 92 deletions(-)
 mode change 100644 => 100755 opensm/include/iba/ib_types.h

diff --git a/opensm/include/iba/ib_types.h b/opensm/include/iba/ib_types.h
old mode 100644
new mode 100755
index e1bc102..86b31b0
--- a/opensm/include/iba/ib_types.h
+++ b/opensm/include/iba/ib_types.h
@@ -40,6 +40,8 @@
 #include <string.h>
 #include <complib/cl_types.h>
 #include <complib/cl_byteswap.h>
+#include <infiniband/umad_types.h>
+#include <infiniband/umad_sa.h>

 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
@@ -105,7 +107,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define MAD_RMPP_DATA_SIZE             (MAD_BLOCK_SIZE - MAD_RMPP_HDR_SIZE)
+#define MAD_RMPP_DATA_SIZE                     UMAD_LEN_RMPP_DATA
 /**********/
 /****d* IBA Base: Constants/MAD_BLOCK_GRH_SIZE
 * NAME
@@ -409,7 +411,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_SUBN_LID                                     0x01
+#define IB_MCLASS_SUBN_LID                                     UMAD_CLASS_SUBN_LID_ROUTED
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_SUBN_DIR
 * NAME
@@ -420,7 +422,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_SUBN_DIR                                     0x81
+#define IB_MCLASS_SUBN_DIR                                     UMAD_CLASS_SUBN_DIRECTED_ROUTE
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_SUBN_ADM
 * NAME
@@ -431,7 +433,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_SUBN_ADM                                     0x03
+#define IB_MCLASS_SUBN_ADM                                     UMAD_CLASS_SUBN_ADM
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_PERF
 * NAME
@@ -442,7 +444,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_PERF                                         0x04
+#define IB_MCLASS_PERF                                         UMAD_CLASS_PERF_MGMT
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_BM
 * NAME
@@ -453,7 +455,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_BM                                           0x05
+#define IB_MCLASS_BM                                           UMAD_CLASS_BM
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_DEV_MGMT
 * NAME
@@ -464,7 +466,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_DEV_MGMT                                     0x06
+#define IB_MCLASS_DEV_MGMT                                     UMAD_CLASS_DEVICE_MGMT
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_COMM_MGMT
 * NAME
@@ -475,7 +477,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_COMM_MGMT                                    0x07
+#define IB_MCLASS_COMM_MGMT                                    UMAD_CLASS_CM
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_SNMP
 * NAME
@@ -486,7 +488,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_SNMP                                         0x08
+#define IB_MCLASS_SNMP                                         UMAD_CLASS_SNMP
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_LOW_RANGE_MIN
 * NAME
@@ -497,7 +499,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_VENDOR_LOW_RANGE_MIN 0x09
+#define IB_MCLASS_VENDOR_LOW_RANGE_MIN UMAD_CLASS_VENDOR_RANGE1_START
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_LOW_RANGE_MAX
 * NAME
@@ -508,7 +510,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_VENDOR_LOW_RANGE_MAX 0x0f
+#define IB_MCLASS_VENDOR_LOW_RANGE_MAX UMAD_CLASS_VENDOR_RANGE1_END
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_DEV_ADM
 * NAME
@@ -519,7 +521,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_DEV_ADM 0x10
+#define IB_MCLASS_DEV_ADM UMAD_CLASS_DEVICE_ADM
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_BIS
 * NAME
@@ -530,7 +532,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_BIS 0x12
+#define IB_MCLASS_BIS UMAD_CLASS_BIS
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_CC
 * NAME
@@ -541,7 +543,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_CC 0x21
+#define IB_MCLASS_CC UMAD_CLASS_CONG_MGMT
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MIN
 * NAME
@@ -552,7 +554,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_VENDOR_HIGH_RANGE_MIN 0x30
+#define IB_MCLASS_VENDOR_HIGH_RANGE_MIN UMAD_CLASS_VENDOR_RANGE2_START
 /**********/
 /****d* IBA Base: Constants/IB_MCLASS_VENDOR_HIGH_RANGE_MAX
 * NAME
@@ -563,7 +565,7 @@ BEGIN_C_DECLS
 *
 * SOURCE
 */
-#define IB_MCLASS_VENDOR_HIGH_RANGE_MAX 0x4f
+#define IB_MCLASS_VENDOR_HIGH_RANGE_MAX UMAD_CLASS_VENDOR_RANGE2_END
 /**********/
 /****f* IBA Base: Types/ib_class_is_vendor_specific_low
 * NAME
@@ -578,8 +580,8 @@ BEGIN_C_DECLS
 static inline boolean_t OSM_API
 ib_class_is_vendor_specific_low(IN const uint8_t class_code)
 {
-       return ((class_code >= IB_MCLASS_VENDOR_LOW_RANGE_MIN) &&
-               (class_code <= IB_MCLASS_VENDOR_LOW_RANGE_MAX));
+       return ((class_code >= UMAD_CLASS_VENDOR_RANGE1_START) &&
+               (class_code <= UMAD_CLASS_VENDOR_RANGE1_END));
 }

 /*
@@ -610,8 +612,8 @@ ib_class_is_vendor_specific_low(IN const uint8_t class_code)
 static inline boolean_t OSM_API
 ib_class_is_vendor_specific_high(IN const uint8_t class_code)
 {
-       return ((class_code >= IB_MCLASS_VENDOR_HIGH_RANGE_MIN) &&
-               (class_code <= IB_MCLASS_VENDOR_HIGH_RANGE_MAX));
+       return ((class_code >= UMAD_CLASS_VENDOR_RANGE2_START) &&
+               (class_code <= UMAD_CLASS_VENDOR_RANGE2_END));
 }

 /*
@@ -671,10 +673,10 @@ ib_class_is_vendor_specific(IN const uint8_t class_code)
 */
 static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 {
-       return ((class_code == IB_MCLASS_SUBN_ADM) ||
-               (class_code == IB_MCLASS_DEV_MGMT) ||
-               (class_code == IB_MCLASS_DEV_ADM) ||
-               (class_code == IB_MCLASS_BIS) ||
+       return ((class_code == UMAD_CLASS_SUBN_ADM) ||
+               (class_code == UMAD_CLASS_DEVICE_MGMT) ||
+               (class_code == UMAD_CLASS_DEVICE_ADM) ||
+               (class_code == UMAD_CLASS_BIS) ||
                ib_class_is_vendor_specific_high(class_code));
 }

@@ -716,7 +718,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_RESP_MASK                                0x80
+#define IB_MAD_METHOD_RESP_MASK                                UMAD_METHOD_RESP
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_GET
@@ -728,7 +730,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_GET                                      0x01
+#define IB_MAD_METHOD_GET                                      UMAD_METHOD_GET
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_SET
@@ -740,7 +742,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_SET                                      0x02
+#define IB_MAD_METHOD_SET                                      UMAD_METHOD_SET
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_GET_RESP
@@ -752,10 +754,10 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_GET_RESP                         0x81
+#define IB_MAD_METHOD_GET_RESP                         UMAD_METHOD_GET_RESP
 /**********/

-#define IB_MAD_METHOD_DELETE                           0x15
+#define IB_MAD_METHOD_DELETE                           UMAD_SA_METHOD_DELETE

 /****d* IBA Base: Constants/IB_MAD_METHOD_GETTABLE
 * NAME
@@ -766,7 +768,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_GETTABLE                         0x12
+#define IB_MAD_METHOD_GETTABLE                         UMAD_SA_METHOD_GET_TABLE
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_GETTABLE_RESP
@@ -778,13 +780,13 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_GETTABLE_RESP                    0x92
+#define IB_MAD_METHOD_GETTABLE_RESP                    UMAD_SA_METHOD_GET_TABLE_RESP

 /**********/

-#define IB_MAD_METHOD_GETTRACETABLE                    0x13
-#define IB_MAD_METHOD_GETMULTI                         0x14
-#define IB_MAD_METHOD_GETMULTI_RESP                    0x94
+#define IB_MAD_METHOD_GETTRACETABLE                    UMAD_SA_METHOD_GET_TRACE_TABLE
+#define IB_MAD_METHOD_GETMULTI                         UMAD_SA_METHOD_GET_MULTI
+#define IB_MAD_METHOD_GETMULTI_RESP                    UMAD_SA_METHOD_GET_MULTI_RESP

 /****d* IBA Base: Constants/IB_MAD_METHOD_SEND
 * NAME
@@ -795,7 +797,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_SEND                                     0x03
+#define IB_MAD_METHOD_SEND                                     UMAD_METHOD_SEND
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_TRAP
@@ -807,7 +809,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_TRAP                                     0x05
+#define IB_MAD_METHOD_TRAP                                     UMAD_METHOD_TRAP
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_REPORT
@@ -819,7 +821,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_REPORT                           0x06
+#define IB_MAD_METHOD_REPORT                           UMAD_METHOD_REPORT
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_REPORT_RESP
@@ -831,7 +833,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_REPORT_RESP                      0x86
+#define IB_MAD_METHOD_REPORT_RESP                      UMAD_METHOD_REPORT_RESP
 /**********/

 /****d* IBA Base: Constants/IB_MAD_METHOD_TRAP_REPRESS
@@ -843,7 +845,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_METHOD_TRAP_REPRESS                     0x07
+#define IB_MAD_METHOD_TRAP_REPRESS                     UMAD_METHOD_TRAP_REPRESS
 /**********/

 /****d* IBA Base: Constants/IB_MAD_STATUS_BUSY
@@ -855,7 +857,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_STATUS_BUSY                             (CL_HTON16(0x0001))
+#define IB_MAD_STATUS_BUSY                             (CL_HTON16(UMAD_STATUS_BUSY))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_STATUS_REDIRECT
@@ -867,7 +869,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_STATUS_REDIRECT                         (CL_HTON16(0x0002))
+#define IB_MAD_STATUS_REDIRECT                         (CL_HTON16(UMAD_STATUS_REDIRECT))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_CLASS_VER
@@ -879,7 +881,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_STATUS_UNSUP_CLASS_VER                  (CL_HTON16(0x0004))
+#define IB_MAD_STATUS_UNSUP_CLASS_VER                  (CL_HTON16(UMAD_STATUS_BAD_VERSION))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_METHOD
@@ -891,7 +893,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_STATUS_UNSUP_METHOD                     (CL_HTON16(0x0008))
+#define IB_MAD_STATUS_UNSUP_METHOD                     (CL_HTON16(UMAD_STATUS_METHOD_NOT_SUPPORTED))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_STATUS_UNSUP_METHOD_ATTR
@@ -903,7 +905,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_STATUS_UNSUP_METHOD_ATTR                        (CL_HTON16(0x000C))
+#define IB_MAD_STATUS_UNSUP_METHOD_ATTR                        (CL_HTON16(UMAD_STATUS_ATTR_NOT_SUPPORTED))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_STATUS_INVALID_FIELD
@@ -915,10 +917,10 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_STATUS_INVALID_FIELD                    (CL_HTON16(0x001C))
+#define IB_MAD_STATUS_INVALID_FIELD                    (CL_HTON16(UMAD_STATUS_INVALID_ATTR_VALUE))
 /**********/

-#define IB_MAD_STATUS_CLASS_MASK                       (CL_HTON16(0xFF00))
+#define IB_MAD_STATUS_CLASS_MASK                       (CL_HTON16(UMAD_STATUS_CLASS_MASK))

 #define IB_SA_MAD_STATUS_SUCCESS                       (CL_HTON16(0x0000))
 #define IB_SA_MAD_STATUS_NO_RESOURCES                  (CL_HTON16(0x0100))
@@ -943,7 +945,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_CLASS_PORT_INFO                    (CL_HTON16(0x0001))
+#define IB_MAD_ATTR_CLASS_PORT_INFO                    (CL_HTON16(UMAD_ATTR_CLASS_PORT_INFO))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_NOTICE
@@ -955,7 +957,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_NOTICE                                     (CL_HTON16(0x0002))
+#define IB_MAD_ATTR_NOTICE                                     (CL_HTON16(UMAD_ATTR_NOTICE))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO
@@ -967,7 +969,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_INFORM_INFO                                (CL_HTON16(0x0003))
+#define IB_MAD_ATTR_INFORM_INFO                                (CL_HTON16(UMAD_ATTR_INFORM_INFO))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_NODE_DESC
@@ -1182,7 +1184,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_NODE_RECORD                                (CL_HTON16(0x0011))
+#define IB_MAD_ATTR_NODE_RECORD                                (CL_HTON16(UMAD_SA_ATTR_NODE_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_PORTINFO_RECORD
@@ -1194,7 +1196,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_PORTINFO_RECORD                    (CL_HTON16(0x0012))
+#define IB_MAD_ATTR_PORTINFO_RECORD                    (CL_HTON16(UMAD_SA_ATTR_PORT_INFO_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_SWITCH_INFO_RECORD
@@ -1206,7 +1208,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_SWITCH_INFO_RECORD                 (CL_HTON16(0x0014))
+#define IB_MAD_ATTR_SWITCH_INFO_RECORD                 (CL_HTON16(UMAD_SA_ATTR_SWITCH_INFO_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_LINK_RECORD
@@ -1218,7 +1220,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_LINK_RECORD                                (CL_HTON16(0x0020))
+#define IB_MAD_ATTR_LINK_RECORD                                (CL_HTON16(UMAD_SA_ATTR_LINK_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_SM_INFO
@@ -1242,7 +1244,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_SMINFO_RECORD                      (CL_HTON16(0x0018))
+#define IB_MAD_ATTR_SMINFO_RECORD                      (CL_HTON16(UMAD_SA_ATTR_SM_INFO_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_GUIDINFO_RECORD
@@ -1254,7 +1256,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_GUIDINFO_RECORD                    (CL_HTON16(0x0030))
+#define IB_MAD_ATTR_GUIDINFO_RECORD                    (CL_HTON16(UMAD_SA_ATTR_GUID_INFO_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_VENDOR_DIAG
@@ -1290,7 +1292,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_SERVICE_RECORD                     (CL_HTON16(0x0031))
+#define IB_MAD_ATTR_SERVICE_RECORD                     (CL_HTON16(UMAD_SA_ATTR_SERVICE_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_LFT_RECORD
@@ -1302,7 +1304,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_LFT_RECORD                         (CL_HTON16(0x0015))
+#define IB_MAD_ATTR_LFT_RECORD                         (CL_HTON16(UMAD_SA_ATTR_LINEAR_FT_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_MFT_RECORD
@@ -1314,7 +1316,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_MFT_RECORD                         (CL_HTON16(0x0017))
+#define IB_MAD_ATTR_MFT_RECORD                         (CL_HTON16(UMAD_SA_ATTR_MCAST_FT_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_PKEYTBL_RECORD
@@ -1326,7 +1328,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_PKEY_TBL_RECORD                    (CL_HTON16(0x0033))
+#define IB_MAD_ATTR_PKEY_TBL_RECORD                    (CL_HTON16(UMAD_SA_ATTR_PKEY_TABLE_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_PATH_RECORD
@@ -1338,7 +1340,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_PATH_RECORD                                (CL_HTON16(0x0035))
+#define IB_MAD_ATTR_PATH_RECORD                                (CL_HTON16(UMAD_SA_ATTR_PATH_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_VLARB_RECORD
@@ -1350,7 +1352,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_VLARB_RECORD                       (CL_HTON16(0x0036))
+#define IB_MAD_ATTR_VLARB_RECORD                       (CL_HTON16(UMAD_SA_ATTR_VL_ARB_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_SLVL_RECORD
@@ -1362,7 +1364,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_SLVL_RECORD                                (CL_HTON16(0x0013))
+#define IB_MAD_ATTR_SLVL_RECORD                                (CL_HTON16(UMAD_SA_ATTR_SLVL_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_MCMEMBER_RECORD
@@ -1374,7 +1376,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_MCMEMBER_RECORD                    (CL_HTON16(0x0038))
+#define IB_MAD_ATTR_MCMEMBER_RECORD                    (CL_HTON16(UMAD_SA_ATTR_MCMEMBER_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_TRACE_RECORD
@@ -1386,7 +1388,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_TRACE_RECORD                       (CL_HTON16(0x0039))
+#define IB_MAD_ATTR_TRACE_RECORD                       (CL_HTON16(UMAD_SA_ATTR_TRACE_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_MULTIPATH_RECORD
@@ -1398,7 +1400,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_MULTIPATH_RECORD                   (CL_HTON16(0x003A))
+#define IB_MAD_ATTR_MULTIPATH_RECORD                   (CL_HTON16(UMAD_SA_ATTR_MULTI_PATH_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_SVC_ASSOCIATION_RECORD
@@ -1410,7 +1412,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD             (CL_HTON16(0x003B))
+#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD             (CL_HTON16(UMAD_SA_ATTR_SERVICE_ASSOC_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_INFORM_INFO_RECORD
@@ -1422,7 +1424,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_INFORM_INFO_RECORD                 (CL_HTON16(0x00F3))
+#define IB_MAD_ATTR_INFORM_INFO_RECORD                 (CL_HTON16(UMAD_SA_ATTR_INFORM_INFO_REC))

 /****d* IBA Base: Constants/IB_MAD_ATTR_IO_UNIT_INFO
 * NAME
@@ -1529,7 +1531,7 @@ static inline boolean_t OSM_API ib_class_is_rmpp(IN const uint8_t class_code)
 *
 * SOURCE
 */
-#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD     (CL_HTON16(0x003B))
+#define IB_MAD_ATTR_SVC_ASSOCIATION_RECORD     (CL_HTON16(UMAD_SA_ATTR_SERVICE_ASSOC_REC))
 /**********/

 /****d* IBA Base: Constants/IB_MAD_ATTR_CONG_INFO
@@ -3931,28 +3933,28 @@ ib_mad_is_response(IN const ib_mad_t * const p_mad)
 *      ib_mad_t
 *********/

-#define IB_RMPP_TYPE_DATA              1
-#define IB_RMPP_TYPE_ACK               2
-#define IB_RMPP_TYPE_STOP              3
-#define IB_RMPP_TYPE_ABORT             4
-
-#define IB_RMPP_NO_RESP_TIME           0x1F
-#define IB_RMPP_FLAG_ACTIVE            0x01
-#define IB_RMPP_FLAG_FIRST             0x02
-#define IB_RMPP_FLAG_LAST              0x04
-
-#define IB_RMPP_STATUS_SUCCESS         0
-#define IB_RMPP_STATUS_RESX            1       /* resources exhausted */
-#define IB_RMPP_STATUS_T2L             118     /* time too long */
-#define IB_RMPP_STATUS_BAD_LEN         119     /* incon. last and payload len */
-#define IB_RMPP_STATUS_BAD_SEG         120     /* incon. first and segment no */
-#define IB_RMPP_STATUS_BADT            121     /* bad rmpp type */
-#define IB_RMPP_STATUS_W2S             122     /* newwindowlast too small */
-#define IB_RMPP_STATUS_S2B             123     /* segment no too big */
-#define IB_RMPP_STATUS_BAD_STATUS      124     /* illegal status */
-#define IB_RMPP_STATUS_UNV             125     /* unsupported version */
-#define IB_RMPP_STATUS_TMR             126     /* too many retries */
-#define IB_RMPP_STATUS_UNSPEC          127     /* unspecified */
+#define IB_RMPP_TYPE_DATA              UMAD_RMPP_TYPE_DATA
+#define IB_RMPP_TYPE_ACK               UMAD_RMPP_TYPE_ACK
+#define IB_RMPP_TYPE_STOP              UMAD_RMPP_TYPE_STOP
+#define IB_RMPP_TYPE_ABORT             UMAD_RMPP_TYPE_ABORT
+
+#define IB_RMPP_NO_RESP_TIME           UMAD_RMPP_NO_RESPTIME
+#define IB_RMPP_FLAG_ACTIVE            UMAD_RMPP_FLAG_ACTIVE
+#define IB_RMPP_FLAG_FIRST             UMAD_RMPP_FLAG_FIRST
+#define IB_RMPP_FLAG_LAST              UMAD_RMPP_FLAG_LAST
+
+#define IB_RMPP_STATUS_SUCCESS         UMAD_RMPP_STATUS_SUCCESS
+#define IB_RMPP_STATUS_RESX            UMAD_RMPP_STATUS_RESX   /* resources exhausted */
+#define IB_RMPP_STATUS_T2L             UMAD_RMPP_STATUS_T2L    /* time too long */
+#define IB_RMPP_STATUS_BAD_LEN         UMAD_RMPP_STATUS_BAD_LEN /* incon. last and payload len */
+#define IB_RMPP_STATUS_BAD_SEG         UMAD_RMPP_STATUS_BAD_SEG /* incon. first and segment no */
+#define IB_RMPP_STATUS_BADT            UMAD_RMPP_STATUS_BADT   /* bad rmpp type */
+#define IB_RMPP_STATUS_W2S             UMAD_RMPP_STATUS_W2S    /* newwindowlast too small */
+#define IB_RMPP_STATUS_S2B             UMAD_RMPP_STATUS_S2B    /* segment no too big */
+#define IB_RMPP_STATUS_BAD_STATUS      UMAD_RMPP_STATUS_BAD_STATUS /* illegal status */
+#define IB_RMPP_STATUS_UNV             UMAD_RMPP_STATUS_UNV    /* unsupported version */
+#define IB_RMPP_STATUS_TMR             UMAD_RMPP_STATUS_TMR    /* too many retries */
+#define IB_RMPP_STATUS_UNSPEC          UMAD_RMPP_STATUS_UNSPEC /* unspecified */

 /****f* IBA Base: Types/ib_rmpp_is_flag_set
 * NAME
@@ -4358,7 +4360,7 @@ typedef struct _ib_node_info {
 *
 * SYNOPSIS
 */
-#define IB_SA_DATA_SIZE 200
+#define IB_SA_DATA_SIZE UMAD_LEN_SA_DATA

 #include <complib/cl_packon.h>
 typedef struct _ib_sa_mad {
@@ -4386,7 +4388,7 @@ typedef struct _ib_sa_mad {
 } PACK_SUFFIX ib_sa_mad_t;
 #include <complib/cl_packoff.h>
 /**********/
-#define IB_SA_MAD_HDR_SIZE (sizeof(ib_sa_mad_t) - IB_SA_DATA_SIZE)
+#define IB_SA_MAD_HDR_SIZE (sizeof(ib_sa_mad_t) - UMAD_LEN_SA_DATA)

 static inline uint32_t OSM_API ib_get_attr_size(IN const ib_net16_t attr_offset)
 {


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 10/12] ib-mgmt: remove duplicate definition of IB_MAD_STATUS_CLASS_MASK
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (8 preceding siblings ...)
  2010-10-23  7:10   ` [RFC 9/12] ib-mgmt: convert ib_types.h to use umad types Hefty, Sean
@ 2010-10-23  7:11   ` Hefty, Sean
  2010-10-23  7:12   ` [RFC 11/12] ib-mgmt: move ntohll/htonll from mad.h to umad.h Hefty, Sean
  2010-10-23  7:17   ` [RFC 12/12] ib-mgmt/diags: add utility to display snooped mads Hefty, Sean
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:11 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

osmtest includes a duplicate definition.  Remove it.  The update
to ib_types.h results in a build warning without this fix.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 opensm/osmtest/osmtest.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 opensm/osmtest/osmtest.c

diff --git a/opensm/osmtest/osmtest.c b/opensm/osmtest/osmtest.c
old mode 100644
new mode 100755
index b2ec3fa..47d2368
--- a/opensm/osmtest/osmtest.c
+++ b/opensm/osmtest/osmtest.c
@@ -221,8 +221,6 @@ const osmtest_token_t token_array[] = {
 	{OSMTEST_TOKEN_UNKNOWN, 0, ""}	/* must be last entry */
 };
 
-#define IB_MAD_STATUS_CLASS_MASK       (CL_HTON16(0xFF00))
-
 static const char ib_mad_status_str_busy[] = "IB_MAD_STATUS_BUSY";
 static const char ib_mad_status_str_redirect[] = "IB_MAD_STATUS_REDIRECT";
 static const char ib_mad_status_str_unsup_class_ver[] =


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 11/12] ib-mgmt: move ntohll/htonll from mad.h to umad.h
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (9 preceding siblings ...)
  2010-10-23  7:11   ` [RFC 10/12] ib-mgmt: remove duplicate definition of IB_MAD_STATUS_CLASS_MASK Hefty, Sean
@ 2010-10-23  7:12   ` Hefty, Sean
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7FB-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2010-10-23  7:17   ` [RFC 12/12] ib-mgmt/diags: add utility to display snooped mads Hefty, Sean
  11 siblings, 1 reply; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:12 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Users of umad require ntohll/htonll to set/extract data from
MADs.  Move the definition from libibmad to libibumad.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 libibmad/include/infiniband/mad.h     |   29 +----------------------------
 libibmad/include/infiniband/mad_osd.h |    2 --
 libibumad/include/infiniband/umad.h   |   18 ++++++++++++++++--
 3 files changed, 17 insertions(+), 32 deletions(-)
 mode change 100644 => 100755 libibmad/include/infiniband/mad_osd.h

diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index f3733a2..80630f4 100755
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -36,6 +36,7 @@
 #define _MAD_H_
 
 #include <infiniband/mad_osd.h>
+#include <infiniband/umad.h>
 #include <infiniband/umad_sa.h>
 #include <infiniband/umad_sm.h>
 #include <infiniband/umad_types.h>
@@ -1041,34 +1042,6 @@ MAD_EXPORT void mad_dump_fields(char *buf, int bufsz, void *val, int valsz,
 
 extern MAD_EXPORT int ibdebug;
 
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#ifndef ntohll
-static inline uint64_t ntohll(uint64_t x)
-{
-	return bswap_64(x);
-}
-#endif
-#ifndef htonll
-static inline uint64_t htonll(uint64_t x)
-{
-	return bswap_64(x);
-}
-#endif
-#elif __BYTE_ORDER == __BIG_ENDIAN
-#ifndef ntohll
-static inline uint64_t ntohll(uint64_t x)
-{
-	return x;
-}
-#endif
-#ifndef htonll
-static inline uint64_t htonll(uint64_t x)
-{
-	return x;
-}
-#endif
-#endif				/* __BYTE_ORDER == __BIG_ENDIAN */
-
 /* Misc. macros: */
 /** align value \a l to \a size (ceil) */
 #define ALIGN(l, size) (((l) + ((size) - 1)) / (size) * (size))
diff --git a/libibmad/include/infiniband/mad_osd.h b/libibmad/include/infiniband/mad_osd.h
old mode 100644
new mode 100755
index ee73561..ce5397f
--- a/libibmad/include/infiniband/mad_osd.h
+++ b/libibmad/include/infiniband/mad_osd.h
@@ -39,9 +39,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <byteswap.h>
 #include <inttypes.h>
-#include <arpa/inet.h>
 
 #define MAD_EXPORT
 #define IBND_EXPORT
diff --git a/libibumad/include/infiniband/umad.h b/libibumad/include/infiniband/umad.h
index 153c5f1..d8a0cb3 100755
--- a/libibumad/include/infiniband/umad.h
+++ b/libibumad/include/infiniband/umad.h
@@ -34,6 +34,9 @@
 #define _UMAD_H
 
 #include <stdint.h>
+#include <stdlib.h>
+#include <byteswap.h>
+#include <arpa/inet.h>
 
 #ifdef __cplusplus
 #  define BEGIN_C_DECLS extern "C" {
@@ -202,8 +205,6 @@ int umad_debug(int level);
 void umad_addr_dump(ib_mad_addr_t * addr);
 void umad_dump(void *umad);
 
-#include <stdlib.h>
-
 static inline void *umad_alloc(int num, size_t size)
 {				/* alloc array of umad buffers */
 	return calloc(num, size);
@@ -214,5 +215,18 @@ static inline void umad_free(void *umad)
 	free(umad);
 }
 
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+  #ifndef ntohll
+    #define ntohll(x) bswap_64(x)
+  #endif
+#elif __BYTE_ORDER == __BIG_ENDIAN
+  #ifndef ntohll
+    #define ntohll(x) (x)
+  #endif
+#endif
+#ifndef htonll
+  #define htonll ntohll
+#endif
+
 END_C_DECLS
 #endif				/* _UMAD_H */


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC 12/12] ib-mgmt/diags: add utility to display snooped mads
       [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
                     ` (10 preceding siblings ...)
  2010-10-23  7:12   ` [RFC 11/12] ib-mgmt: move ntohll/htonll from mad.h to umad.h Hefty, Sean
@ 2010-10-23  7:17   ` Hefty, Sean
  11 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-23  7:17 UTC (permalink / raw)
  To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky
  Cc: Hal Rosenstock, Ira Weiny, Jason Gunthorpe

Port the kernel madeye utility to user space.  Use the
new MAD snooping ability exported from the kernel to
view captured MADs and display them.

Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 infiniband-diags/Makefile.am              |    6
 infiniband-diags/configure.in             |    3
 infiniband-diags/infiniband-diags.spec.in |    1
 infiniband-diags/man/madeye.8             |   23 +
 infiniband-diags/src/madeye.c             |  582 +++++++++++++++++++++++++++++
 5 files changed, 613 insertions(+), 2 deletions(-)
 create mode 100644 infiniband-diags/man/madeye.8
 create mode 100755 infiniband-diags/src/madeye.c

diff --git a/infiniband-diags/Makefile.am b/infiniband-diags/Makefile.am
index af90b05..e0a55ef 100644
--- a/infiniband-diags/Makefile.am
+++ b/infiniband-diags/Makefile.am
@@ -13,7 +13,7 @@ sbin_PROGRAMS = src/ibaddr src/ibnetdiscover src/ibping src/ibportstate \
                src/ibroute src/ibstat src/ibsysstat src/ibtracert \
                src/perfquery src/sminfo src/smpdump src/smpquery \
                src/saquery src/vendstat src/iblinkinfo \
-               src/ibqueryerrors src/ibcacheedit
+               src/ibqueryerrors src/ibcacheedit src/madeye

 if ENABLE_TEST_UTILS
 sbin_PROGRAMS += src/ibsendtrap src/mcm_rereg_test
@@ -55,6 +55,8 @@ src_sminfo_SOURCES = src/sminfo.c
 src_smpdump_SOURCES = src/smpdump.c
 src_smpquery_SOURCES = src/smpquery.c
 src_saquery_SOURCES = src/saquery.c
+src_madeye_SOURCES = src/madeye.c
+src_madeye_LDFLAGS = -libumad
 src_ibsendtrap_SOURCES = src/ibsendtrap.c
 src_vendstat_SOURCES = src/vendstat.c
 src_mcm_rereg_test_SOURCES = src/mcm_rereg_test.c
@@ -78,7 +80,7 @@ man_MANS = man/ibaddr.8 man/ibcheckerrors.8 man/ibcheckerrs.8 \
        man/ibprintswitch.8 man/ibprintca.8 man/ibfindnodesusing.8 \
        man/ibdatacounts.8 man/ibdatacounters.8 \
        man/ibrouters.8 man/ibprintrt.8 man/ibidsverify.8 \
-       man/check_lft_balance.8 man/ibcacheedit.8
+       man/check_lft_balance.8 man/ibcacheedit.8 man/madeye.8

 BUILT_SOURCES = ibdiag_version
 ibdiag_version:
diff --git a/infiniband-diags/configure.in b/infiniband-diags/configure.in
index b9326c0..e01b5a8 100644
--- a/infiniband-diags/configure.in
+++ b/infiniband-diags/configure.in
@@ -50,6 +50,9 @@ then
 AC_CHECK_HEADER(infiniband/umad.h, [],
        AC_MSG_ERROR([<infiniband/umad.h> not found. diags require libibumad.])
 )
+AC_CHECK_HEADER(infiniband/umad_types.h, [],
+       AC_MSG_ERROR([<infiniband/umad_types.h> not found. diags require more recent libibumad.])
+)
 AC_CHECK_HEADER(infiniband/mad.h, [],
        AC_MSG_ERROR([<infiniband/mad.h> not found. diags require libibmad.])
 )
diff --git a/infiniband-diags/infiniband-diags.spec.in b/infiniband-diags/infiniband-diags.spec.in
index c50ce09..64cc645 100644
--- a/infiniband-diags/infiniband-diags.spec.in
+++ b/infiniband-diags/infiniband-diags.spec.in
@@ -47,6 +47,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_sbindir}/check_lft_balance.pl
 %{_sbindir}/set_nodedesc.sh
 %{_sbindir}/sm*
+%{_sbindir}/madeye
 %{_libdir}/*.a
 %{_libdir}/*.so*
 %{_includedir}/infiniband/*.h
diff --git a/infiniband-diags/man/madeye.8 b/infiniband-diags/man/madeye.8
new file mode 100644
index 0000000..ec26da2
--- /dev/null
+++ b/infiniband-diags/man/madeye.8
@@ -0,0 +1,23 @@
+.TH MADEYE 8 "October 22, 2010" "OpenIB" "OpenIB Diagnostics"
+
+.SH NAME
+madeye \- capture and display captured IB MAD traffic
+
+.SH SYNOPSIS
+.B madeye
+[\-C, \-\-Ca=<ca_name>] [\-P, \-\-Port=<port_number>]
+[\-c, \-\-class=<management_class>] [\-n, \-\-class_version=<class_version>]
+[\-a, \-\-attr=<attribute_id>]
+[\-e, \-\-errors] [\-o, \-\-oui=<oui>] [\-h, \-\-help]
+[\-v, \-\-verbose]
+
+.SH DESCRIPTION
+.PP
+Madeye registers with the kernel to capture specified sent and
+received MADs.  Captured MADs are displayed in a human readable
+format.
+
+.SH AUTHOR
+.TP
+Sean Hefty
+.RI < sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org >
diff --git a/infiniband-diags/src/madeye.c b/infiniband-diags/src/madeye.c
new file mode 100755
index 0000000..684ede4
--- /dev/null
+++ b/infiniband-diags/src/madeye.c
@@ -0,0 +1,582 @@
+/*
+ * Copyright (c) 2004, 2005, 2010 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2005 Voltaire Inc.  All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directorY of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if HAVE_CONFIG_H
+#  include <config.h>
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <getopt.h>
+#include <string.h>
+
+#include <infiniband/umad.h>
+#include <infiniband/umad_sa.h>
+#include <infiniband/umad_sm.h>
+#include <infiniband/umad_cm.h>
+
+struct mad_info {
+       ib_user_mad_t   user_mad;
+       char            data[256];
+};
+
+static char *ca;
+static uint8_t port;
+static umad_filter_t filter;
+static int verbose;
+
+static char * get_class_name(uint8_t mgmt_class)
+{
+       switch(mgmt_class) {
+       case UMAD_CLASS_SUBN_LID_ROUTED:
+               return "LID routed SMP";
+       case UMAD_CLASS_SUBN_DIRECTED_ROUTE:
+               return "Directed route SMP";
+       case UMAD_CLASS_SUBN_ADM:
+               return "Subnet admin.";
+       case UMAD_CLASS_PERF_MGMT:
+               return "Perf. mgmt.";
+       case UMAD_CLASS_BM:
+               return "Baseboard mgmt.";
+       case UMAD_CLASS_DEVICE_MGMT:
+               return "Device mgmt.";
+       case UMAD_CLASS_CM:
+               return "Comm. mgmt.";
+       case UMAD_CLASS_SNMP:
+               return "SNMP";
+       default:
+               return "Unknown vendor/application";
+       }
+}
+
+static char * get_method_name(uint8_t mgmt_class, uint8_t method)
+{
+       switch(method) {
+       case UMAD_METHOD_GET:
+               return "Get";
+       case UMAD_METHOD_SET:
+               return "Set";
+       case UMAD_METHOD_GET_RESP:
+               return "Get response";
+       case UMAD_METHOD_SEND:
+               return "Send";
+       case UMAD_METHOD_TRAP:
+               return "Trap";
+       case UMAD_METHOD_REPORT:
+               return "Report";
+       case UMAD_METHOD_REPORT_RESP:
+               return "Report response";
+       case UMAD_METHOD_TRAP_REPRESS:
+               return "Trap repress";
+       default:
+               break;
+       }
+
+       switch (mgmt_class) {
+       case UMAD_CLASS_SUBN_ADM:
+               switch (method) {
+               case UMAD_SA_METHOD_GET_TABLE:
+                       return "Get table";
+               case UMAD_SA_METHOD_GET_TABLE_RESP:
+                       return "Get table response";
+               case UMAD_SA_METHOD_DELETE:
+                       return "Delete";
+               case UMAD_SA_METHOD_DELETE_RESP:
+                       return "Delete response";
+               case UMAD_SA_METHOD_GET_MULTI:
+                       return "Get Multi";
+               case UMAD_SA_METHOD_GET_MULTI_RESP:
+                       return "Get Multi response";
+               case UMAD_SA_METHOD_GET_TRACE_TABLE:
+                       return "Get Trace Table response";
+               default:
+                       break;
+               }
+       default:
+               break;
+       }
+
+       return "Unknown";
+}
+
+static void print_status_details(uint16_t status)
+{
+       if (status & 0x0001)
+               printf("               busy\n");
+       if (status & 0x0002)
+               printf("               redirection required\n");
+       switch((status & 0x001C) >> 2) {
+       case 1:
+               printf("               bad version\n");
+               break;
+       case 2:
+               printf("               method not supported\n");
+               break;
+       case 3:
+               printf("               method/attribute combo not supported\n");
+               break;
+       case 7:
+               printf("               invalid attribute/modifier value\n");
+               break;
+       }
+}
+
+static char * get_sa_attr(uint16_t attr)
+{
+       switch(attr) {
+       case UMAD_ATTR_CLASS_PORT_INFO:
+               return "Class Port Info";
+       case UMAD_ATTR_NOTICE:
+               return "Notice";
+       case UMAD_ATTR_INFORM_INFO:
+               return "Inform Info";
+       case UMAD_SA_ATTR_NODE_REC:
+               return "Node Record";
+       case UMAD_SA_ATTR_PORT_INFO_REC:
+               return "PortInfo Record";
+       case UMAD_SA_ATTR_SLVL_REC:
+               return "SL to VL Record";
+       case UMAD_SA_ATTR_SWITCH_INFO_REC:
+               return "Switch Record";
+       case UMAD_SA_ATTR_LINEAR_FT_REC:
+               return "Linear FDB Record";
+       case UMAD_SA_ATTR_RANDOM_FT_REC:
+               return "Random FDB Record";
+       case UMAD_SA_ATTR_MCAST_FT_REC:
+               return "Multicast FDB Record";
+       case UMAD_SA_ATTR_SM_INFO_REC:
+               return "SM Info Record";
+       case UMAD_SA_ATTR_INFORM_INFO_REC:
+               return "Inform Info Record";
+       case UMAD_SA_ATTR_LINK_REC:
+               return "Link Record";
+       case UMAD_SA_ATTR_GUID_INFO_REC:
+               return "Guid Info Record";
+       case UMAD_SA_ATTR_SERVICE_REC:
+               return "Service Record";
+       case UMAD_SA_ATTR_PKEY_TABLE_REC:
+               return "Partition Record";
+       case UMAD_SA_ATTR_PATH_REC:
+               return "Path Record";
+       case UMAD_SA_ATTR_VL_ARB_REC:
+               return "VL Arb Record";
+       case UMAD_SA_ATTR_MCMEMBER_REC:
+               return "MC Member Record";
+       case UMAD_SA_ATTR_TRACE_REC:
+               return "Trace Record";
+       case UMAD_SA_ATTR_MULTI_PATH_REC:
+               return "Multi Path Record";
+       case UMAD_SA_ATTR_SERVICE_ASSOC_REC:
+               return "Service Assoc Record";
+       default:
+               return "";
+       }
+}
+
+static char * get_cm_attr(uint16_t attr)
+{
+       switch(attr) {
+       case UMAD_CM_ATTR_REQ:
+               return "REQ";
+       case UMAD_CM_ATTR_MRA:
+               return "MRA";
+       case UMAD_CM_ATTR_REJ:
+               return "REJ";
+       case UMAD_CM_ATTR_REP:
+               return "REP";
+       case UMAD_CM_ATTR_RTU:
+               return "RTU";
+       case UMAD_CM_ATTR_DREQ:
+               return "DREQ";
+       case UMAD_CM_ATTR_DREP:
+               return "DREP";
+       case UMAD_CM_ATTR_SIDR_REQ:
+               return "SIDR REQ";
+       case UMAD_CM_ATTR_SIDR_REP:
+               return "SIDR REP";
+       case UMAD_CM_ATTR_LAP:
+               return "LAP";
+       case UMAD_CM_ATTR_APR:
+               return "APR";
+       default:
+               return "unknown";
+       }
+}
+
+static void print_mad_hdr(struct umad_hdr *hdr)
+{
+       printf("MAD version....0x%01x\n", hdr->base_version);
+       printf("Class..........0x%01x (%s)\n", hdr->mgmt_class,
+              get_class_name(hdr->mgmt_class));
+       printf("Class version..0x%01x\n", hdr->class_version);
+       printf("Method.........0x%01x (%s)\n", hdr->method,
+              get_method_name(hdr->mgmt_class, hdr->method));
+       printf("Status.........0x%02x\n", ntohs(hdr->status));
+       if (hdr->status)
+               print_status_details(ntohs(hdr->status));
+       printf("Class specific.0x%02x\n", ntohs(hdr->class_specific));
+       printf("Trans ID.......0x%llx\n", (unsigned long long) ntohll(hdr->tid));
+       printf("Attr ID........0x%02x", ntohs(hdr->attr_id));
+       switch (hdr->mgmt_class) {
+       case UMAD_CLASS_SUBN_ADM:
+               printf(" (%s)", get_sa_attr(ntohs(hdr->attr_id)));
+               break;
+       case UMAD_CLASS_CM:
+               printf(" (%s)", get_cm_attr(ntohs(hdr->attr_id)));
+               break;
+       default:
+               break;
+       }
+       printf("\n");
+       printf("Attr modifier..0x%04x\n", ntohl(hdr->attr_mod));
+}
+
+static char * get_rmpp_type(uint8_t rmpp_type)
+{
+       switch (rmpp_type) {
+       case UMAD_RMPP_TYPE_DATA:
+               return "Data";
+       case UMAD_RMPP_TYPE_ACK:
+               return "Ack";
+       case UMAD_RMPP_TYPE_STOP:
+               return "Stop";
+       case UMAD_RMPP_TYPE_ABORT:
+               return "Abort";
+       default:
+               return "Unknown";
+       }
+}
+
+static char * get_rmpp_flags(uint8_t rmpp_flags)
+{
+       if (rmpp_flags & UMAD_RMPP_FLAG_ACTIVE)
+               if (rmpp_flags & UMAD_RMPP_FLAG_FIRST)
+                       if (rmpp_flags & UMAD_RMPP_FLAG_LAST)
+                               return "Active - First & Last";
+                       else
+                               return "Active - First";
+               else
+                       if (rmpp_flags & UMAD_RMPP_FLAG_LAST)
+                               return "Active - Last";
+                       else
+                               return "Active";
+       else
+               return "Inactive";
+}
+
+static void print_rmpp_hdr(struct umad_rmpp_hdr *rmpp_hdr)
+{
+       printf("RMPP version...0x%01x\n", rmpp_hdr->rmpp_version);
+       printf("RMPP type......0x%01x (%s)\n", rmpp_hdr->rmpp_type,
+              get_rmpp_type(rmpp_hdr->rmpp_type));
+       printf("RMPP RRespTime.0x%01x\n",
+              rmpp_hdr->rmpp_rtime_flags >> UMAD_RMPP_RESP_TIME_SHIFT);
+       printf("RMPP flags.....0x%01x (%s)\n",
+              rmpp_hdr->rmpp_rtime_flags & UMAD_RMPP_FLAG_MASK,
+              get_rmpp_flags(rmpp_hdr->rmpp_rtime_flags & UMAD_RMPP_FLAG_MASK));
+       printf("RMPP status....0x%01x\n", rmpp_hdr->rmpp_status);
+       printf("Seg number.....0x%04x\n", ntohl(rmpp_hdr->seg_num));
+       switch (rmpp_hdr->rmpp_type) {
+       case UMAD_RMPP_TYPE_DATA:
+               printf("Payload len....0x%04x\n",
+                      ntohl(rmpp_hdr->paylen_newwin));
+               break;
+       case UMAD_RMPP_TYPE_ACK:
+               printf("New window.....0x%04x\n",
+                      ntohl(rmpp_hdr->paylen_newwin));
+               break;
+       default:
+               printf("Data 2.........0x%04x\n",
+                      ntohl(rmpp_hdr->paylen_newwin));
+               break;
+       }
+}
+
+static char * get_smp_attr(uint16_t attr)
+{
+       switch (attr) {
+       case UMAD_ATTR_NOTICE:
+               return "notice";
+       case UMAD_SMP_ATTR_NODE_DESC:
+               return "node description";
+       case UMAD_SMP_ATTR_NODE_INFO:
+               return "node info";
+       case UMAD_SMP_ATTR_SWITCH_INFO:
+               return "switch info";
+       case UMAD_SMP_ATTR_GUID_INFO:
+               return "GUID info";
+       case UMAD_SMP_ATTR_PORT_INFO:
+               return "port info";
+       case UMAD_SMP_ATTR_PKEY_TABLE:
+               return "pkey table";
+       case UMAD_SMP_ATTR_SLVL_TABLE:
+               return "SL to VL table";
+       case UMAD_SMP_ATTR_VL_ARB_TABLE:
+               return "VL arbitration table";
+       case UMAD_SMP_ATTR_LINEAR_FT:
+               return "linear forwarding table";
+       case UMAD_SMP_ATTR_RANDOM_FT:
+               return "random forward table";
+       case UMAD_SMP_ATTR_MCAST_FT:
+               return "multicast forward table";
+       case UMAD_SMP_ATTR_SM_INFO:
+               return "SM info";
+       case UMAD_SMP_ATTR_VENDOR_DIAG:
+               return "vendor diags";
+       case UMAD_SMP_ATTR_LED_INFO:
+               return "LED info";
+       default:
+               return "Unknown";
+       }
+}
+
+static void print_data(char *msg, uint8_t *data, int size)
+{
+       int i;
+
+       for (i = 0; i < size; i++) {
+               if (i % 16 == 0)
+                       printf("%s", msg);
+               printf("%.2x ", data[i]);
+               if ((i < size - 1) && (i % 16 == 15))
+                       printf("\n");
+       }
+       printf("\n");
+}
+
+static void print_smp(struct umad_smp *smp)
+{
+       printf("MAD version....0x%01x\n", smp->base_version);
+       printf("Class..........0x%01x (%s)\n", smp->mgmt_class,
+              get_class_name(smp->mgmt_class));
+       printf("Class version..0x%01x\n", smp->class_version);
+       printf("Method.........0x%01x (%s)\n", smp->method,
+              get_method_name(smp->mgmt_class, smp->method));
+       printf("Status.........0x%02x\n", ntohs(smp->status));
+       if (smp->status)
+               print_status_details(ntohs(smp->status));
+       printf("Hop pointer...0x%01x\n", smp->hop_ptr);
+       printf("Hop counter...0x%01x\n", smp->hop_cnt);
+       printf("Trans ID.......0x%llx\n", (unsigned long long) ntohll(smp->tid));
+       printf("Attr ID........0x%02x (%s)\n", ntohs(smp->attr_id),
+               get_smp_attr(ntohs(smp->attr_id)));
+       printf("Attr modifier..0x%04x\n", ntohl(smp->attr_mod));
+
+       printf("Mkey...........0x%llx\n",
+              (unsigned long long) ntohll(*(uint64_t *) smp->mkey));
+       printf("DR SLID........0x%02x\n", ntohs(smp->dr_slid));
+       printf("DR DLID........0x%02x\n", ntohs(smp->dr_dlid));
+
+       if (verbose) {
+               print_data("SMP data.......", smp->data, UMAD_LEN_SMP_DATA);
+               print_data("Initial path...", smp->initial_path,
+                          UMAD_SMP_MAX_HOPS);
+               print_data("Return path....", smp->return_path,
+                          UMAD_SMP_MAX_HOPS);
+       }
+}
+
+static void print_sa_hdr(struct umad_sa_packet *mad)
+{
+       printf("SM key.........0x%llx\n",
+              (unsigned long long) ntohll(*(uint64_t *) mad->sm_key));
+       printf("Attr offset....0x%02x\n", ntohs(mad->attr_offset));
+       printf("Comp mask......0x%llx\n",
+              (unsigned long long) ntohll(mad->comp_mask));
+}
+
+static int is_rmpp_mad(uint8_t mgmt_class)
+{
+       return ((mgmt_class == UMAD_CLASS_SUBN_ADM) ||
+               ((mgmt_class >= UMAD_CLASS_VENDOR_RANGE2_START) &&
+                (mgmt_class <= UMAD_CLASS_VENDOR_RANGE2_END)) ||
+               (mgmt_class == UMAD_CLASS_DEVICE_MGMT) ||
+               (mgmt_class == UMAD_CLASS_DEVICE_ADM) ||
+               (mgmt_class == UMAD_CLASS_BIS));
+}
+
+static void print_gmp(struct umad_hdr *hdr)
+{
+       print_mad_hdr(hdr);
+
+       if (is_rmpp_mad(hdr->mgmt_class))
+               print_rmpp_hdr(&((struct umad_rmpp_packet *) hdr)->rmpp_hdr);
+
+       if (!verbose)
+               return;
+
+       if (hdr->mgmt_class == UMAD_CLASS_SUBN_ADM) {
+               struct umad_sa_packet *sa_mad = (struct umad_sa_packet *) hdr;
+               print_sa_hdr(sa_mad);
+               print_data("SA data........", sa_mad->data,
+                          UMAD_LEN_SA_DATA);
+       } else if ((hdr->mgmt_class >= UMAD_CLASS_VENDOR_RANGE2_START) &&
+                  (hdr->mgmt_class <= UMAD_CLASS_VENDOR_RANGE2_END)) {
+               struct umad_vendor_packet *vendor_mad = (struct umad_vendor_packet *) hdr;
+               printf("Vendor OUI......%01x %01x %01x\n",
+                       vendor_mad->oui[0],
+                       vendor_mad->oui[1],
+                       vendor_mad->oui[2]);
+               print_data("Vendor data....", vendor_mad->data,
+                          UMAD_LEN_VENDOR_DATA);
+       } else if (is_rmpp_mad(hdr->mgmt_class)) {
+               print_data("RMPP data....", ((struct umad_rmpp_packet *) hdr)->data,
+                          UMAD_LEN_RMPP_DATA);
+       } else {
+               print_data("MAD data.......", ((struct umad_packet *) hdr)->data, UMAD_LEN_DATA);
+       }
+}
+
+static void print_mad(struct mad_info *umad)
+{
+       struct umad_hdr *hdr;
+
+       umad_addr_dump(&umad->user_mad.addr);
+       hdr = (struct umad_hdr *) umad->data;
+
+       if (hdr->mgmt_class == UMAD_CLASS_SUBN_LID_ROUTED ||
+           hdr->mgmt_class == UMAD_CLASS_SUBN_DIRECTED_ROUTE)
+               print_smp((struct umad_smp *) hdr);
+       else
+               print_gmp(hdr);
+}
+
+static int run(void)
+{
+       int port_id, agent;
+       struct mad_info umad;
+       int ret, len;
+
+       port_id = umad_open_port(ca, port);
+       if (port_id < 0) {
+               printf("umad_open_port %s\n", strerror(-port_id));
+               return 1;
+       }
+
+       agent = umad_register_snoop(port_id, &filter, sizeof filter);
+       if (agent < 0) {
+               printf("umad_register_snoop %s\n", strerror(-agent));
+               ret = -agent;
+               goto close;
+       }
+
+       while (1) {
+               len = sizeof umad;
+               ret = umad_recv(port_id, &umad, &len, -1);
+               if (ret < 0) {
+                       printf("umad_recv %s\n", strerror(-ret));
+                       break;
+               }
+
+               print_mad(&umad);
+       }
+
+       umad_unregister(port_id, agent);
+close:
+       umad_close_port(port_id);
+       return ret;
+}
+
+static void show_usage(char *name)
+{
+       printf("Usage: %s        capture and display IB MAD traffic\n\n", name);
+       printf("Options:\n");
+       printf("  -C, --Ca=<ca_name>\n");
+       printf("  -P, --Port=<port_number>\n");
+       printf("  -c, --class=<management_class>\n");
+       printf("  -n, --class_version=<class_version>\n");
+       printf("  -a, --attr=<attribute_id>\n");
+       printf("  -e, --errors        (capture only MADs which complete in error)\n");
+       printf("  -o, --oui=<oui>\n");
+       printf("  -h, --help\n");
+       printf("  -v, --verbose       (display MAD data)\n");
+}
+
+int main(int argc, char *argv[])
+{
+       int val;
+
+       while (1) {
+               int c;
+               static struct option long_options[] = {
+                       {.name = "Ca",      .has_arg = 1, .val = 'C'},
+                       {.name = "Port",    .has_arg = 1, .val = 'P'},
+                       {.name = "class",   .has_arg = 1, .val = 'c'},
+                       {.name = "class_version", .has_arg = 1, .val = 'n'},
+                       {.name = "attr",    .has_arg = 1, .val = 'a'},
+                       {.name = "errors",  .has_arg = 0, .val = 'e'},
+                       {.name = "oui",     .has_arg = 1, .val = 'o'},
+                       {.name = "help",    .has_arg = 0, .val = 'h'},
+                       {.name = "verbose", .has_arg = 0, .val = 'v'},
+                       {0, 0, 0, 0}
+               };
+
+               c = getopt_long(argc, argv, "C:P:c:n:a:eo:hv", long_options, NULL);
+               if (c == -1)
+                       break;
+
+               switch (c) {
+               case 'C':
+                       ca = optarg;
+                       break;
+               case 'P':
+                       port = (uint8_t) strtoul(optarg, 0, 0);
+                       break;
+               case 'c':
+                       filter.mgmt_class = (uint8_t) strtoul(optarg, 0, 0);
+                       break;
+               case 'n':
+                       filter.mgmt_version = (uint8_t) strtoul(optarg, 0, 0);
+                       break;
+               case 'a':
+                       filter.attr_id = (uint16_t) strtoul(optarg, 0, 0);
+                       break;
+               case 'e':
+                       filter.errors = 1;
+               case 'o':
+                       val = strtoul(optarg, 0, 0);
+                       filter.oui[0] = (uint8_t) (val >> 16);
+                       filter.oui[1] = (uint8_t) (val >> 8);
+                       filter.oui[2] = (uint8_t) val;
+                       break;
+               case 'v':
+                       verbose = 1;
+                       break;
+               default:
+                       show_usage(argv[0]);
+                       exit(1);
+               }
+       }
+
+       val = run();
+       return val;
+}


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [RFC 2/12] ib-mgmt: provide MAD definitions with libibumad
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-10-23 19:06       ` Jason Gunthorpe
       [not found]         ` <20101023190601.GA10883-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Jason Gunthorpe @ 2010-10-23 19:06 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky,
	Hal Rosenstock, Ira Weiny

On Sat, Oct 23, 2010 at 12:00:59AM -0700, Hefty, Sean wrote:
> The only definitions for MAD data types are in ib_types.h, which
> is an opensm file.  The libibumad interface is essentially useless
> without these data types.  Add new header files to libibumad
> with basic MAD data types.

This is nice, lots of work! Wow!

> +/* Management base version */
> +#define UMAD_BASE_VERSION		1

Could you elaborate in the comment what you see this being used for?

> +struct umad_hdr {

Could we agree on a naming scheme? I was thinking umad_hdr_NE or
somesuch to identify these all as network endian. It is actually
pretty confusing in someplaces what is what. Ie for instance the
ibv_sa_path_rec is unpacked but in network endian, while things
like ibv_ah_attrs are in host endian. I've made errors getting this
right before (partly because there are no docs..)

> +#define	UMAD_OPENIB_OUI		(0x001405)

Enum?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC 3/12] ib-mgmt: add SA MAD definitions to umad
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F2-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-10-23 19:08       ` Jason Gunthorpe
  0 siblings, 0 replies; 18+ messages in thread
From: Jason Gunthorpe @ 2010-10-23 19:08 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky,
	Hal Rosenstock, Ira Weiny

On Sat, Oct 23, 2010 at 12:02:11AM -0700, Hefty, Sean wrote:

> +struct umad_sa_packet {
> +	struct umad_hdr		mad_hdr;
> +	struct umad_rmpp_hdr	rmpp_hdr;
> +	uint8_t			sm_key[8];

I would like to see a umad64_ne_t type for these 64 bit quanties.
It can be 2 32 bit words inside, and hton64xx varients to read/write them.

Ditto for 128 bit quantities, and accessors to/from ibv_gid_t.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC 11/12] ib-mgmt: move ntohll/htonll from mad.h to umad.h
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7FB-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-10-23 19:12       ` Jason Gunthorpe
  0 siblings, 0 replies; 18+ messages in thread
From: Jason Gunthorpe @ 2010-10-23 19:12 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky,
	Hal Rosenstock, Ira Weiny

On Sat, Oct 23, 2010 at 12:12:58AM -0700, Hefty, Sean wrote:

> +#if __BYTE_ORDER == __LITTLE_ENDIAN
> +  #ifndef ntohll
> +    #define ntohll(x) bswap_64(x)
> +  #endif
> +#elif __BYTE_ORDER == __BIG_ENDIAN
> +  #ifndef ntohll
> +    #define ntohll(x) (x)
> +  #endif
> +#endif
> +#ifndef htonll
> +  #define htonll ntohll
> +#endif
> +

The inline verions of these had the advantage that they enforce the
type, particularly on BE systems, it is a nice check to have..

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: [RFC 2/12] ib-mgmt: provide MAD definitions with libibumad
       [not found]         ` <20101023190601.GA10883-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2010-10-24  2:01           ` Hefty, Sean
  0 siblings, 0 replies; 18+ messages in thread
From: Hefty, Sean @ 2010-10-24  2:01 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky,
	Hal Rosenstock, Ira Weiny

> > +/* Management base version */
> > +#define UMAD_BASE_VERSION		1
> 
> Could you elaborate in the comment what you see this being used for?

The comment should just go.  This is copy-paste from the kernel headers.

> > +struct umad_hdr {
> 
> Could we agree on a naming scheme? I was thinking umad_hdr_NE or
> somesuch to identify these all as network endian. It is actually
> pretty confusing in someplaces what is what. Ie for instance the
> ibv_sa_path_rec is unpacked but in network endian, while things
> like ibv_ah_attrs are in host endian. I've made errors getting this
> right before (partly because there are no docs..)

maybe we should define net16/be16, etc. data types, similar to the kernel and ib_types?

> > +#define	UMAD_OPENIB_OUI		(0x001405)
> 
> Enum?

sure - unless someone can think of a reason why that wouldn't work
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC 4/12] ib-mgmt: Add basic SM definitions to umad
       [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F3-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-10-24  2:27       ` Jason Gunthorpe
  0 siblings, 0 replies; 18+ messages in thread
From: Jason Gunthorpe @ 2010-10-24  2:27 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Sasha Khapyorsky,
	Hal Rosenstock, Ira Weiny

On Sat, Oct 23, 2010 at 12:03:18AM -0700, Hefty, Sean wrote:

> +struct umad_smp {
> +	uint8_t	 base_version;
> +	uint8_t	 mgmt_class;
> +	uint8_t	 class_version;
> +	uint8_t	 method;
> +	uint16_t status;
> +	uint8_t  hop_ptr;
> +	uint8_t  hop_cnt;
> +	uint64_t tid;
> +	uint16_t attr_id;
> +	uint16_t resv;
> +	uint32_t attr_mod;
> +	uint64_t mkey;

These uint64_t's should also be the special 64 bit type I mentioned
before. The problem here is that uint64_t increases the alignment
requirement of the struct to 8, while its natural place, in say, an IB
packet (LRH+BTH+DETH+SMP) only has an alignment of 4.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-10-24  2:27 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-23  6:48 [RFC 0/12] ib-mgmt: port madeye to user space Hefty, Sean
     [not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7EE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-23  6:51   ` [RFC 1/12] IB/mgmt: Add API to register for MAD snooping Hefty, Sean
2010-10-23  7:00   ` [RFC 2/12] ib-mgmt: provide MAD definitions with libibumad Hefty, Sean
     [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F1-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-23 19:06       ` Jason Gunthorpe
     [not found]         ` <20101023190601.GA10883-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2010-10-24  2:01           ` Hefty, Sean
2010-10-23  7:02   ` [RFC 3/12] ib-mgmt: add SA MAD definitions to umad Hefty, Sean
     [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F2-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-23 19:08       ` Jason Gunthorpe
2010-10-23  7:03   ` [RFC 4/12] ib-mgmt: Add basic SM " Hefty, Sean
     [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7F3-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-24  2:27       ` Jason Gunthorpe
2010-10-23  7:04   ` [RFC 5/12]ib-mgmt: add CM " Hefty, Sean
2010-10-23  7:06   ` [RFC 6/12] ib-mgmt: add new umad header files to release Hefty, Sean
2010-10-23  7:07   ` [RFC 7/12] ib-mgmt: update mad.h to use umad_types.h Hefty, Sean
2010-10-23  7:09   ` [RFC 8/12] ib-mgmt: fix trace table response Hefty, Sean
2010-10-23  7:10   ` [RFC 9/12] ib-mgmt: convert ib_types.h to use umad types Hefty, Sean
2010-10-23  7:11   ` [RFC 10/12] ib-mgmt: remove duplicate definition of IB_MAD_STATUS_CLASS_MASK Hefty, Sean
2010-10-23  7:12   ` [RFC 11/12] ib-mgmt: move ntohll/htonll from mad.h to umad.h Hefty, Sean
     [not found]     ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25B809B7FB-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-10-23 19:12       ` Jason Gunthorpe
2010-10-23  7:17   ` [RFC 12/12] ib-mgmt/diags: add utility to display snooped mads Hefty, Sean

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.