From a3afd24a0ff9c77bc073cb27dfc79da7236beb47 Mon Sep 17 00:00:00 2001 From: Amir Hanania Date: Wed, 5 Aug 2015 13:16:12 -0700 Subject: [PATCH] dtest: pre-allocated buffer too small for RMR, DTO ops timeout The buf_len settings (-b) for small IO may cause segfault. Increase allocation and adjust DTO operations to infinite. Signed-off-by: Arlin Davis Signed-off-by: Amir Hanania --- test/dtest/dtest.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/dtest/dtest.c b/test/dtest/dtest.c index cfb074b..2ac26ea 100755 --- a/test/dtest/dtest.c +++ b/test/dtest/dtest.c @@ -99,13 +99,16 @@ #define MAX_RDMA_RD 4 #define MAX_PROCS 1000 +#define min(a, b) ((a < b) ? (a) : (b)) +#define max(a, b) ((a > b) ? (a) : (b)) + /* Header files needed for DAT/uDAPL */ #include "dat2/udat.h" #include "dat2/dat_ib_extensions.h" /* definitions */ #define SERVER_CONN_QUAL 45248 -#define DTO_TIMEOUT (1000*1000*5) +#define DTO_TIMEOUT DAT_TIMEOUT_INFINITE #define CNO_TIMEOUT (1000*1000*1) #define DTO_FLUSH_TIMEOUT (1000*1000*2) #define CONN_TIMEOUT (1000*1000*100) @@ -657,15 +660,15 @@ int main(int argc, char **argv) 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))) { + if (posix_memalign((void**)&rbuf, 4096, max(64, buf_len * (burst+1))) || + posix_memalign((void**)&sbuf, 4096, max(64, 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)) { + if (((rbuf = malloc(max(64, buf_len * (burst+1)))) == NULL) || + ((sbuf = malloc(max(64, buf_len * (burst+1)))) == NULL)) { perror("malloc"); exit(1); } @@ -1420,11 +1423,11 @@ no_resolution: * Setup our remote memory and tell the other side about it */ p_rmr_snd->virtual_address = htonll((DAT_VADDR) (uintptr_t) rbuf); - p_rmr_snd->segment_length = htonl(RDMA_BUFFER_SIZE); + p_rmr_snd->segment_length = htonl(buf_len); p_rmr_snd->rmr_context = htonl(rmr_context_recv); printf("%d Send RMR msg to remote: r_key_ctx=0x%x,va=%p,len=0x%x\n", - getpid(), rmr_context_recv, rbuf, RDMA_BUFFER_SIZE); + getpid(), rmr_context_recv, rbuf, buf_len); ret = send_msg(p_rmr_snd, sizeof(DAT_RMR_TRIPLET), -- 2.41.0