From: Sean Hefty Date: Wed, 16 Jul 2014 20:44:56 +0000 (-0700) Subject: riostream: Only verify last data transfer X-Git-Tag: v1.0.19~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8f53f2a5d3cb5d6c30fe5695b48268ea1bbe2ff0;p=~shefty%2Flibrdmacm.git riostream: Only verify last data transfer Data verification will fail when running the bandwidth tests or the transfer count is > 1. The issue is that subsequent writes by the initiator side will overwrite the data in the target buffer before the receiver can verify that it is correct. To fix this, only verify that the data in the buffer is correct after the last transfer has completed. Signed-off-by: Sean Hefty --- diff --git a/examples/riostream.c b/examples/riostream.c index 4c0d21fb..c12dd0d4 100644 --- a/examples/riostream.c +++ b/examples/riostream.c @@ -148,9 +148,6 @@ static int send_msg(int size) struct pollfd fds; int offset, ret; - if (verify) - format_buf(buf, size); - if (use_async) { fds.fd = rs; fds.events = POLLOUT; @@ -180,9 +177,6 @@ static int send_xfer(int size) struct pollfd fds; int offset, ret; - if (verify) - format_buf(buf, size - 1); - if (use_async) { fds.fd = rs; fds.events = POLLOUT; @@ -233,12 +227,6 @@ static int recv_msg(int size) } } - if (verify) { - ret = verify_buf(buf, size); - if (ret) - return ret; - } - return 0; } @@ -296,6 +284,8 @@ static int run_test(void) goto out; } *poll_byte = (uint8_t) marker++; + if (verify) + format_buf(buf, transfer_size - 1); ret = send_xfer(transfer_size); if (ret) goto out; @@ -312,6 +302,8 @@ static int run_test(void) goto out; } *poll_byte = (uint8_t) marker++; + if (verify) + format_buf(buf, transfer_size - 1); ret = send_xfer(transfer_size); } if (ret)