[ofa-general] [PATCH librdmacm] rping: Transfer rkey/addr/len information in network byte order.

Steve Wise swise at opengridcomputing.com
Wed Apr 25 08:34:31 PDT 2007


Sean,

This patch enables rping between a BE and LE system.  Tested on IBM
PPC64 <-> AMD64.

Transfer rkey/addr/len information in network byte order.

Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---

 examples/rping.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/examples/rping.c b/examples/rping.c
index 0441300..17b0000 100644
--- a/examples/rping.c
+++ b/examples/rping.c
@@ -47,6 +47,7 @@ #include <pthread.h>
 #include <inttypes.h>
 
 #include <rdma/rdma_cma.h>
+#include <infiniband/arch.h>
 
 static int debug = 0;
 #define DEBUG_LOG if (debug) printf
@@ -239,9 +240,9 @@ static int server_recv(struct rping_cb *
 		return -1;
 	}
 
-	cb->remote_rkey = cb->recv_buf.rkey;
-	cb->remote_addr = cb->recv_buf.buf;
-	cb->remote_len  = cb->recv_buf.size;
+	cb->remote_rkey = ntohl(cb->recv_buf.rkey);
+	cb->remote_addr = ntohll(cb->recv_buf.buf);
+	cb->remote_len  = ntohl(cb->recv_buf.size);
 	DEBUG_LOG("Received rkey %x addr %" PRIx64 "len %d from peer\n",
 		  cb->remote_rkey, cb->remote_addr, cb->remote_len);
 




More information about the general mailing list