[rds-commits] zab commits r115 - trunk/linux/net/rds

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Tue Jun 27 18:02:47 CDT 2006


Author: zab
Date: 2006-06-27 18:02:46 -0500 (Tue, 27 Jun 2006)
New Revision: 115

Modified:
   trunk/linux/net/rds/ib.c
   trunk/linux/net/rds/ib_cm.c
   trunk/linux/net/rds/ib_recv.c
   trunk/linux/net/rds/ib_send.c
   trunk/linux/net/rds/rds.h
   trunk/linux/net/rds/transport.c
Log:
More minor RDS/IB progress.

Wire up the rds_ib __init and __exit paths.  Add rds_ib_transport to the
transports array so that new connections can try and use it.

Tear down the listening cm id with rdma_destroy_id(), not rdma_disconnect().

Change some remaining pr_debug calls to rdsdebug calls.




Modified: trunk/linux/net/rds/ib.c
===================================================================
--- trunk/linux/net/rds/ib.c	2006-06-27 18:02:36 UTC (rev 114)
+++ trunk/linux/net/rds/ib.c	2006-06-27 23:02:46 UTC (rev 115)
@@ -51,6 +51,8 @@
 	} else
 		ret = -EADDRNOTAVAIL;
 
+	rdsdebug("addr %u.%u.%u.%u ret %d\n", NIPQUAD(addr), ret);
+
 	return ret;
 }
 
@@ -80,14 +82,10 @@
 	if (ret)
 		goto out;
 
-//	ret = rds_ib_conn_init();
+	ret = rds_ib_recv_init();
 	if (ret)
 		goto out_send;
 
-	ret = rds_ib_recv_init();
-	if (ret)
-		goto out_conn;
-
 	ret = rds_ib_listen_init();
 	if (ret)
 		goto out_recv;
@@ -96,8 +94,6 @@
 
 out_recv:
 	rds_ib_recv_exit();
-out_conn:
-//	rds_ib_conn_exit();
 out_send:
 	rds_ib_send_exit();
 out:
@@ -109,8 +105,6 @@
  */
 void __exit rds_ib_exit(void)
 {
-//	rds_ib_listen_exit();
 	rds_ib_recv_exit();
-//	rds_ib_conn_exit();
 	rds_ib_send_exit();
 }

Modified: trunk/linux/net/rds/ib_cm.c
===================================================================
--- trunk/linux/net/rds/ib_cm.c	2006-06-27 18:02:36 UTC (rev 114)
+++ trunk/linux/net/rds/ib_cm.c	2006-06-27 23:02:46 UTC (rev 115)
@@ -161,6 +161,9 @@
 		goto out;
 	}
 
+	rdsdebug("conn %p pd %p mr %p cq %p\n", conn, ic->i_pd, ic->i_mr,
+		 ic->i_cq);
+
 	rds_ib_recv_refill(conn);
 
 out:
@@ -301,7 +304,7 @@
 	if (IS_ERR(ic->i_cm_id)) {
 		ret = PTR_ERR(ic->i_cm_id);
 		ic->i_cm_id = NULL;
-		pr_debug("rdma_create_id() failed: %d\n", ret);
+		rdsdebug("rdma_create_id() failed: %d\n", ret);
 		goto out;
 	} 
 
@@ -365,7 +368,7 @@
 
 	conn->c_transport_data = ic;
 
-	rdsdebug("ic %p\n", conn->c_transport_data);
+	rdsdebug("conn %p conn ic %p\n", conn, conn->c_transport_data);
 	return 0;
 }
 
@@ -408,6 +411,8 @@
 		goto out;
 	}
 
+	rdsdebug("cm %p listening on port %u\n", cm_id, RDS_IB_KNOWN_PORT);
+
 	rds_ib_listen_id = cm_id;
 	cm_id = NULL;
 out:
@@ -417,5 +422,6 @@
 }
 
 void rds_ib_listen_stop(void) {
-	rdma_disconnect(rds_ib_listen_id);
+	rdsdebug("cm %p\n", rds_ib_listen_id);
+	rdma_destroy_id(rds_ib_listen_id);
 }

Modified: trunk/linux/net/rds/ib_recv.c
===================================================================
--- trunk/linux/net/rds/ib_recv.c	2006-06-27 18:02:36 UTC (rev 114)
+++ trunk/linux/net/rds/ib_recv.c	2006-06-27 23:02:46 UTC (rev 115)
@@ -36,7 +36,7 @@
 {
 	struct rds_ib_incoming *ibinc;
 	ibinc = container_of(inc, struct rds_ib_incoming, ii_inc);
-	pr_debug("freeing ibinc %p inc %p\n", ibinc, inc);
+	rdsdebug("freeing ibinc %p inc %p\n", ibinc, inc);
 	BUG_ON(!list_empty(&ibinc->ii_recvs));
 	kmem_cache_free(rds_ib_incoming_slab, ibinc);
 }
@@ -141,11 +141,11 @@
 		to_copy = min_t(size_t, to_copy, size - copied);
 		to_copy = min_t(unsigned long, to_copy, len - copied);
 
-		pr_debug("copying %lu bytes to user %p (base %p len %zu "
-			 "off %lu) from recv %p page %p voff %u off %lu\n",
+		rdsdebug("copying %lu bytes to user %p (base %p len %zu "
+			 "off %lu) from recv %p page %p len %u off %lu\n",
 			 to_copy, iov->iov_base + iov_off, iov->iov_base,
 			 iov->iov_len, iov_off, recv, recv->ir_page,
-			 recv->ir_sge.offset, recv_off);
+			 recv->ir_sge.length, recv_off);
 
 		/* XXX could look more like filemap_copy_from_user() */
 		/* XXX needs + offset for multiple recvs per page */ 
@@ -194,7 +194,7 @@
 	struct rds_ib_recv *recv = (void *)(unsigned long)wr_id;
 	struct rds_ib_incoming *ibinc = ic->i_ibinc;
 
-	pr_debug("recv ic %p recv %p sge len %u\n", ic, recv,
+	rdsdebug("recv ic %p recv %p sge len %u\n", ic, recv,
 		 recv->ir_sge.length);
 
 	/* 

Modified: trunk/linux/net/rds/ib_send.c
===================================================================
--- trunk/linux/net/rds/ib_send.c	2006-06-27 18:02:36 UTC (rev 114)
+++ trunk/linux/net/rds/ib_send.c	2006-06-27 23:02:46 UTC (rev 115)
@@ -237,7 +237,7 @@
 	/* we use wr to track how many suceeded */
 	wr = &ds->id_wr[first];
 	ret = ib_post_send(ic->i_qp, &ds->id_wr[first], &wr);
-	pr_debug("data post ic %p first wr %p nr %lu returned ret %d wr %p\n",
+	rdsdebug("data post ic %p first wr %p nr %lu returned ret %d wr %p\n",
 		 ic,  &ds->id_wr[first], nr_work - first, ret, wr);
 	if (ret) {
 		printk(KERN_WARNING "RDS/IB: ib_post_send to %u.%u.%u.%u "

Modified: trunk/linux/net/rds/rds.h
===================================================================
--- trunk/linux/net/rds/rds.h	2006-06-27 18:02:36 UTC (rev 114)
+++ trunk/linux/net/rds/rds.h	2006-06-27 23:02:46 UTC (rev 115)
@@ -358,6 +358,11 @@
 int __init rds_tcp_init(void);
 void __exit rds_tcp_exit(void);
 
+/* ib.c */
+extern struct rds_transport rds_ib_transport;
+int __init rds_ib_init(void);
+void __exit rds_ib_exit(void);
+
 /* threads.c */
 int __init rds_threads_init(void);
 void __exit rds_threads_exit(void);

Modified: trunk/linux/net/rds/transport.c
===================================================================
--- trunk/linux/net/rds/transport.c	2006-06-27 18:02:36 UTC (rev 114)
+++ trunk/linux/net/rds/transport.c	2006-06-27 23:02:46 UTC (rev 115)
@@ -23,6 +23,7 @@
 #include "rds.h"
 
 static struct rds_transport *transports[] = {
+	&rds_ib_transport,
 	&rds_tcp_transport,
 	NULL,
 };
@@ -47,13 +48,23 @@
 		(*trans)->listen_stop();
 }
 
-/* should be more clever, but this is easy for now */
+/* XXX should be more clever, but this is easy for now */
 int __init rds_trans_init(void)
 {
-	return rds_tcp_init();
+	int ret;
+
+	ret = rds_tcp_init();
+	if (ret)
+		goto out;
+	ret = rds_ib_init();
+	if (ret)
+		rds_tcp_exit();
+out:
+	return ret;
 }
 
 void __exit rds_trans_exit(void)
 {
+	rds_ib_exit();
 	rds_tcp_exit();
 }




More information about the rds-commits mailing list