[openib-general] [PATCH] cmpost: allow cmpost to build with latest RDMA CM

Sean Hefty sean.hefty at intel.com
Tue Aug 15 09:10:31 PDT 2006


Can you see if this patch lets you build compost?

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
Index: examples/cmpost.c
===================================================================
--- examples/cmpost.c	(revision 8215)
+++ examples/cmpost.c	(working copy)
@@ -614,6 +614,7 @@ out:
 
 static int query_for_path(char *dst)
 {
+	struct rdma_event_channel *channel;
 	struct rdma_cm_id *id;
 	struct sockaddr_in addr_in;
 	struct rdma_cm_event *event;
@@ -623,15 +624,19 @@ static int query_for_path(char *dst)
 	if (ret)
 		return ret;
 
-	ret = rdma_create_id(&id, NULL);
+	channel = rdma_create_event_channel();
+	if (!channel)
+		return -1;
+
+	ret = rdma_create_id(channel, &id, NULL, RDMA_PS_TCP);
 	if (ret)
-		return ret;
+		goto destroy_channel;
 
 	ret = rdma_resolve_addr(id, NULL, (struct sockaddr *) &addr_in, 2000);
 	if (ret)
 		goto out;
 
-	ret = rdma_get_cm_event(&event);
+	ret = rdma_get_cm_event(channel, &event);
 	if (!ret && event->event != RDMA_CM_EVENT_ADDR_RESOLVED)
 		ret = event->status;
 	rdma_ack_cm_event(event);
@@ -642,7 +647,7 @@ static int query_for_path(char *dst)
 	if (ret)
 		goto out;
 
-	ret = rdma_get_cm_event(&event);
+	ret = rdma_get_cm_event(channel, &event);
 	if (!ret && event->event != RDMA_CM_EVENT_ROUTE_RESOLVED)
 		ret = event->status;
 	rdma_ack_cm_event(event);
@@ -652,6 +657,8 @@ static int query_for_path(char *dst)
 	test.path_rec = id->route.path_rec[0];
 out:
 	rdma_destroy_id(id);
+destroy_channel:
+	rdma_destroy_event_channel(channel);
 	return ret;
 }
 





More information about the general mailing list