drivers/usbdev/cdcncm: send TX immediately, not after a tick-quantized delay

cdcncm_send() defers each transmit with MSEC2TICK(CDCNCM_DGRAM_COMBINE_PERIOD)
(1 ms). MSEC2TICK() rounds up to the system tick, so at the default 100 Hz tick
the "1 ms" coalescing window becomes a full 10 ms tick (10-20 ms with phase),
adding that latency to every single-datagram reply (ICMP echo, TCP ACK, one-MSS
HTTP segment) and dominating the CDC-NCM round-trip time.

The window only coalesces datagrams appended within the same synchronous TX
burst (already queued before the worker runs), so an inter-burst delay adds
latency without batching benefit in the common case. Fire the transmit worker
immediately (delay 0); within-burst coalescing is preserved.

On RP2350 (Pico 2 W) USB-NIC at 100 Hz tick: ping RTT 21.7 -> 2.8 ms, a 257 KB
HTTP download 5.79 -> 0.92 s (44.5 -> 279 KB/s).

Signed-off-by: Ricard Rosson <ricard@groundbits.com>
Assisted-by: Claude (Anthropic Claude Code)
Signed-off-by: Ricard Rosson <ricard@groundbits.com>
1 file changed
tree: 72ff4b895ade6e96fc20ac395653d9dbd9529de7
  1. .github/
  2. arch/
  3. audio/
  4. binfmt/
  5. boards/
  6. cmake/
  7. crypto/
  8. Documentation/
  9. drivers/
  10. dummy/
  11. fs/
  12. graphics/
  13. include/
  14. libs/
  15. mm/
  16. net/
  17. openamp/
  18. pass1/
  19. sched/
  20. syscall/
  21. tools/
  22. video/
  23. wireless/
  24. .asf.yaml
  25. .codespell-ignore-lines
  26. .codespellrc
  27. .editorconfig
  28. .gitignore
  29. .gitmessage
  30. .pre-commit-config.yaml
  31. .yamllint
  32. AUTHORS
  33. CMakeLists.txt
  34. CONTRIBUTING.md
  35. INVIOLABLES.md
  36. Kconfig
  37. LICENSE
  38. Makefile
  39. NOTICE
  40. README.md
  41. ReleaseNotes
README.md

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge MemBrowse

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.