From 6ffb699b9cb8621b2ae90d8e276f309ee9b2e33e Mon Sep 17 00:00:00 2001 From: "sean.hefty@intel.com" Date: Mon, 23 Jul 2012 15:20:08 -0700 Subject: [PATCH] dtest update for unaligned/aligned data option, unaligned by default set -a for page alignment. return EINVAL for anything other than sends or writes. --- dapl/openib_mcm/mix.c | 6 ++++-- test/dtest/dtest.c | 45 ++++++++++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/dapl/openib_mcm/mix.c b/dapl/openib_mcm/mix.c index 1f00289..8d2ce1a 100644 --- a/dapl/openib_mcm/mix.c +++ b/dapl/openib_mcm/mix.c @@ -615,7 +615,8 @@ int dapli_mix_post_send(ib_qp_handle_t m_qp, int txlen, struct ibv_send_wr *wr, scif_epd_t mix_ep = m_qp->tp->scif_ep; int ret, len, i; - dapl_log(DAPL_DBG_TYPE_EXTENSION," mix_post_send: sge=%d len=%d\n", wr->num_sge, txlen); + dapl_log(DAPL_DBG_TYPE_EXTENSION," mix_post_send: sge=%d len=%d op=%d\n", + wr->num_sge, txlen, wr->opcode); /* POST SEND request, send recv for now, optimize later with pre-registered WR memory pool */ /* cm thread processes replies, todo process immediate errors here with recv? @@ -643,7 +644,8 @@ int dapli_mix_post_send(ib_qp_handle_t m_qp, int txlen, struct ibv_send_wr *wr, msg.hdr.op = MIX_WRITE; } else { - return -1; /* anything else is unsupported */ + dapl_log(1, " invalid post_send OP %d; only writes and sends supported\n", wr->opcode); + return EINVAL; /* anything else is unsupported */ } len = sizeof(dat_mix_send_t); diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c index ff69fd3..6c16dee 100755 --- a/test/dtest/dtest.c +++ b/test/dtest/dtest.c @@ -194,6 +194,8 @@ struct dt_time ts; /* defaults */ static int failed = 0; +static int uni_direction = 0; +static int align_data=0; static int performance_times = 1; static int connected = 0; static int burst = 1; @@ -342,12 +344,20 @@ int main(int argc, char **argv) DAT_IA_ATTR ia_attr; /* parse arguments */ - while ((c = getopt(argc, argv, "tscvpq:l:b:d:B:h:P:")) != -1) { + while ((c = getopt(argc, argv, "autscvpq:l:b:d:B:h:P:")) != -1) { switch (c) { + case 'a': + align_data = 1; + fflush(stdout); + break; case 't': performance_times = 1; fflush(stdout); break; + case 'u': + uni_direction = 1; + fflush(stdout); + break; case 's': server = 1; fflush(stdout); @@ -424,19 +434,20 @@ int main(int argc, char **argv) } fflush(stdout); -#if 0 - /* allocate send and receive buffers */ - if (((rbuf = malloc(buf_len * (burst+1))) == NULL) || - ((sbuf = malloc(buf_len * (burst+1))) == NULL)) { - perror("malloc"); - exit(1); - } -#endif - /* allocate send and receive buffers */ - if (posix_memalign((void**)&rbuf, 4096, buf_len * (burst+1)) || - posix_memalign((void**)&sbuf, 4096, buf_len * (burst+1))) { - perror("malloc"); - exit(1); + if (align_data) { + /* allocate send and receive buffers */ + if (posix_memalign((void**)&rbuf, 4096, buf_len * (burst+1)) || + posix_memalign((void**)&sbuf, 4096, buf_len * (burst+1))) { + perror("malloc"); + exit(1); + } + } else { + /* allocate send and receive buffers */ + if (((rbuf = malloc(buf_len * (burst+1))) == NULL) || + ((sbuf = malloc(buf_len * (burst+1))) == NULL)) { + perror("malloc"); + exit(1); + } } memset(&ts, 0, sizeof(struct dt_time)); LOGPRINTF("%d Allocated RDMA buffers (r:%p,s:%p) len %d \n", @@ -590,6 +601,7 @@ int main(int argc, char **argv) goto cleanup; #endif + /*********** RDMA write data *************/ ret = do_rdma_write_with_msg(); if (ret != DAT_SUCCESS) { @@ -1332,6 +1344,9 @@ DAT_RETURN do_rdma_write_with_msg(void) l_iov[i].segment_length); } + if (uni_direction && server) + goto done; + start = get_time(); for (i = 0; i < burst; i++) { if (i==0) @@ -1365,7 +1380,7 @@ DAT_RETURN do_rdma_write_with_msg(void) stop = get_time(); ts.rdma_wr = ((stop - start) * 1.0e6); - +done: /* * Send RMR information a 2nd time to indicate completion * NOTE: already swapped to network order in connect_ep -- 2.41.0