[openib-general] [PATCH] [RFC] dapltest change for iwarp

Steve Wise swise at opengridcomputing.com
Fri Apr 28 11:22:38 PDT 2006


James,

This patch changes the dapltest transaction test to force the client
side (the side that dat_ep_connect()) to send the first RDMA message.
This ensures that the IWARP MPA protocol requirements are met.

I'm presenting this for discussion and possible inclusion in the
trunk.  

A transport independent application should be designed to work over all
transports and should therefore utilize the only the common features.
This implies that the application should always initiate RDMA exchanges
starting with the client, to avoid MPA problems.

Comments?

Signed-off-by: Steve Wise <swise at opengridcomputing.com>


Index: test/dapltest/test/dapl_transaction_test.c
===================================================================
--- test/dapltest/test/dapl_transaction_test.c	(revision 6733)
+++ test/dapltest/test/dapl_transaction_test.c	(working copy)
@@ -978,55 +978,110 @@
 			test_ptr->base_port,
 			test_ptr->is_server ? "Server" : "Client"));
 
-	/* post the send buffer */
-	if (!DT_post_send_buffer (phead,
+	if (!test_ptr->is_server ) {
+
+	    /* post the send buffer */
+	    if (!DT_post_send_buffer (phead,
 		    		  test_ptr->ep_context[i].ep_handle,
 				  test_ptr->ep_context[i].bp,
 				  RMI_SEND_BUFFER_ID,
 				  buff_size))
-	{
-	    /* error message printed by DT_post_send_buffer */
-	    goto test_failure;
-	}
-	/* reap the send and verify it */
-	dto_cookie.as_64 = LZERO;
-	dto_cookie.as_ptr =
-	    (DAT_PVOID) DT_Bpool_GetBuffer (
-		test_ptr->ep_context[i].bp,
-		RMI_SEND_BUFFER_ID);
-	if (!DT_dto_event_wait (phead, test_ptr->reqt_evd_hdl, &dto_stat) ||
-	    !DT_dto_check ( phead,
+	    {
+	        /* error message printed by DT_post_send_buffer */
+	        goto test_failure;
+	    }
+	    /* reap the send and verify it */
+	    dto_cookie.as_64 = LZERO;
+	    dto_cookie.as_ptr =
+	        (DAT_PVOID) DT_Bpool_GetBuffer (
+		    test_ptr->ep_context[i].bp,
+		    RMI_SEND_BUFFER_ID);
+	    if (!DT_dto_event_wait (phead, test_ptr->reqt_evd_hdl, &dto_stat) ||
+	        !DT_dto_check ( phead,
 			    &dto_stat,
 			    test_ptr->ep_context[i].ep_handle,
 			    buff_size,
 			    dto_cookie,
 			    test_ptr->is_server ? "Client_Mem_Info_Send"
 						: "Server_Mem_Info_Send"))
-	{
-	    goto test_failure;
-	}
+	    {
+	        goto test_failure;
+	    }
 
-	/*
-	 * Recv the other side's info
-	 */
-	DT_Tdep_PT_Debug (1,(phead,"Test[" F64x "]: Waiting for %s Memory Info\n",
+	    /*
+	     * Recv the other side's info
+	     */
+	    DT_Tdep_PT_Debug (1,(phead,"Test[" F64x "]: Waiting for %s Memory Info\n",
 			test_ptr->base_port,
 			test_ptr->is_server ? "Client" : "Server"));
-	dto_cookie.as_64 = LZERO;
-	dto_cookie.as_ptr =
-	    (DAT_PVOID) DT_Bpool_GetBuffer (
-		test_ptr->ep_context[i].bp,
-		RMI_RECV_BUFFER_ID);
-	if (!DT_dto_event_wait (phead, test_ptr->recv_evd_hdl, &dto_stat) ||
-	    !DT_dto_check ( phead,
+	    dto_cookie.as_64 = LZERO;
+	    dto_cookie.as_ptr =
+	        (DAT_PVOID) DT_Bpool_GetBuffer (
+		    test_ptr->ep_context[i].bp,
+		    RMI_RECV_BUFFER_ID);
+	    if (!DT_dto_event_wait (phead, test_ptr->recv_evd_hdl, &dto_stat) ||
+	        !DT_dto_check ( phead,
 		 	    &dto_stat,
 			    test_ptr->ep_context[i].ep_handle,
 			    buff_size,
 			    dto_cookie,
 			    test_ptr->is_server ? "Client_Mem_Info_Recv"
 						: "Server_Mem_Info_Recv"))
-	{
-	    goto test_failure;
+	    {
+	        goto test_failure;
+	    }
+	} else {
+
+	    /*
+	     * Recv the other side's info
+	     */
+	    DT_Tdep_PT_Debug (1,(phead,"Test[" F64x "]: Waiting for %s Memory Info\n",
+			test_ptr->base_port,
+			test_ptr->is_server ? "Client" : "Server"));
+	    dto_cookie.as_64 = LZERO;
+	    dto_cookie.as_ptr =
+	        (DAT_PVOID) DT_Bpool_GetBuffer (
+		    test_ptr->ep_context[i].bp,
+		    RMI_RECV_BUFFER_ID);
+	    if (!DT_dto_event_wait (phead, test_ptr->recv_evd_hdl, &dto_stat) ||
+	        !DT_dto_check ( phead,
+		 	    &dto_stat,
+			    test_ptr->ep_context[i].ep_handle,
+			    buff_size,
+			    dto_cookie,
+			    test_ptr->is_server ? "Client_Mem_Info_Recv"
+						: "Server_Mem_Info_Recv"))
+	    {
+	        goto test_failure;
+	    }
+
+	    /* post the send buffer */
+	    if (!DT_post_send_buffer (phead,
+		    		  test_ptr->ep_context[i].ep_handle,
+				  test_ptr->ep_context[i].bp,
+				  RMI_SEND_BUFFER_ID,
+				  buff_size))
+	    {
+	        /* error message printed by DT_post_send_buffer */
+	        goto test_failure;
+	    }
+	    /* reap the send and verify it */
+	    dto_cookie.as_64 = LZERO;
+	    dto_cookie.as_ptr =
+	        (DAT_PVOID) DT_Bpool_GetBuffer (
+		    test_ptr->ep_context[i].bp,
+		    RMI_SEND_BUFFER_ID);
+	    if (!DT_dto_event_wait (phead, test_ptr->reqt_evd_hdl, &dto_stat) ||
+	        !DT_dto_check ( phead,
+			    &dto_stat,
+			    test_ptr->ep_context[i].ep_handle,
+			    buff_size,
+			    dto_cookie,
+			    test_ptr->is_server ? "Client_Mem_Info_Send"
+						: "Server_Mem_Info_Send"))
+	    {
+	        goto test_failure;
+	    }
 	}
 
 	/*




More information about the general mailing list