-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Minor fix to improve the portability #935
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request! Out of curiosity...on what platform were you trying to build iperf3? I'm just wondering what the OS and hardware is. |
I am trying to port iperf3 to NuttX( a realtime operating system) and test on Photon and Simulator. |
That's great, thanks. I'm looking over the changes...there are a lot of them so I'm trying to see if I can review and merge them one or two at a time. |
Cherry-picked 9dab732. |
Of the commits in this PR I haven't merged so far, I have the following questions/comments: Regarding 98c8683 : I'm going to merge this...I was debating whether to just fix this by importing a new cJSON, but that's a potentially big undertaking. Regarding f9dd48e : Regarding ecb8c31 : We want to keep this code as-is...if the user doesn't specify a Regarding af35a48 : I'm not sure how to evaluate this change. Are you saying because we Regarding 69fb9dd : Can you describe a little more detail about the starvation problem that is solved by this change? Regarding 9098e1d : Is this change just to make the client and server code more consistent? I'm just asking this because I've gotten bit by making changes like this in places where the ordering of various steps is actually important to preserve. So I tend to shy away from making changes like this unless we've tested them really well. |
the similar change also exist in the offical git: https://github.com/DaveGamble/cJSON Part of #935. Change-Id: I3d98de3ec893ccf0b0cab37acc2dbfef00d9e2b6 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> (cherry picked from commit 98c8683) Signed-off-by: Bruce A. Mah <bmah@es.net>
Cherry-picked 98c8683. |
Yes, the global variables for each application just initialize once in NuttX, the global variables keep the previous value in the second invocation. For iperf3, "/dev/urandom" isn't opened in the second launch. Here has the more explanation:
I made this change just because NuttX doesn't support SO_SNDBUF/SO_RCVBUF, how about we query the buffer size regardless of -w flag, but don't exit the test if getsockopt return error?
Yes, unlink with MAP_SHARED equals MAP_PRIVATE. MAP_PRIVATE has copy-on-write semantics and is very hard to implement without MMU, but most hardware running NuttX don't have MMU, that's why I made this change.
If we monitor write_set unconditionally, select will return immediately without sleeping since we haven't sent anything then the buffer should be always available, but iperf_send is called to consume the buffer ony when the state equals to TEST_RUNNING. Then you will see while become a busy loop until the state transit to TEST_RUNNING.
The change is also a good thing to let the client initiate the close process. Here has a clean explanation: |
avoid frandom keep the previous value in the second run Change-Id: I7bd66d003b0cc3fccd9720624fbee7aa9053fa4f Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib82a4e021a6fb5f40f82e1f2c1bae580bb4d2f93 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id90d02dd60fd3c41aa1dc08d67d22902c19e0f90 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
avoid the continue writable socket state starve the whole system because the test start the transmit only in TEST_RUNNING state. Change-Id: I5f0a06ba8e3d8a6bba5cef84d97a8bc25afed6f1 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2157e78e3cfd528c6922ec39319470ab6ea3180d Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
9098e1d
to
7c5129e
Compare
PLEASE NOTE the following text from the iperf3 license. Submitting a
pull request to the iperf3 repository constitutes "[making]
Enhancements available...publicly":
The complete iperf3 license is available in the
LICENSE
file in thetop directory of the iperf3 source tree.
Version of iperf3 (or development branch, such as
master
or3.1-STABLE
) to which this pull request applies:Issues fixed (if any):
Brief description of code changes (suitable for use as a commit message):