Skip to content

Conversation

@JordanYates
Copy link
Contributor

@JordanYates JordanYates commented Nov 22, 2025

Do not artificially limit the size of the USB request to the endpoint size, as this forces multiple round trips through the CDC ACM class implementation when the TX FIFO is larger than the endpoint size. The USB stack handles packetizing to the maximum endpoint size. The maximum allocation size is limited to prevent starving other USB users.

When a custom pool is used for CDC ACM, allow the buffer sizes to be configured in Kconfig.

Throughput testing on a nRF52840DK with CONFIG_UDC_BUF_POOL_SIZE=1024 shows a throughput increase from ~1.7 Mbps to ~2.7 Mbps.

Steps towards improving the issue of #99779, but this is only the absolute lowest hanging fruit).
Throughput tested on the reproducer steps from the linked issue.
The limit of CONFIG_UDC_BUF_POOL_SIZE / 4 was picked out of thin air as a reasonable default, happy to hear arguments against.

Do not artificially limit the size of the USB request to the endpoint
size, as this introduces multiple round trips through the CDC ACM class
implementation. The USB stack handles packetizing to the maximum
endpoint size. The maximum allocation size is limited to prevent
starving other USB users.

Throughput testing on a nRF52840DK with `CONFIG_UDC_BUF_POOL_SIZE=1024`
shows a throughput increase from ~1.7 Mbps to ~2.7 Mbps.

Signed-off-by: Jordan Yates <jordan@embeint.com>
@zephyrbot zephyrbot added the area: USB Universal Serial Bus label Nov 22, 2025
When a custom pool is used for CDC ACM, allow the buffer sizes to be
configured in Kconfig.

Signed-off-by: Jordan Yates <jordan@embeint.com>
@JordanYates JordanYates force-pushed the 251122_cdc_acm_throughput branch from 881dc65 to e88357a Compare November 22, 2025 00:30
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants