ntfc: Add optional line-buffered transport writes. - #10
Merged
Conversation
3 tasks
casaroli
marked this pull request as ready for review
July 26, 2026 13:06
casaroli
force-pushed
the
feat/optional-line-buffering
branch
from
July 26, 2026 13:42
356f838 to
0c7b712
Compare
Contributor
Author
|
@cederom i added the coverage. can you please let the workflows run again? |
Contributor
Author
|
@raiden00pl this will make the sim-1 job in nuttx 4x faster |
Member
|
I'll look at it tomorrow, but it looks good. It's nice that new contributors appear :) |
raiden00pl
reviewed
Jul 27, 2026
xiaoxiang781216
approved these changes
Aug 4, 2026
xiaoxiang781216
approved these changes
Aug 31, 2026
|
@casaroli please fix the conflict. |
Add the line_buffered per-core configuration option, disabled by default, to retain the existing byte-wise transport behavior. When enabled, the simulator and serial transports write a complete command in one operation. Buffered simulator writes also disable pexpect per-send delay. This improves local simulator performance and supports serial transports with reliable flow control. Document the option and cover both default and buffered command writes. Assisted-by: ChatGPT:GPT-5.6-Terra Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli
force-pushed
the
feat/optional-line-buffering
branch
from
August 31, 2026 08:08
3e07a03 to
000fb3c
Compare
xiaoxiang781216
approved these changes
Aug 31, 2026
|
@casaroli please fix the lint error: https://github.com/apache/nuttx-ntfc/actions/runs/33371507879/job/99426396891?pr=10 |
The per-send delay was turned off by DeviceSim._start_impl() after host_open() returned. A device that crashes comes back through _dev_reopen(), which calls host_open() directly and never reaches the device's own start, so the setting was lost for the rest of the run. Setting it in host_open() keeps it across a reopen, and covers QEMU as well as the simulator, since both are host-based devices. It changes nothing for either unless line_buffered is set, which is off by default. The test moves with the behaviour: it now opens a device, reopens it and checks the delay is still off. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
DeviceSim goes through get_os(), which refuses a configuration whose os it does not recognise. The other sim tests set it on the mock and this one did not, so it raised before reaching what it meant to check. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli
force-pushed
the
feat/optional-line-buffering
branch
from
August 31, 2026 09:00
000fb3c to
33c92fd
Compare
xiaoxiang781216
approved these changes
Aug 31, 2026
acassis
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the per-core line_buffered configuration option. It is disabled by default, preserving existing byte-wise writes for serial transports without flow control.
When enabled, sim and serial write an entire command in one operation. Buffered sim commands also disable the pexpect per-send delay. This reduces local simulator overhead and supports serial targets with reliable flow control.
Impact
Testing
PR verification self-check
Assisted-by: ChatGPT:GPT-5.6-Terra