[HCA] query MR must return RKey in network byte order.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 22 Sep 2005 04:42:47 +0000 (04:42 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 22 Sep 2005 04:42:47 +0000 (04:42 +0000)
[ALTS] Check that RKey and LKey for MR query match those returned by MR create.

Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@79 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mt23108/kernel/hca_data.c
tests/alts/registermemregion.c
tests/alts/user/alts_main.c

index 6d1075c..313c320 100644 (file)
@@ -1449,7 +1449,7 @@ mlnx_conv_vapi_mr_attr(
 \r
        mr_query_p->access_ctrl = map_vapi_acl(mr_info_p->acl);\r
        mr_query_p->lkey = mr_info_p->lkey;\r
-       mr_query_p->rkey = mr_info_p->rkey;\r
+       mr_query_p->rkey = cl_hton32(mr_info_p->rkey);\r
 }\r
 \r
 //////////////////////////////////////////////////////////////\r
index dee9813..ca3ff6e 100644 (file)
@@ -147,6 +147,24 @@ al_test_register_mem(
                        break;\r
                }\r
 \r
+               if(alts_mr_attr.lkey !=  lkey || alts_mr_attr.rkey !=  rkey)\r
+               {\r
+                       \r
+                       ALTS_PRINT( ALTS_DBG_ERROR,\r
+                               ("ib_query_mr failed lkey rkey different from reg\n"));\r
+                       ALTS_PRINT( ALTS_DBG_ERROR,\r
+                               ("\t\t reg-lkey = %x  query-lkey %x reg-rkey%x query-rkey%x\n" ,\r
+                               alts_mr_attr.lkey , lkey , alts_mr_attr.rkey ,  rkey));\r
+                       alts_close_ca(h_ca);\r
+                       ib_status = IB_INVALID_LKEY;\r
+                       break;\r
+                       \r
+               }\r
+\r
+               ALTS_PRINT( ALTS_DBG_ERROR,\r
+                       ("ib_query_mr passed\n"\r
+                       "\t\t lkey = %x    rkey%x query-rkey%x\n" ,\r
+                        lkey, rkey));\r
                /*\r
                 * Re-register the memeory region\r
                 */\r
@@ -158,6 +176,8 @@ al_test_register_mem(
                {\r
                        ALTS_PRINT( ALTS_DBG_ERROR,\r
                                ("ib_rereg_mem failed status = %s\n", ib_get_err_str(ib_status)) );\r
+                       alts_close_ca(h_ca);\r
+                       break;\r
                }\r
 \r
                ALTS_PRINT( ALTS_DBG_ERROR,\r
index ef97cc3..d7dd1fd 100644 (file)
@@ -212,9 +212,7 @@ ib_api_status_t ib_status = IB_ERROR;
                ib_status = al_test_create_mem_window();\r
                break;\r
        case RegisterSharedMemRegion:\r
-               CL_PRINT( ALTS_DBG_VERBOSE, alts_dbg_lvl,\r
-                       ("altsapp: RegisterSharedMemRegion not implemented.\n") );\r
-               ib_status = IB_SUCCESS;\r
+               ib_status = al_test_register_shared_mem();\r
                break;\r
        case MultiSend:\r
                ib_status = al_test_multi_send_recv();\r