-
Notifications
You must be signed in to change notification settings - Fork 7.4k
zperf time handling fixes #30237
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
zperf time handling fixes #30237
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments related to upcoming restrictions of use of internal API, and signed/unsigned nit-picks. I wish absolute times in ticks were represented as unsigned, but they're not.
Currently the code uses hw cycles and tries to convert them to usec. I noticed some failures with this, for example the test duration was sometimes missed meaning that instead of testing 5 seconds, we bailed out after 2 sec etc. After the kernel k_timeout_t changes, which added APIs to support usec accuracy, we can use usec and ticks here. This simplifies the code a bit. Signed-off-by: Jukka Rissanen <[email protected]>
If user has enabled DHCPv4, then allow to use its address instead of giving error if static address cannot be set. Similar fix for IPv6, so allow user to manually set an IPv6 address. Because DHCPv4 has already set the IPv4 address to the network interface, then zperf might not be able to add the pre-configured address to it. So instead of returning immediately, try to use the IP address that is already in the network interface. This way we avoid this error print. uart:~$ zperf udp download 5001 Setting IP address 2001:db8::1 Setting destination IP address 2001:db8::2 Cannot set IPv4 address 192.0.2.1 Unable to set IP Setting destination IP address 192.0.2.2 Cannot set IPv4 address 192.0.2.1 Unable to set IPv4 Binding to 192.0.2.1 Cannot bind IPv4 UDP port 5001 (-2) In this example, the network interface already had a proper and working IPv4 address 192.168.0.2 in it. Signed-off-by: Jukka Rissanen <[email protected]>
Updated according to comments. |
I agree, the fact that some of the ticks/time/timeout functions use signed and some unsigned is quite confusing. |
Converted the code to use usec accuracy time functions that the kernel provides currently.
Also noticed IP address setting issue when testing the changes.