[openib-general] krping minor fixes

Pete Wyckoff pw at osc.edu
Sun Mar 19 11:10:52 PST 2006


This patch fixes some little issues in krping.

		-- Pete

Add some comments into the source explaining how to get krping to
do its business.  The use of /bin/echo rather than the bash builtin
avoids killing the shell in some error exit cases.

Return an error if the route doesn't resolve to avoid an oops on
the client when it can't connect to a server, and make the error
say more clearly that something failed.

Setting size=65536 (RPING_BUFSIZE) seems to work just fine.  Or
fix the printk error to report RPING_BUFSIZE-1 too.

Getopt taken from mount code isn't really mounting anything.

Signed-off-by: Pete Wyckoff <pw at osc.edu>

Index: gen2/branches/iwarp/src/linux-kernel/infiniband/ulp/krping/krping.c
===================================================================
--- gen2/branches/iwarp/src/linux-kernel/infiniband/ulp/krping/krping.c	(revision 5878)
+++ gen2/branches/iwarp/src/linux-kernel/infiniband/ulp/krping/krping.c	(working copy)
@@ -97,6 +97,12 @@
 static struct proc_dir_entry *krping_proc;
 
 /*
+ * Invoke like this, one on each side, using the server's address on
+ * the RDMA device (iw%d):
+ *
+ * /bin/echo server,port=9999,addr=192.168.69.142,validate > /proc/krping  
+ * /bin/echo client,port=9999,addr=192.168.69.142,validate > /proc/krping  
+ *
  * krping "ping/pong" loop:
  * 	client sends source rkey/addr/len
  *	server receives source rkey/add/len
@@ -884,9 +890,9 @@
 	wait_event_interruptible(cb->sem, cb->state >= ROUTE_RESOLVED);
 	if (cb->state != ROUTE_RESOLVED) {
 		printk(KERN_ERR PFX 
-		       "waiting for addr/route resolution state %d\n",
+		       "addr/route resolution did not resolve: state %d\n",
 		       cb->state);
-		return ret;
+		return -EINTR;
 	}
 
 	DEBUG_LOG("rdma_resolve_addr - rdma_resolve_route successful\n");
@@ -978,7 +984,7 @@
 		case 'S':
 			cb->size = optint;
 			if ((cb->size < 1) ||
-			    (cb->size > (RPING_BUFSIZE - 1))) {
+			    (cb->size > RPING_BUFSIZE)) {
 				printk(KERN_ERR PFX "Invalid size %d "
 				       "(valid range is 1 to %d)\n",
 				       cb->size, RPING_BUFSIZE);
Index: gen2/branches/iwarp/src/linux-kernel/infiniband/ulp/krping/getopt.c
===================================================================
--- gen2/branches/iwarp/src/linux-kernel/infiniband/ulp/krping/getopt.c	(revision 5878)
+++ gen2/branches/iwarp/src/linux-kernel/infiniband/ulp/krping/getopt.c	(working copy)
@@ -70,6 +70,6 @@
 			return -EINVAL;
 		}
 	}
-	printk(KERN_INFO "%s: Unrecognized mount option %s\n", caller, token);
+	printk(KERN_INFO "%s: Unrecognized option %s\n", caller, token);
 	return -EOPNOTSUPP;
 }



More information about the general mailing list