Skip to contentSkip to conversation

dapltest: Add final send/recv "sync" for transaction tests.

RFC PATCH Superseded Steve Wise 1 participant 2 messages Feb 28, 2014 1 message not in the archive InfiniBand

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

RFC PATCH 1/1 dapltest: Add final send/recv "sync" for transaction tests.

The transaction tests need both sides to send a sync message after running the test. This ensures that all remote operations are complete before dapltest deregeisters memory and disconnects the endpoints.

Without this logic, we see async errors on iwarp devices because a read or write arrives after the rmr has been destroyed. I believe this is more likely to happen with iWARP than IB because iWARP completions only indicate the local buffer can be reused. It doesn't imply that the message has even arrived at the peer, let alone been placed in memory.

I've tested this on cxgb4 only so far.

Similar logic is probably needed for the performance tests as well.

---

 test/dapltest/test/dapl_transaction_stats.c |   10 ++
 test/dapltest/test/dapl_transaction_test.c  |  139 +++++++++++++++++++++++++++
 2 files changed, 149 insertions(+), 0 deletions(-)
test/dapltest/test/dapl_transaction_stats.c +10 -0
index f9d6377..6422ee3 100644
@@ -59,6 +59,16 @@ DT_transaction_stats_set_ready(DT_Tdep_Print_Head * phead,
 	DT_Mdep_Unlock(&transaction_stats->lock);
 }
 
+void
+DT_transaction_stats_reset_wait_count(DT_Tdep_Print_Head * phead,
+			       Transaction_Stats_t * transaction_stats,
+			       unsigned int num)
+{
+	DT_Mdep_Lock(&transaction_stats->lock);
+	transaction_stats->wait_count = num;
+	DT_Mdep_Unlock(&transaction_stats->lock);
+}
+
 bool
 DT_transaction_stats_wait_for_all(DT_Tdep_Print_Head * phead,
 				  Transaction_Stats_t * transaction_stats)
test/dapltest/test/dapl_transaction_test.c +139 -0

145 lines not on this page · raw message

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20140228171428.30473.82786.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org

author
#2 lore raw

Hey Arlin,

This fix isn't quite correct: If one side finishes its transaction IO, then posts the final sync SEND, but the peer hasn't finished with its transaction IO, then the peer could post a READ request, for example, and then wait for the READ completion. However the READ response would get sent behind the local side's final sync SEND and wouldn't be placed because the peer's final sync RECV hasn't been posted yet. Sigh. I'll need to think more on this, but I'd like feedback if anybody has opinions/questions/comments...

Steve.

Quoted 227 lines

-----Original Message-----
From: [email protected] [mailto:linux-rdma- [email protected]] On Behalf Of Steve Wise
Sent: Friday, February 28, 2014 11:14 AM
To: [email protected]
Cc: [email protected]
Subject: [PATCH RFC] dapltest: Add final send/recv "sync" for transaction tests.

The transaction tests need both sides to send a sync message after running the test. This ensures that all remote operations are complete before dapltest deregeisters memory and disconnects the endpoints.

Without this logic, we see async errors on iwarp devices because a read or write arrives after the rmr has been destroyed. I believe this is more likely to happen with iWARP than IB because iWARP completions only indicate the local buffer can be reused. It doesn't imply that the message has even arrived at the peer, let alone been placed in memory.

I've tested this on cxgb4 only so far.

Similar logic is probably needed for the performance tests as well.

---

 test/dapltest/test/dapl_transaction_stats.c |   10 ++
 test/dapltest/test/dapl_transaction_test.c  |  139
+++++++++++++++++++++++++++
 2 files changed, 149 insertions(+), 0 deletions(-)
test/dapltest/test/dapl_transaction_stats.c +10 -0
index f9d6377..6422ee3 100644
@@ -59,6 +59,16 @@
 DT_transaction_stats_set_ready(DT_Tdep_Print_Head * phead,
 	DT_Mdep_Unlock(&transaction_stats->lock);
 }
 
+void
+DT_transaction_stats_reset_wait_count(DT_Tdep_Print_Head * phead,
+			       Transaction_Stats_t * transaction_stats,
+			       unsigned int num)
+{
+	DT_Mdep_Lock(&transaction_stats->lock);
+	transaction_stats->wait_count = num;
+	DT_Mdep_Unlock(&transaction_stats->lock);
+}
+
 bool
 DT_transaction_stats_wait_for_all(DT_Tdep_Print_Head * phead,
test/dapltest/test/dapl_transaction_stats.c +0 -0
 				  Transaction_Stats_t * transaction_stats)
test/dapltest/test/dapl_transaction_test.c +10 -0
index 779ea86..b94a2cc 100644
@@ -1799,6 +1799,145 @@ DT_Transaction_Run(DT_Tdep_Print_Head *
 phead, Transaction_Test_t * test_ptr)
 		}		/* end loop for each op */
 	}			/* end loop for iteration */
 
+	/*
+	 * Final sync up to ensure all previous remote operations have
+	 * finished.
+	 *
+	 * Without a final sync exchange, we see async errors on iwarp
+	 * devices because a read or write arrives after the rmr has
+	 * been destroyed.  I believe this is more likely to happen with
+	 * iWARP than IB because iWARP completions only indicate the
+	 * local buffer can be reused.  It doesn't imply that the
+	 * message has even arrived at the peer, let alone been placed in

memory.

test/dapltest/test/dapl_transaction_test.c +8 -0
+	 */
+	if (test_ptr->is_server) {
+		/*
+		 * Server
+		 */
+		DT_Tdep_PT_Debug(1,
+				 (phead,
+				  "Test[" F64x "]: Send Final Sync to

Client\n",

test/dapltest/test/dapl_transaction_test.c +4 -0
+				  test_ptr->base_port));
+		for (i = 0; i < test_ptr->cmd->eps_per_thread; i++) {
+			if (!DT_post_recv_buffer(phead,
+						 test_ptr-
Quoted 1 line

ep_context[i].ep_handle,

test/dapltest/test/dapl_transaction_test.c +1 -0
+						 test_ptr-
Quoted 1 line

ep_context[i].bp,

test/dapltest/test/dapl_transaction_test.c +1 -0
+						 SYNC_RECV_BUFFER_ID,

SYNC_BUFF_SIZE)) {

test/dapltest/test/dapl_transaction_test.c +6 -0
+				goto bail;
+			}
+			if (!DT_post_send_buffer(phead,
+						 test_ptr->ep_context[i].
+						 ep_handle,
+						 test_ptr-
Quoted 1 line

ep_context[i].bp,

test/dapltest/test/dapl_transaction_test.c +6 -0
+						 SYNC_SEND_BUFFER_ID,
+						 SYNC_BUFF_SIZE)) {
+				DT_Tdep_PT_Debug(1,
+						 (phead,
+						  "Test[" F64x
+						  "]: Server final sync send

error\n",

test/dapltest/test/dapl_transaction_test.c +14 -0
+						  test_ptr->base_port));
+				goto bail;
+			}
+		}
+		for (i = 0; i < test_ptr->cmd->eps_per_thread; i++) {
+			DAT_DTO_COMPLETION_EVENT_DATA dto_stat;
+
+			if (!DT_dto_event_wait(phead,
+					       test_ptr->ep_context[i].
+					       reqt_evd_hdl, &dto_stat)) {
+				DT_Tdep_PT_Debug(1,
+						 (phead,
+						  "Test[" F64x
+						  "]: Server final sync send

error\n",

test/dapltest/test/dapl_transaction_test.c +9 -0
+						  test_ptr->base_port));
+
+				goto bail;
+			}
+		}
+
+		DT_Tdep_PT_Debug(1,
+				 (phead,
+				  "Test[" F64x "]: Wait for Final Sync

Message\n",

test/dapltest/test/dapl_transaction_test.c +11 -0
+				  test_ptr->base_port));
+		for (i = 0; i < test_ptr->cmd->eps_per_thread; i++) {
+			DAT_DTO_COMPLETION_EVENT_DATA dto_stat;
+
+			if (!DT_dto_event_wait(phead,
+					       test_ptr->ep_context[i].
+					       recv_evd_hdl, &dto_stat)) {
+				DT_Tdep_PT_Debug(1,
+						 (phead,
+						  "Test[" F64x
+						  "]: Server final sync recv

error\n",

test/dapltest/test/dapl_transaction_test.c +12 -0
+						  test_ptr->base_port));
+				goto bail;
+			}
+		}
+	} else {
+
+		/*
+		 * Client
+		 */
+		DT_Tdep_PT_Debug(1,
+				 (phead,
+				  "Test[" F64x "]: Wait for Final Sync

Message\n",

test/dapltest/test/dapl_transaction_test.c +5 -0
+				  test_ptr->base_port));
+		DT_transaction_stats_reset_wait_count(phead,
+					       &test_ptr->pt_ptr->
+					       Client_Stats,
+					       test_ptr->cmd-
Quoted 1 line

eps_per_thread);

test/dapltest/test/dapl_transaction_test.c +5 -0
+		for (i = 0; i < test_ptr->cmd->eps_per_thread; i++) {
+			DAT_DTO_COMPLETION_EVENT_DATA dto_stat;
+
+			if (!DT_post_recv_buffer(phead,
+						 test_ptr-
Quoted 1 line

ep_context[i].ep_handle,

test/dapltest/test/dapl_transaction_test.c +1 -0
+						 test_ptr-
Quoted 1 line

ep_context[i].bp,

test/dapltest/test/dapl_transaction_test.c +1 -0
+						 SYNC_RECV_BUFFER_ID,

SYNC_BUFF_SIZE)) {

test/dapltest/test/dapl_transaction_test.c +9 -0
+				goto bail;
+			}
+			if (!DT_dto_event_wait(phead,
+					       test_ptr->ep_context[i].
+					       recv_evd_hdl, &dto_stat)) {
+				DT_Tdep_PT_Debug(1,
+						 (phead,
+						  "Test[" F64x
+						  "]: Client final sync recv

error\n",

test/dapltest/test/dapl_transaction_test.c +9 -0
+						  test_ptr->base_port));
+				goto bail;
+			}
+			DT_transaction_stats_set_ready(phead,
+						       &test_ptr->pt_ptr->
+						       Client_Stats);
+		}
+		DT_Tdep_PT_Debug(1,
+				 (phead, "Test[" F64x "]: Send Final Sync

Msg\n",

test/dapltest/test/dapl_transaction_test.c +6 -0
+				  test_ptr->base_port));
+		for (i = 0; i < test_ptr->cmd->eps_per_thread; i++) {
+			if (!DT_post_send_buffer(phead,
+						 test_ptr->ep_context[i].
+						 ep_handle,
+						 test_ptr-
Quoted 1 line

ep_context[i].bp,

test/dapltest/test/dapl_transaction_test.c +6 -0
+						 SYNC_SEND_BUFFER_ID,
+						 SYNC_BUFF_SIZE)) {
+				DT_Tdep_PT_Debug(1,
+						 (phead,
+						  "Test[" F64x
+						  "]: Client sync send

error\n",

test/dapltest/test/dapl_transaction_test.c +15 -1
+						  test_ptr->base_port));
+				goto bail;
+			}
+		}
+		for (i = 0; i < test_ptr->cmd->eps_per_thread; i++) {
+			DAT_DTO_COMPLETION_EVENT_DATA dto_stat;
+
+			if (!DT_dto_event_wait(phead,
+					       test_ptr->ep_context[i].
+					       reqt_evd_hdl, &dto_stat)) {
+				goto bail;
+			}
+		}
+	}
+
 	/* end time and print stats */
 	test_ptr->stats.end_time = DT_Mdep_GetTime();
 	if (!test_ptr->pt_ptr->local_is_server) {
 
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html