]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
dtest: change rdma_write_ping_pong so client is always last receiver
authorArlin Davis <arlin.r.davis@intel.com>
Mon, 21 Sep 2015 22:48:15 +0000 (15:48 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Mon, 21 Sep 2015 22:48:15 +0000 (15:48 -0700)
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 <arlin.r.davis@intel.com>
test/dtest/dtest.c

index ec6e746fbc6735721babd09bcea7492c76fc64dd..d6723435402f5cd1380500b05781a15b23cb13be 100755 (executable)
@@ -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,