[openib-general] Re: ANNOUNCE: First usable version of userspace verbs

Michael S. Tsirkin mst at mellanox.co.il
Sun Feb 27 07:19:26 PST 2005


Quoting r. Michael S. Tsirkin <mst at mellanox.co.il>:
> Subject: Re: ANNOUNCE: First usable version of userspace verbs
> 
> Quoting r. Roland Dreier <roland at topspin.com>:
> > Subject: Re: ANNOUNCE: First usable version of userspace verbs
> > 
> >     Michael> The pingpong test fails for me, on x86_64. (The
> >     Michael> executable being a 64 bit one). My kernel is 2.6.10.
> > 
> > OK, I installed x86_64 userspace and got user verbs working.  The
> > first problem you ran into was because on a 32-bit arch,
> > 
> >     struct {
> >             uint64_t a;
> >             uint32_t b;
> >     };
> > 
> > has size 12 but on a 64-bit arch it has size 16.  Because of the way I
> > tested sizes of parameters passed into the kernel, it was basically
> > looking for userspace to pass a size of 12.  I fixed this by padding
> > all the structs to a multiple of 8 bytes so we don't run into this.
> > 
> > I also fixed a few warnings and other small glitches, and now the
> > pingpong test works for me from both 32- and 64-bit userspace.
> > 
> > Since the ABI is different, you'll have to rebuild both the kernel
> > modules and the userspace libraries when updating.
> > 
> > Thanks,
> >   Roland
> > 
> 
> Hmm.
> # /usr/local/bin/ibv_pingpong
> (no diagnostic is produced)

This seems to be caused by SM not running. Here's a patch to make
it produce a diagnostic message.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: libibverbs/examples/pingpong.c
===================================================================
--- libibverbs/examples/pingpong.c	(revision 1922)
+++ libibverbs/examples/pingpong.c	(working copy)
@@ -560,8 +560,10 @@
 	my_dest.lid = pp_get_local_lid(ib_dev, ib_port);
 	my_dest.qpn = ctx->qp->qp_num;
 	my_dest.psn = lrand48() & 0xffffff;
-	if (!my_dest.lid)
+	if (!my_dest.lid) {
+		fprintf(stderr, "Local lid 0x0 detected. Is an SM running?\n");
 		return 1;
+	}
 
 	printf("  local address:  LID 0x%04x, QPN 0x%06x, PSN 0x%06x\n",
 	       my_dest.lid, my_dest.qpn, my_dest.psn);


-- 
MST - Michael S. Tsirkin



More information about the general mailing list