Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NET_SOFTERROR on UDP send EAGAIN/EINTR errno if no data was sent #1379

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

davidBar-On
Copy link
Contributor

@davidBar-On davidBar-On commented Aug 19, 2022

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:
    master

  • Issues fixed (if any):
    None

  • Brief description of code changes (suitable for use as a commit message):

Change Nwrite() to return NET_FOFERROR on errno EINTR or EAGAIN if no data was sent yet, similar to what is already implemented in Nsendfile().

In addition, add debug message in case UDP send failed with NET_SOFTERROR. This is to help evaluating issues such as #1367. The message is printed on --debug=3 (or higher level), so it will be possible to see it without seeing a message per UDP packet sent (which is the case when -d or --debug=4 is used).

@davidBar-On davidBar-On force-pushed the UDP-NET_SOFTERROR-debug-message branch from ec1be7d to 6a62b42 Compare August 19, 2022 13:19
@davidBar-On davidBar-On changed the title Add error message in case of UDP send NET_SOFTERROR NET_SOFTERROR on UDP send EAGAIN/EINTR errno if no data was sent Aug 19, 2022
@davidBar-On davidBar-On force-pushed the UDP-NET_SOFTERROR-debug-message branch from 6a62b42 to b6c22e6 Compare August 20, 2022 08:05
@swlars
Copy link
Contributor

swlars commented Nov 7, 2024

Hi David! Thanks for the merge request! It looks like part of this was merged already, but we're not quite sure how to test the last few lines.

@davidBar-On
Copy link
Contributor Author

davidBar-On commented Nov 8, 2024

Hi Sarah, I assume you are asking about the indentation changes in lines 507-510 in net.c. I don't remember what they are, but I suspect these changes are because I copied the relevant lines from Nsendfile(). By the way, there are indentations problems in both Nwrite() and nSendfile() - the code following the case/default is not indented. I didn't make these changes to minimuze the changes in the code.

Just to make sure I fully answer the question, regarding the following that was added in Nwrite():

    if (count == nleft)
        return NET_SOFTERROR;

This is copied from Nsendfile() and is the suggested fix to #1367 - when a UDP packet was not sent, do not count it as sent and do not increase the UDP packets number. See this comment.

@swlars swlars merged commit d595ee6 into esnet:master Dec 6, 2024
3 checks passed
@swlars
Copy link
Contributor

swlars commented Dec 6, 2024

Looks good! Thanks for the merge request!

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.

2 participants