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

UDP TX performance improvement #75610

Open
ssharks opened this issue Jul 8, 2024 · 6 comments
Open

UDP TX performance improvement #75610

ssharks opened this issue Jul 8, 2024 · 6 comments
Assignees
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features

Comments

@ssharks
Copy link
Collaborator

ssharks commented Jul 8, 2024

Is your enhancement proposal related to a problem?
On two independent boards the UDP TX performance is lower then the UDP RX performance.

On an ST based system (nucleo_h723zg), as mentioned in:
#75281

UDP      TX          RX
     76.08 Mbps  93.62 Mbps
TCP      TX          RX
     74.19 Mbps  85.51 Mbps

By thesis report on an NXP board
https://is.muni.cz/th/p6jl9/

The relevant table
image

Describe the solution you'd like
Look into the reason why the UDP TX throughput is lower then the UDP RX throughput

@ssharks ssharks added the Enhancement Changes/Updates/Additions to existing features label Jul 8, 2024
@ssharks
Copy link
Collaborator Author

ssharks commented Jul 8, 2024

@dleach02 @jukkar @rlubos I created this issue to keep track of any investigation on why the UDP TX might be slower than the UDP RX.

@dleach02
Copy link
Member

The other part of this is understanding why the RX side is consistently slower then lwip

@ssharks
Copy link
Collaborator Author

ssharks commented Jul 11, 2024

The other part of this is understanding why the RX side is consistently slower then lwip

Could you detail what you mean? The table in the description shows comparable results for LWIP and Zephyr on UDP RX and Zephyr is even faster at TCP RX.

@dleach02
Copy link
Member

maybe I'm mixing the directions. The "upload" tests are consistently slower then lwip.

@ssharks
Copy link
Collaborator Author

ssharks commented Jul 15, 2024

@dleach02 mentioned earlier that one of his suspects for this issue is the number of context switches when sending packets.
@rlubos /@dleach02 Do you think it makes sense to make a test version that hands over not every packet directly to the TX thread, but only ever 4 packets? And do you has the possibility to test the impact?
If this gives a significant difference, this gives at least some direction to solving this.

@rlubos
Copy link
Contributor

rlubos commented Jul 15, 2024

@dleach02 mentioned earlier that one of his suspects for this issue is the number of context switches when sending packets.

That could be easily verified if you set CONFIG_NET_TC_TX_COUNT=0 - that way all network stack processing (from the socket all way down to the driver) should be done from the application thread. Hovewer, as I mentioned already in other places, at least with STM it gave worse results due to driver's blocking nature.

@rlubos /@dleach02 Do you think it makes sense to make a test version that hands over not every packet directly to the TX thread, but only ever 4 packets? And do you has the possibility to test the impact?

I guess that could be doable with some hacking, I may try this out when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

6 participants