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

send ZLP to terminate packet size aligned transfers #2564

Closed
wants to merge 2 commits into from

Conversation

duckylotl
Copy link
Contributor

Describe the PR
add NCM transfer termination by ZLP if necessary.
If NCM transfer aligns with (multiple) USB packet size the transfer has to be terminated with a ZLP.

This PR also lowers the likelihood of needing a ZLP to terminate a transfer.

Additional context
The driver implementation increased likelihood for this happening by always sending a multiple of 4 bytes in an NCM transfer, caused by including the padding bytes to the next NCM datagram, this however is not required. So by only sending the actual NCM payload length (without the padding to a next, not appended, NCM datagram) the complete USB transfer is no longer always a multiple of 4 bytes, reducing the likelihood of hitting a multiple of USB packet size. Thus terminating the transfer by short packet instead of requiring an extra ZLP.

#2068 Does mention the ZLP problem as well, but aims to improve performance.
Instead of replacing the driver completely (like #2227 ) this PR aims to just fix this one bug with minimal impact.

use un-padded payload size to reduce chance of requiring ZLP
@duckylotl
Copy link
Contributor Author

Any comments regarding my changes?

As far as I can tell the failing checks are limited to hil-test runs which all fail because of them not finding a serial port / bootloader to connect to. This sounds to me like a problem in the test setup not with my changes.

@HiFiPhile
Copy link
Collaborator

Thanks for your PR, since #2227 has been merged it's no longer needed.

@HiFiPhile HiFiPhile closed this May 7, 2024
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