svn commit: r218004 - in projects/ofed/head/contrib/ofed/dapl:
dapl/openib_cma dapl/openib_cma/linux dapl/openib_scm
dapl/openib_scm/linux dapl/openib_ucm/linux dapl/udapl/linux
dat/include/dat2 da...
Jeff Roberson
jeff at FreeBSD.org
Fri Jan 28 02:12:43 UTC 2011
Author: jeff
Date: Fri Jan 28 02:12:43 2011
New Revision: 218004
URL: http://svn.freebsd.org/changeset/base/218004
Log:
- Port dapl include files to support freebsd.
Sponsored by: Isilon Systems, iX Systems, and Panasas.
Modified:
projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c
projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h
projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c
projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h
projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h
projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h
projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h
projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h
projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c
projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c
Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/device.c Fri Jan 28 02:12:43 2011 (r218004)
@@ -154,7 +154,9 @@ static int getipaddr_netdev(char *name,
/* Fill in the structure */
snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
+#ifndef __FreeBSD__
ifr.ifr_hwaddr.sa_family = ARPHRD_INFINIBAND;
+#endif
/* Create a socket fd */
skfd = socket(PF_INET, SOCK_STREAM, 0);
@@ -661,8 +663,8 @@ void dapli_thread(void *arg)
/* work thread for uAT, uCM, CQ, and async events */
void dapli_thread(void *arg)
{
- struct pollfd ufds[__FD_SETSIZE];
- struct _ib_hca_transport *uhca[__FD_SETSIZE] = { NULL };
+ struct pollfd ufds[FD_SETSIZE];
+ struct _ib_hca_transport *uhca[FD_SETSIZE] = { NULL };
struct _ib_hca_transport *hca;
int ret, idx, fds;
char rbuf[2];
Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_cma/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004)
@@ -1,7 +1,7 @@
#ifndef OPENIB_OSD_H
#define OPENIB_OSD_H
-#include <byteswap.h>
+#include <infiniband/byteswap.h>
#include <sys/poll.h>
#if __BYTE_ORDER == __BIG_ENDIAN
Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/device.c Fri Jan 28 02:12:43 2011 (r218004)
@@ -646,8 +646,8 @@ void dapli_thread(void *arg)
/* work thread for uAT, uCM, CQ, and async events */
void dapli_thread(void *arg)
{
- struct pollfd ufds[__FD_SETSIZE];
- struct _ib_hca_transport *uhca[__FD_SETSIZE] = { NULL };
+ struct pollfd ufds[FD_SETSIZE];
+ struct _ib_hca_transport *uhca[FD_SETSIZE] = { NULL };
struct _ib_hca_transport *hca;
int ret, idx, fds;
char rbuf[2];
Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_scm/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004)
@@ -1,7 +1,7 @@
#ifndef OPENIB_OSD_H
#define OPENIB_OSD_H
-#include <endian.h>
+#include <infiniband/endian.h>
#include <netinet/in.h>
#if __BYTE_ORDER == __BIG_ENDIAN
Modified: projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dapl/openib_ucm/linux/openib_osd.h Fri Jan 28 02:12:43 2011 (r218004)
@@ -1,7 +1,9 @@
#ifndef OPENIB_OSD_H
#define OPENIB_OSD_H
-#include <endian.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <infiniband/endian.h>
#include <netinet/in.h>
#if __BYTE_ORDER == __BIG_ENDIAN
Modified: projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dapl/udapl/linux/dapl_osd.h Fri Jan 28 02:12:43 2011 (r218004)
@@ -45,9 +45,9 @@
* This file is defined for Linux systems only, including it on any
* other build will cause an error
*/
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__FreeBSD__)
#error UNDEFINED OS TYPE
-#endif /* __linux__ */
+#endif /* __linux__ || __freebsd__ */
#if !defined (__i386__) && !defined (__ia64__) && !defined(__x86_64__) && !defined(__PPC__) && !defined(__PPC64__)
#error UNDEFINED ARCH
@@ -67,7 +67,7 @@
#include <sys/time.h>
#include <syslog.h>
#include <netdb.h> /* for getaddrinfo */
-#include <byteswap.h>
+#include <infiniband/byteswap.h>
#include <sys/ioctl.h> /* for IOCTL's */
Modified: projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dat/include/dat2/dat_platform_specific.h Fri Jan 28 02:12:43 2011 (r218004)
@@ -255,8 +255,46 @@ typedef PHYSICAL_ADDRESS DAT_PADDR;
#endif /* __KDAPL__ */
/* Windoze ends */
+#elif defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <stddef.h>
+#include <netinet/in.h>
+typedef u_int32_t DAT_UINT32; /* unsigned host order, 32 bits */
+typedef u_int64_t DAT_UINT64; /* unsigned host order, 64 bits */
+typedef unsigned long long DAT_UVERYLONG; /* unsigned longest native to compiler */
+
+typedef void * DAT_PVOID;
+typedef int DAT_COUNT;
+typedef DAT_UINT64 DAT_PADDR;
+
+#ifndef UINT64_C
+#define UINT64_C(c) c ## ULL
+#endif /* UINT64_C */
+
+#define DAT_IA_HANDLE_TO_UL(a) (unsigned long)(a)
+#define DAT_UL_TO_IA_HANDLE(a) (DAT_IA_HANDLE)(a)
+
+
+typedef struct dat_comm {
+ int domain;
+ int type;
+ int protocol;
+} DAT_COMM;
+
+typedef int DAT_FD; /* DAT File Descriptor */
+
+typedef struct sockaddr DAT_SOCK_ADDR; /* Socket address header native to OS */
+typedef struct sockaddr_in6 DAT_SOCK_ADDR6; /* Socket address header native to OS */
+#define DAT_AF_INET AF_INET
+#define DAT_AF_INET6 AF_INET6
+
+#define DAT_API
+#define DAT_EXPORT extern
+
+/* Linux ends */
#else
#error dat_platform_specific.h : OS type not defined
#endif
Modified: projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/dat/udat/linux/dat_osd.h Fri Jan 28 02:12:43 2011 (r218004)
@@ -48,9 +48,9 @@
* This file is defined for Linux systems only, including it on any
* other build will cause an error
*/
-#ifndef __linux__
+#if defined(__linux__) || defined(__freebsd__)
#error "UNDEFINED OS TYPE"
-#endif /* __linux__ */
+#endif /* __linux__ || FreeBSD */
#include <dat2/udat.h>
Modified: projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/test/dtest/dtest.c Fri Jan 28 02:12:43 2011 (r218004)
@@ -63,8 +63,8 @@
#else // _WIN32 || _WIN64
-#include <endian.h>
-#include <byteswap.h>
+#include <infiniband/endian.h>
+#include <infiniband/byteswap.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
Modified: projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c
==============================================================================
--- projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Fri Jan 28 02:11:41 2011 (r218003)
+++ projects/ofed/head/contrib/ofed/dapl/test/dtest/dtestcm.c Fri Jan 28 02:12:43 2011 (r218004)
@@ -64,8 +64,8 @@
#else // _WIN32 || _WIN64
-#include <endian.h>
-#include <byteswap.h>
+#include <infiniband/endian.h>
+#include <infiniband/byteswap.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
More information about the svn-src-projects
mailing list