Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Oct 2010 22:59:18 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r213999 - in projects/ofed/head/contrib/ofed: include include/infiniband include/rdma libibcm/include/infiniband libibcm/src libibverbs/include/infiniband librdmacm/src usr.lib usr.lib/...
Message-ID:  <201010172259.o9HMxIwu049485@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Sun Oct 17 22:59:18 2010
New Revision: 213999
URL: http://svn.freebsd.org/changeset/base/213999

Log:
   - bmake the builds for ibcm and rdmacm.
   - Do some minor porting required for ENODATA.
   - Add an infiniband/types.h and infiniband/byteorder.h to be used in
     place of linux/types.h and linux/byteorder.h for userland code.  Anyone
     porting rdma/verbs apps over from linux will have to adjust to these
     header locations unless we want to add a /usr/include/linux and
     /usr/include/asm for compatibility.  Note this is all ABI compatible.
  
  Sponsored by:	Isilon Systems, iX Systems, and Panasas.

Added:
  projects/ofed/head/contrib/ofed/include/infiniband/byteorder.h
  projects/ofed/head/contrib/ofed/include/infiniband/types.h
  projects/ofed/head/contrib/ofed/include/rdma/
  projects/ofed/head/contrib/ofed/include/rdma/Makefile
  projects/ofed/head/contrib/ofed/usr.lib/libibcm/
  projects/ofed/head/contrib/ofed/usr.lib/libibcm/Makefile
  projects/ofed/head/contrib/ofed/usr.lib/librdmacm/
  projects/ofed/head/contrib/ofed/usr.lib/librdmacm/Makefile
Modified:
  projects/ofed/head/contrib/ofed/include/Makefile
  projects/ofed/head/contrib/ofed/include/infiniband/Makefile
  projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm.h
  projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm_abi.h
  projects/ofed/head/contrib/ofed/libibcm/src/cm.c
  projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/kern-abi.h
  projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/sa-kern-abi.h
  projects/ofed/head/contrib/ofed/librdmacm/src/cma.c
  projects/ofed/head/contrib/ofed/usr.lib/Makefile

Modified: projects/ofed/head/contrib/ofed/include/Makefile
==============================================================================
--- projects/ofed/head/contrib/ofed/include/Makefile	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/include/Makefile	Sun Oct 17 22:59:18 2010	(r213999)
@@ -1,5 +1,5 @@
 .include <bsd.own.mk>
 
-SUBDIR	= infiniband
+SUBDIR	= infiniband rdma
 
 .include <bsd.subdir.mk>

Modified: projects/ofed/head/contrib/ofed/include/infiniband/Makefile
==============================================================================
--- projects/ofed/head/contrib/ofed/include/infiniband/Makefile	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/include/infiniband/Makefile	Sun Oct 17 22:59:18 2010	(r213999)
@@ -1,6 +1,9 @@
 .include <bsd.own.mk>
 
 INCS=
+IBINCS=		types.h byteorder.h
+IBINCSDIR=	${INCLUDEDIR}/infiniband
+
 IBVERBS=	../../libibverbs/include/infiniband
 VERBINCS=	${IBVERBS}/arch.h ${IBVERBS}/driver.h ${IBVERBS}/kern-abi.h
 VERBINCS+=	${IBVERBS}/marshall.h ${IBVERBS}/opcode.h
@@ -94,7 +97,11 @@ VENDORINCS+=	${VENDOR}/osm_vendor_test.h
 VENDORINCS+=	${VENDOR}/osm_vendor_umadt.h
 VENDORINCSDIR=	${INCLUDEDIR}/infiniband/vendor
 
+IBCM=		../../libibcm/include/infiniband
+IBCMINCS=	${IBCM}/cm.h ${IBCM}/cm_abi.h
+IBCMINCSDIR=	${INCLUDEDIR}/infiniband
+
 INCSGROUPS=	INCS VERBINCS COMMONINCS MADINCS UMADINCS COMPLIBINCS IBAINCS
-INCSGROUPS+=	OPENSMINCS VENDORINCS
+INCSGROUPS+=	OPENSMINCS VENDORINCS IBCMINCS
 
 .include <bsd.prog.mk>

Added: projects/ofed/head/contrib/ofed/include/infiniband/byteorder.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/ofed/head/contrib/ofed/include/infiniband/byteorder.h	Sun Oct 17 22:59:18 2010	(r213999)
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2010 Isilon Systems, Inc.
+ * Copyright (c) 2010 iX Systems, Inc.
+ * Copyright (c) 2010 Panasas, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef	_INFINIBAND_BYTEORDER_H_
+#define	_INFINIBAND_BYTEORDER_H_
+
+#include <sys/types.h>
+#include <sys/endian.h>
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define	__LITTLE_ENDIAN
+#else
+#define	__BIG_ENDIAN
+#endif
+
+#define	cpu_to_le64	htole64
+#define	le64_to_cpu	le64toh
+#define	cpu_to_le32	htole32
+#define	le32_to_cpu	le32toh
+#define	cpu_to_le16	htole16
+#define	le16_to_cpu	le16toh
+#define	cpu_to_be64	htobe64
+#define	be64_to_cpu	be64toh
+#define	cpu_to_be32	htobe32
+#define	be32_to_cpu	be32toh
+#define	cpu_to_be16	htobe16
+#define	be16_to_cpu	be16toh
+#define	__be16_to_cpu	be16toh
+
+#define	cpu_to_le64p(x)	htole64(*((uint64_t *)x))
+#define	le64_to_cpup(x)	le64toh(*((uint64_t *)x))
+#define	cpu_to_le32p(x)	htole32(*((uint32_t *)x))
+#define	le32_to_cpup(x)	le32toh(*((uint32_t *)x))
+#define	cpu_to_le16p(x)	htole16(*((uint16_t *)x))
+#define	le16_to_cpup(x)	le16toh(*((uint16_t *)x))
+#define	cpu_to_be64p(x)	htobe64(*((uint64_t *)x))
+#define	be64_to_cpup(x)	be64toh(*((uint64_t *)x))
+#define	cpu_to_be32p(x)	htobe32(*((uint32_t *)x))
+#define	be32_to_cpup(x)	be32toh(*((uint32_t *)x))
+#define	cpu_to_be16p(x)	htobe16(*((uint16_t *)x))
+#define	be16_to_cpup(x)	be16toh(*((uint16_t *)x))
+
+#define	cpu_to_le64s(x)	do { *((uint64_t *)x) = cpu_to_le64p((x)) } while (0)
+#define	le64_to_cpus(x)	do { *((uint64_t *)x) = le64_to_cpup((x)) } while (0)
+#define	cpu_to_le32s(x)	do { *((uint32_t *)x) = cpu_to_le32p((x)) } while (0)
+#define	le32_to_cpus(x)	do { *((uint32_t *)x) = le32_to_cpup((x)) } while (0)
+#define	cpu_to_le16s(x)	do { *((uint16_t *)x) = cpu_to_le16p((x)) } while (0)
+#define	le16_to_cpus(x)	do { *((uint16_t *)x) = le16_to_cpup((x)) } while (0)
+#define	cpu_to_be64s(x)	do { *((uint64_t *)x) = cpu_to_be64p((x)) } while (0)
+#define	be64_to_cpus(x)	do { *((uint64_t *)x) = be64_to_cpup((x)) } while (0)
+#define	cpu_to_be32s(x)	do { *((uint32_t *)x) = cpu_to_be32p((x)) } while (0)
+#define	be32_to_cpus(x)	do { *((uint32_t *)x) = be32_to_cpup((x)) } while (0)
+#define	cpu_to_be16s(x)	do { *((uint16_t *)x) = cpu_to_be16p((x)) } while (0)
+#define	be16_to_cpus(x)	do { *((uint16_t *)x) = be16_to_cpup((x)) } while (0)
+
+#define	swab16	bswap16
+#define	swab32	bswap32
+#define	swab64	bswap64
+
+#endif	/* _INFINIBAND_BYTEORDER_H_ */

Added: projects/ofed/head/contrib/ofed/include/infiniband/types.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/ofed/head/contrib/ofed/include/infiniband/types.h	Sun Oct 17 22:59:18 2010	(r213999)
@@ -0,0 +1,63 @@
+/*-
+ * Copyright (c) 2010 Isilon Systems, Inc.
+ * Copyright (c) 2010 iX Systems, Inc.
+ * Copyright (c) 2010 Panasas, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef	_INFINIBAND_TYPES_H_
+#define	_INFINIBAND_TYPES_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+typedef int8_t s8;
+typedef uint8_t u8;
+typedef int8_t __s8;
+typedef uint8_t __u8;
+
+typedef int16_t s16;
+typedef uint16_t u16;
+typedef int16_t __s16;
+typedef uint16_t __u16;
+
+typedef int32_t s32;
+typedef uint32_t u32;
+typedef int32_t __s32;
+typedef uint32_t __u32;
+
+typedef int64_t s64;
+typedef uint64_t u64;
+typedef int64_t __s64;
+typedef uint64_t __u64;
+
+typedef uint16_t __le16;
+typedef uint16_t __be16;
+typedef uint32_t __le32;
+typedef uint32_t __be32;
+typedef uint64_t __le64;
+typedef uint64_t __be64;
+
+typedef unsigned int    uint;
+
+#endif	/* _INFINIBAND_TYPES_H_ */

Added: projects/ofed/head/contrib/ofed/include/rdma/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/ofed/head/contrib/ofed/include/rdma/Makefile	Sun Oct 17 22:59:18 2010	(r213999)
@@ -0,0 +1,10 @@
+.include <bsd.own.mk>
+
+INCS=
+RDMACM=		../../librdmacm/include/rdma
+RDMACMINCS=	${RDMACM}/rdma_cma.h ${RDMACM}/rdma_cma_abi.h
+RDMACMINCSDIR=	${INCLUDEDIR}/rdma
+
+INCSGROUPS=	RDMACMINCS
+
+.include <bsd.prog.mk>

Modified: projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm.h
==============================================================================
--- projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm.h	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm.h	Sun Oct 17 22:59:18 2010	(r213999)
@@ -38,7 +38,7 @@
 
 #include <infiniband/verbs.h>
 #include <infiniband/sa.h>
-#include <asm/byteorder.h>
+#include <infiniband/byteorder.h>
 
 #ifdef __cplusplus
 extern "C" {

Modified: projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm_abi.h
==============================================================================
--- projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm_abi.h	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/libibcm/include/infiniband/cm_abi.h	Sun Oct 17 22:59:18 2010	(r213999)
@@ -36,7 +36,7 @@
 #ifndef CM_ABI_H
 #define CM_ABI_H
 
-#include <linux/types.h>
+#include <infiniband/types.h>
 #include <infiniband/sa.h>
 #include <infiniband/marshall.h>
 

Modified: projects/ofed/head/contrib/ofed/libibcm/src/cm.c
==============================================================================
--- projects/ofed/head/contrib/ofed/libibcm/src/cm.c	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/libibcm/src/cm.c	Sun Oct 17 22:59:18 2010	(r213999)
@@ -300,7 +300,7 @@ int ib_cm_destroy_id(struct ib_cm_id *cm
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
@@ -331,7 +331,7 @@ int ib_cm_attr_id(struct ib_cm_id *cm_id
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
@@ -361,7 +361,7 @@ int ib_cm_init_qp_attr(struct ib_cm_id *
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : result;
+		return (result >= 0) ? ERR(ECONNREFUSED) : result;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
@@ -387,7 +387,7 @@ int ib_cm_listen(struct ib_cm_id *cm_id,
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -446,7 +446,7 @@ int ib_cm_send_req(struct ib_cm_id *cm_i
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -481,7 +481,7 @@ int ib_cm_send_rep(struct ib_cm_id *cm_i
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -506,7 +506,7 @@ static inline int cm_send_private_data(s
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -547,7 +547,7 @@ static int cm_establish(struct ib_cm_id 
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -572,7 +572,7 @@ int ib_cm_notify(struct ib_cm_id *cm_id,
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -606,7 +606,7 @@ static inline int cm_send_status(struct 
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -656,7 +656,7 @@ int ib_cm_send_mra(struct ib_cm_id *cm_i
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : result;
+		return (result >= 0) ? ERR(ECONNREFUSED) : result;
 
 	return 0;
 }
@@ -691,7 +691,7 @@ int ib_cm_send_lap(struct ib_cm_id *cm_i
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -731,7 +731,7 @@ int ib_cm_send_sidr_req(struct ib_cm_id 
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : result;
+		return (result >= 0) ? ERR(ECONNREFUSED) : result;
 
 	return 0;
 }
@@ -765,7 +765,7 @@ int ib_cm_send_sidr_rep(struct ib_cm_id 
 
 	result = write(cm_id->device->fd, msg, size);
 	if (result != size)
-		return (result >= 0) ? ERR(ENODATA) : -1;
+		return (result >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -875,7 +875,7 @@ int ib_cm_get_event(struct ib_cm_device 
 
 	result = write(device->fd, msg, size);
 	if (result != size) {
-		result = (result >= 0) ? ERR(ENODATA) : -1;
+		result = (result >= 0) ? ERR(ECONNREFUSED) : -1;
 		goto done;
 	}
 

Modified: projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/kern-abi.h
==============================================================================
--- projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/kern-abi.h	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/kern-abi.h	Sun Oct 17 22:59:18 2010	(r213999)
@@ -35,7 +35,7 @@
 #ifndef KERN_ABI_H
 #define KERN_ABI_H
 
-#include <linux/types.h>
+#include <infiniband/types.h>
 
 /*
  * This file must be kept in sync with the kernel's version of

Modified: projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/sa-kern-abi.h
==============================================================================
--- projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/sa-kern-abi.h	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/libibverbs/include/infiniband/sa-kern-abi.h	Sun Oct 17 22:59:18 2010	(r213999)
@@ -33,7 +33,7 @@
 #ifndef INFINIBAND_SA_KERN_ABI_H
 #define INFINIBAND_SA_KERN_ABI_H
 
-#include <linux/types.h>
+#include <infiniband/types.h>
 
 /*
  * Obsolete, deprecated names.  Will be removed in libibverbs 1.1.

Modified: projects/ofed/head/contrib/ofed/librdmacm/src/cma.c
==============================================================================
--- projects/ofed/head/contrib/ofed/librdmacm/src/cma.c	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/librdmacm/src/cma.c	Sun Oct 17 22:59:18 2010	(r213999)
@@ -432,7 +432,7 @@ static int ucma_destroy_kern_id(int fd, 
 
 	ret = write(fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
@@ -487,7 +487,7 @@ static int ucma_query_route(struct rdma_
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
@@ -541,7 +541,7 @@ int rdma_bind_addr(struct rdma_cm_id *id
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return ucma_query_route(id);
 }
@@ -568,7 +568,7 @@ int rdma_resolve_addr(struct rdma_cm_id 
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	memcpy(&id->route.addr.dst_addr, dst_addr, daddrlen);
 	return 0;
@@ -588,7 +588,7 @@ int rdma_resolve_route(struct rdma_cm_id
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -614,7 +614,7 @@ static int rdma_init_qp_attr(struct rdma
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 
@@ -889,7 +889,7 @@ int rdma_connect(struct rdma_cm_id *id, 
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -908,7 +908,7 @@ int rdma_listen(struct rdma_cm_id *id, i
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return ucma_query_route(id);
 }
@@ -946,7 +946,7 @@ int rdma_accept(struct rdma_cm_id *id, s
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size) {
 		ucma_modify_qp_err(id);
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 	}
 
 	return 0;
@@ -972,7 +972,7 @@ int rdma_reject(struct rdma_cm_id *id, c
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -991,7 +991,7 @@ int rdma_notify(struct rdma_cm_id *id, e
 	cmd->event = event;
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -1022,7 +1022,7 @@ int rdma_disconnect(struct rdma_cm_id *i
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -1067,7 +1067,7 @@ int rdma_join_multicast(struct rdma_cm_i
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size) {
-		ret = (ret >= 0) ? ERR(ENODATA) : -1;
+		ret = (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 		goto err2;
 	}
 
@@ -1120,7 +1120,7 @@ int rdma_leave_multicast(struct rdma_cm_
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size) {
-		ret = (ret >= 0) ? ERR(ENODATA) : -1;
+		ret = (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 		goto free;
 	}
 
@@ -1221,7 +1221,7 @@ static int ucma_process_conn_resp(struct
 
 	ret = write(id_priv->id.channel->fd, msg, size);
 	if (ret != size) {
-		ret = (ret >= 0) ? ERR(ENODATA) : -1;
+		ret = (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 		goto err;
 	}
 
@@ -1318,7 +1318,7 @@ retry:
 	ret = write(channel->fd, msg, size);
 	if (ret != size) {
 		free(evt);
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 	}
 	
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
@@ -1477,7 +1477,7 @@ int rdma_set_option(struct rdma_cm_id *i
 
 	ret = write(id->channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	return 0;
 }
@@ -1497,7 +1497,7 @@ int rdma_migrate_id(struct rdma_cm_id *i
 
 	ret = write(channel->fd, msg, size);
 	if (ret != size)
-		return (ret >= 0) ? ERR(ENODATA) : -1;
+		return (ret >= 0) ? ERR(ECONNREFUSED) : -1;
 
 	VALGRIND_MAKE_MEM_DEFINED(resp, sizeof *resp);
 

Modified: projects/ofed/head/contrib/ofed/usr.lib/Makefile
==============================================================================
--- projects/ofed/head/contrib/ofed/usr.lib/Makefile	Sun Oct 17 22:10:33 2010	(r213998)
+++ projects/ofed/head/contrib/ofed/usr.lib/Makefile	Sun Oct 17 22:59:18 2010	(r213999)
@@ -1,6 +1,6 @@
 .include <bsd.own.mk>
 
 SUBDIR	= libibcommon libibmad libibumad libibverbs libmlx4 libmthca
-SUBDIR	+= libopensm libosmcomp libosmvendor
+SUBDIR	+= libopensm libosmcomp libosmvendor libibcm librdmacm
 
 .include <bsd.subdir.mk>

Added: projects/ofed/head/contrib/ofed/usr.lib/libibcm/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/ofed/head/contrib/ofed/usr.lib/libibcm/Makefile	Sun Oct 17 22:59:18 2010	(r213999)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+
+SHLIBDIR?=	/usr/lib
+
+.include <bsd.own.mk>
+
+IBCMDIR= 	../../libibcm
+IBSRCDIR=	${IBCMDIR}/src
+
+.PATH: ${IBSRCDIR}
+
+LIB=		ibcm
+SHLIB_MAJOR=	1
+NO_PROFILE=
+
+SRCS= cm.c
+
+MAN=
+VERSION_MAP= ${IBSRCDIR}/libibcm.map
+
+.include <bsd.lib.mk>

Added: projects/ofed/head/contrib/ofed/usr.lib/librdmacm/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/ofed/head/contrib/ofed/usr.lib/librdmacm/Makefile	Sun Oct 17 22:59:18 2010	(r213999)
@@ -0,0 +1,34 @@
+# $FreeBSD$
+
+SHLIBDIR?=	/usr/lib
+
+.include <bsd.own.mk>
+
+RDMACMDIR= 	../../librdmacm
+RDMASRCDIR=	${RDMACMDIR}/src
+RDMAMANDIR=	${RDMACMDIR}/man
+
+.PATH: ${RDMASRCDIR} ${RDMAMANDIR}
+
+LIB=		rdmacm
+SHLIB_MAJOR=	1
+NO_PROFILE=
+
+SRCS= cma.c
+
+MAN=	rdma_get_devices.3 mckey.1 rdma_get_dst_port.3 rdma_accept.3
+MAN+=	rdma_get_local_addr.3 rdma_ack_cm_event.3 rdma_get_peer_addr.3
+MAN+=	rdma_bind_addr.3 rdma_get_src_port.3 rdma_cm.7 rdma_join_multicast.3
+MAN+=	rdma_connect.3 rdma_leave_multicast.3 rdma_create_event_channel.3
+MAN+=	rdma_listen.3 rdma_create_id.3 rdma_migrate_id.3 rdma_create_qp.3
+MAN+=	rdma_notify.3 rdma_destroy_event_channel.3 rdma_reject.3
+MAN+=	rdma_destroy_id.3 rdma_resolve_addr.3 rdma_destroy_qp.3
+MAN+=	rdma_resolve_route.3 rdma_disconnect.3 rdma_set_option.3
+MAN+=	rdma_event_str.3 rping.1 rdma_free_devices.3 ucmatose.1
+MAN+=	rdma_get_cm_event.3 udaddy.1
+
+CFLAGS+=	-I../../../../sys/ofed/include
+
+VERSION_MAP= ${RDMASRCDIR}/librdmacm.map
+
+.include <bsd.lib.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010172259.o9HMxIwu049485>