From: Arlin Davis Date: Mon, 21 Sep 2015 22:48:15 +0000 (-0700) Subject: dtest: change rdma_write_ping_pong so client is always last receiver X-Git-Tag: dapl-2.1.7-1~4 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2f7f25a808d9e6b3ee613c5b8b9a9e2f5abe5c55;p=~ardavis%2Fdapl.git dtest: change rdma_write_ping_pong so client is always last receiver server always waits after test loops for DREQ event so in order to gracefully shutdown client should always receive last handshake message and issue DREQ. Remove logging in loop. Always init data and increase min rdma buffer size to 4KB. Signed-off-by: Arlin Davis --- diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c index ec6e746..d672343 100755 --- a/test/dtest/dtest.c +++ b/test/dtest/dtest.c @@ -677,8 +677,8 @@ int main(int argc, char **argv) if (align_data) { /* allocate send and receive buffers */ - if (posix_memalign((void**)&rbuf, 4096, max(64, buf_len * rq_cnt)) || - posix_memalign((void**)&sbuf, 4096, max(64, buf_len * rq_cnt))) { + if (posix_memalign((void**)&rbuf, 4096, max(4096, buf_len * rq_cnt)) || + posix_memalign((void**)&sbuf, 4096, max(4096, buf_len * rq_cnt))) { perror("malloc"); exit(1); } @@ -690,8 +690,9 @@ int main(int argc, char **argv) exit(1); } } - LOGPRINTF("%d Allocated RDMA buffers (r:%p,s:%p) len %d \n", - getpid(), rbuf, sbuf, buf_len); + init_data(); + LOGPRINTF("%d Allocated RDMA buffers (r:%p=%d,s:%p=%d) len %d \n", + getpid(), rbuf, *rbuf, sbuf, *sbuf, buf_len); if (posix_memalign((void**)&p_rmr_rcv, 4096, 4096) || posix_memalign((void**)&p_rmr_snd, 4096, 4096)) { @@ -1983,18 +1984,20 @@ DAT_RETURN do_rdma_write_ping_pong(void) l_iov[i].segment_length); } start = get_time(); - for (i = 0; i < burst; i++) { - if (rx_cnt < burst && !(server && !tx_cnt)) { + for (i = 0; i <= burst; i++) { + if (rx_cnt < burst && !(!server && !tx_cnt)) { rx_cnt++; while (*rx_buf != (char)rx_cnt); } - LOGPRINTF("%d rdma_write # %d data rcv'ed\n", getpid(), rx_cnt); if (!((i+1) % signal_rate)) suppress = DAT_COMPLETION_DEFAULT_FLAG; else suppress = DAT_COMPLETION_SUPPRESS_FLAG; + if (tx_cnt == burst) + break; + *tx_buf = (char)++tx_cnt; cookie.as_64 = tx_cnt; ret = dat_ep_post_rdma_write(h_ep, MSG_IOV_COUNT, @@ -2005,7 +2008,6 @@ DAT_RETURN do_rdma_write_ping_pong(void) getpid(), DT_RetToStr(ret)); return (DAT_ABORT); } - LOGPRINTF("%d rdma_write # %d data sent\n", getpid(), tx_cnt); if (!suppress) { while (dat_evd_dequeue(h_dto_req_evd, &event)); if (dto_event->status) { @@ -2016,13 +2018,12 @@ DAT_RETURN do_rdma_write_ping_pong(void) dto_event->user_cookie.as_64, tx_cnt); return (DAT_ABORT); } - LOGPRINTF("%d rdma_write # %d data sent event\n", getpid(), tx_cnt); } } stop = get_time(); ts.rtt = ((stop - start) * 1.0e6); - if((unsigned char)*rx_buf != (unsigned char)rx_cnt) { + if ((unsigned char)*rx_buf != (unsigned char)rx_cnt) { printf( "%d %s RW pingpong: %p, last *buf %d != cnt %d\n", getpid(), server ? "SERVER:" : "CLIENT:", rx_buf, (unsigned char)*rx_buf,