[Openib-windows] [PATCH] query-register mr

Yossi Leybovich sleybo at mellanox.co.il
Wed Sep 21 02:54:13 PDT 2005


Fab

Our verification team found that rkey get different value between ib_reg_mem
and ib_query_mem
The problem was that according to the API rkey and lkey should be use the
network order (they defined as net32),
but only the rkey in ib_reg_mem was returned using the network order 

This patch fix this and return the same endians between query_mem and
reg_mem for rkey.
I still think that if the API require that also the lkey should use network
order
we should change and return lkey also in network order.
( I didn't do this , because I don't know if it breaks anything,  but it
very easy to do ...)

I also add the keys check to the alts test and enable the shared memory
test.

Pls review and apply

10x
Yossi 

Singed-off-by:Yossi Leybovich (sleybo at mellanox.co.il)
Index: hw/mt23108/kernel/hca_data.c
===================================================================
--- hw/mt23108/kernel/hca_data.c	(revision 433)
+++ hw/mt23108/kernel/hca_data.c	(working copy)
@@ -1449,7 +1449,7 @@
 
 	mr_query_p->access_ctrl = map_vapi_acl(mr_info_p->acl);
 	mr_query_p->lkey = mr_info_p->lkey;
-	mr_query_p->rkey = mr_info_p->rkey;
+	mr_query_p->rkey = cl_hton32(mr_info_p->rkey);
 }
 
 //////////////////////////////////////////////////////////////
Index: tests/alts/registermemregion.c
===================================================================
--- tests/alts/registermemregion.c	(revision 433)
+++ tests/alts/registermemregion.c	(working copy)
@@ -147,6 +147,24 @@
 			break;
 		}
 
+		if(alts_mr_attr.lkey !=  lkey || alts_mr_attr.rkey !=  rkey)
+		{
+			
+			ALTS_PRINT( ALTS_DBG_ERROR,
+				("ib_query_mr failed lkey rkey different
from reg\n"));
+			ALTS_PRINT( ALTS_DBG_ERROR,
+				("\t\t reg-lkey = %x  query-lkey %x
reg-rkey%x query-rkey%x\n" ,
+				alts_mr_attr.lkey , lkey , alts_mr_attr.rkey
,  rkey));
+			alts_close_ca(h_ca);
+			ib_status = IB_INVALID_LKEY;
+			break;
+			
+		}
+
+		ALTS_PRINT( ALTS_DBG_ERROR,
+			("ib_query_mr passed\n"
+			"\t\t lkey = %x    rkey%x query-rkey%x\n" ,
+			 lkey, rkey));
 		/*
 		 * Re-register the memeory region
 		 */
@@ -158,6 +176,8 @@
 		{
 			ALTS_PRINT( ALTS_DBG_ERROR,
 				("ib_rereg_mem failed status = %s\n",
ib_get_err_str(ib_status)) );
+			alts_close_ca(h_ca);
+			break;
 		}
 
 		ALTS_PRINT( ALTS_DBG_ERROR,
Index: tests/alts/user/alts_main.c
===================================================================
--- tests/alts/user/alts_main.c	(revision 433)
+++ tests/alts/user/alts_main.c	(working copy)
@@ -212,9 +212,7 @@
 		ib_status = al_test_create_mem_window();
 		break;
 	case RegisterSharedMemRegion:
-		CL_PRINT( ALTS_DBG_VERBOSE, alts_dbg_lvl,
-			("altsapp: RegisterSharedMemRegion not
implemented.\n") );
-		ib_status = IB_SUCCESS;
+		ib_status = al_test_register_shared_mem();
 		break;
 	case MultiSend:
 		ib_status = al_test_multi_send_recv();

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20050921/36af85f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: query_mr.patch
Type: application/octet-stream
Size: 2066 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20050921/36af85f9/attachment.obj>


More information about the ofw mailing list