Displaying 1 result from an estimated 1 matches for "rest_bytes".
Did you mean:
read_bytes
2023 Feb 16
0
[RFC PATCH v1 12/12] test/vsock: MSG_ZEROCOPY support for vsock_perf
...}
Eventually to simplify the code I think we can use the mmaped buffer in
both cases.
>
> memset(data, 0, buf_size_bytes);
> total_send = 0;
>+ time_in_send = 0;
> tx_begin_ns = current_nsec();
>
> while (total_send < to_send_bytes) {
> ssize_t sent;
>+ size_t rest_bytes;
>+ time_t before;
>+
>+ rest_bytes = to_send_bytes - total_send;
>
>- sent = write(fd, data, buf_size_bytes);
>+ before = current_nsec();
>+ sent = send(fd, data, (rest_bytes > buf_size_bytes) ?
>+ buf_size_bytes : rest_bytes,
>+ zerocopy ? MSG_ZEROCO...