Allow --zerocopy and --skip-rx-copy when only server supports them#2045
Conversation
|
Thanks for the pull request. I'm trying to test it, but it looks like this is a fix (with respect to |
2976ee2 to
566e47e
Compare
I tested it by creating a version with |
bmah888
left a comment
There was a problem hiding this comment.
Thanks for the PR. I have a concern that this adds argument parsing complexity basically to cater to the case of a Windows client connecting to a Linux (or other UNIX-like) host, and Windows isn't even an officially supported platform. This isn't even applicable to any of the supported platforms (Linux, FreeBSD, macOS), but we have to pay the cost of more complicated code that's harder to test and maintain.
|
|
||
| /* Ensure a sending server supports zerocpy */ | ||
| if (test->zerocopy == 1 && test->mode != RECEIVER && !has_sendfile()) { | ||
| i_errno = IENOSENDFILE; // Zerocopy required for the Client but is not supported |
There was a problem hiding this comment.
| i_errno = IENOSENDFILE; // Zerocopy required for the Client but is not supported | |
| i_errno = IENOSENDFILE; // Zerocopy required for the Server but is not supported |
| break; | ||
| default: | ||
| case IERVRSONLYSKIPRXCOPY: | ||
| snprintf(errstr, len, "this OS does not support Skip RX Copy"); |
There was a problem hiding this comment.
| snprintf(errstr, len, "this OS does not support Skip RX Copy"); | |
| snprintf(errstr, len, "this OS does not support --skip-rx-copy"); |
| #define IPERF_HELP_MSG_TRUNK_SUPPORTED_BY_THIS_OS "" | ||
| #else /* !HAVE_MSG_TRUNC */ | ||
| #define IPERF_HELP_MSG_TRUNK_SUPPORTED_BY_THIS_OS " (this OS does not support but server OS may)" | ||
| #endif /* HAVE_MSG_TRUNC */ | ||
| " --skip-rx-copy ignore received messages using MSG_TRUNC option" IPERF_HELP_MSG_TRUNK_SUPPORTED_BY_THIS_OS "\n" |
There was a problem hiding this comment.
I'm opposed to making the help text more complicated in this way. I'd almost rather just emit the existing --skip-rx-copy text all the time.
There was a problem hiding this comment.
Modified the change - removed the #define IPERF_HELP_MSG_TRUNK_SUPPORTED_BY_THIS_OS but still added a specific --skip-rx-copy help version for when not supported by the local iperf3 but may be supported by the remote end.
6d6e0a9 to
b182f85
Compare
Version of iperf3 (or development branch, such as
masteror3.1-STABLE) to which this pull request applies:master 3.21+
Issues fixed (if any): zerocopy os check should wait for sever response when in reverse mode #2044
Brief description of code changes (suitable for use as a commit message):
Allow
--zerocopyand--skip-rx-copyeven when one of the sides OS, client or server, not support them, as they may be supported by the other side. When not supported, allowzerocopyonly when not sending andskip-rx-copyonly when not receiving.(UPDATE note: deleted the
-Prelated changes and created a separate PR for them.)