[ofa-general] [PATCH] libibumad: keep port capmask as 32-bit variable

Sasha Khapyorsky sashak at voltaire.com
Fri May 1 12:47:26 PDT 2009


For unknown reason IB port capmask was defined as 64-bit unsigned. Which
caused some portability problems. Fixing this.

Pointed out by Nicolas Morey-Chaisemartin and Sean Hefty.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibumad/include/infiniband/umad.h |    2 +-
 libibumad/src/umad.c                |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libibumad/include/infiniband/umad.h b/libibumad/include/infiniband/umad.h
index 91ccf1d..78862c8 100644
--- a/libibumad/include/infiniband/umad.h
+++ b/libibumad/include/infiniband/umad.h
@@ -129,7 +129,7 @@ typedef struct umad_port {
 	unsigned state;
 	unsigned phys_state;
 	unsigned rate;
-	uint64_t capmask;
+	uint32_t capmask;
 	uint64_t gid_prefix;
 	uint64_t port_guid;
 	unsigned pkeys_size;
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
index 72ef506..deb3b9d 100644
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -160,7 +160,7 @@ get_port(char *ca_name, char *dir, int portnum, umad_port_t *port)
 		goto clean;
 	if (sys_read_uint(port_dir, SYS_PORT_RATE, &port->rate) < 0)
 		goto clean;
-	if (sys_read_uint64(port_dir, SYS_PORT_CAPMASK, &port->capmask) < 0)
+	if (sys_read_uint(port_dir, SYS_PORT_CAPMASK, &port->capmask) < 0)
 		goto clean;
 
 	port->capmask = htonl(port->capmask);
-- 
1.6.1.2.319.gbd9e




More information about the general mailing list