[openib-general] Patch for possible bug in ib_create_ah_from_wc()

Ralph Campbell ralphc at pathscale.com
Tue Jan 3 18:06:05 PST 2006


It looks like ib_create_ah_from_wc() doesn't create the correct
return address (AH) when there is a GRH present (source & dest GIDs
need to be swapped).

I think the following patch will fix the problem but I haven't
been able to test it yet.

Index: gen2/trunk/src/linux-kernel/infiniband/core/verbs.c
===================================================================
--- verbs.c	(revision 4718)
+++ verbs.c	(working copy)
@@ -106,9 +106,9 @@
 
 	if (wc->wc_flags & IB_WC_GRH) {
 		ah_attr.ah_flags = IB_AH_GRH;
-		ah_attr.grh.dgid = grh->dgid;
+		ah_attr.grh.dgid = grh->sgid;
 
-		ret = ib_find_cached_gid(pd->device, &grh->sgid, &port_num,
+		ret = ib_find_cached_gid(pd->device, &grh->dgid, &port_num,
 					 &gid_index);
 		if (ret)
 			return ERR_PTR(ret);

-- 
Ralph Campbell <ralphc at pathscale.com>




More information about the general mailing list