]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
riostream: Only verify last data transfer
authorSean Hefty <sean.hefty@intel.com>
Wed, 16 Jul 2014 20:44:56 +0000 (13:44 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 16 Jul 2014 20:44:56 +0000 (13:44 -0700)
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 <sean.hefty@intel.com>
examples/riostream.c

index 4c0d21fb8d96bda7e8f09fe623b1b838a4271ece..c12dd0d40f8eef1869a09c7f39e808a3ae096bcb 100644 (file)
@@ -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)