Skip to content

Allow --zerocopy and --skip-rx-copy when only server supports them#2045

Open
davidBar-On wants to merge 1 commit into
esnet:masterfrom
davidBar-On:issue_2044_options_verify_enhance__zerocopy_skip-rx-copy_parallel
Open

Allow --zerocopy and --skip-rx-copy when only server supports them#2045
davidBar-On wants to merge 1 commit into
esnet:masterfrom
davidBar-On:issue_2044_options_verify_enhance__zerocopy_skip-rx-copy_parallel

Conversation

@davidBar-On

@davidBar-On davidBar-On commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Allow --zerocopy and --skip-rx-copy even when one of the sides OS, client or server, not support them, as they may be supported by the other side. When not supported, allow zerocopy only when not sending and skip-rx-copy only when not receiving.

(UPDATE note: deleted the -P related changes and created a separate PR for them.)

@bmah888

bmah888 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for the pull request. I'm trying to test it, but it looks like this is a fix (with respect to --zerocopy and --skip-rx-copy for a problem that does not occur on Linux, FreeBSD, or macOS (the three main development problems). If this is only an issues (a platfom that we don't officially support) this is going to be a little hard for our team to test. Haven't quiet figured out how to deal with this yet.

@davidBar-On davidBar-On deleted the issue_2044_options_verify_enhance__zerocopy_skip-rx-copy_parallel branch June 13, 2026 09:02
@davidBar-On davidBar-On restored the issue_2044_options_verify_enhance__zerocopy_skip-rx-copy_parallel branch June 13, 2026 09:02
@davidBar-On davidBar-On reopened this Jun 13, 2026
@davidBar-On davidBar-On force-pushed the issue_2044_options_verify_enhance__zerocopy_skip-rx-copy_parallel branch from 2976ee2 to 566e47e Compare June 13, 2026 09:43
@davidBar-On

Copy link
Copy Markdown
Contributor Author

Haven't quiet figured out how to deal with this yet.

I tested it by creating a version with HAVE_MSG_TRUNC set to zero, and then run it once as a client and once as a server (when the other side is the version with HAVE_MSG_TRUNC set to 1). I believe this is sufficient as each of these options affect either sending or sides but not both.

@bmah888 bmah888 changed the title Allow --zerocopy and --skip-rx-copy when only server supports, fix -P value verification Allow --zerocopy and --skip-rx-copy when only server supports them Jun 26, 2026
@bmah888 bmah888 self-assigned this Jun 26, 2026

@bmah888 bmah888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/iperf_api.c Outdated

/* 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
i_errno = IENOSENDFILE; // Zerocopy required for the Client but is not supported
i_errno = IENOSENDFILE; // Zerocopy required for the Server but is not supported

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

Comment thread src/iperf_error.c Outdated
break;
default:
case IERVRSONLYSKIPRXCOPY:
snprintf(errstr, len, "this OS does not support Skip RX Copy");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
snprintf(errstr, len, "this OS does not support Skip RX Copy");
snprintf(errstr, len, "this OS does not support --skip-rx-copy");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

Comment thread src/iperf_locale.c Outdated
Comment on lines +215 to +219
#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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@davidBar-On davidBar-On force-pushed the issue_2044_options_verify_enhance__zerocopy_skip-rx-copy_parallel branch from 6d6e0a9 to b182f85 Compare June 28, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zerocopy os check should wait for sever response when in reverse mode

2 participants