Repository navigation
Test: integrate PSH and ARP optimization configuration coverage - #1385
Draft
StitchLilo626 wants to merge 11 commits into
Draft
StitchLilo626 wants to merge 11 commits into
StitchLilo626 wants to merge 11 commits into
Conversation
A Linux peer ACKs every segment that carries PSH at once, so setting PSH on every data segment makes a sender with several segments queued get one ACK per segment. - ipconfigTCP_PSH_ON_LAST_SEGMENT_ONLY sets PSH only on the segment that carries the last queued byte, as other stacks do. - It is off by default, and nothing changes while it is off.
A connected TCP socket can now send each segment to the peer MAC in its header template, and search the ARP cache only after the peer has been quiet for a while, as RFC 1122 2.3.2.1 allows. - ipconfigTCP_SKIP_ARP_LOOKUP_MS sets how long the peer may be quiet before the stack searches the cache again, and a hit then replaces the MAC in the template. - The search runs for every sent segment and limits send throughput on a slow CPU. - The default is 0, which searches the cache for every segment as before.
The proof runs once with the default configuration and once with the skip enabled, so CI checks the code that the option compiles in.
The skip reads the time of the socket's last activity, which only hang protection keeps, so a build without it failed with a missing member. It now stops with an error that names the option it needs. That time also moves on every state change, so the description no longer says it is only the time the peer was heard from.
A sender that keeps its queue full never empties it, so PSH would never be set. A receiver that waits for PSH before it hands data to the application then holds the data until its buffer fills. Linux sets PSH in the same case.
The proof now also runs with PSH set only on the last segment, so CI checks the code that the option compiles in.
This branch has not been deployed
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.
Description
Both #1381 and #1382 add
test/unit-test/FreeRTOS_TCP_Transmission_DiffConfig/, with different configuration headers and test sources. Merging them produces add/add conflicts inFreeRTOSIPConfig.handFreeRTOS_TCP_Transmission_DiffConfig_utest.c. This draft integrates that shared suite and verifies the two options together and independently.Dependency and attribution: this branch includes comotion's original commits from #1381 (
e5d21da3) and #1382 (c6e6ff09), preserving their authorship. Both PRs are still open. The production changes are exactly those from the two original PRs. The integration resolves the two test conflicts, and the follow-up commit5f9beab5changes only tests and test build configuration. That follow-up is available for reuse after the feature changes are integrated.Annexed_TCPcopy removes those definitions.prvTCPReturnPacket(), checking PSH, ACK, packet length, destination MAC and output count.Test Steps
Tested on WSL Ubuntu 24.04 x86_64 with GCC 13.3.0, CMake 3.28.3, Ninja, Ruby 3.2.3 and unifdef 2.12, using the repository-pinned Kernel/CMock/Unity dependencies.
cmake -G Ninja -S test/unit-test -B work/build \ -DBUILD_CLONE_SUBMODULES=OFF -DSANITIZE= cmake --build work/build -j 8 --target \ FreeRTOS_TCP_Transmission_DiffConfig_utest \ FreeRTOS_TCP_Transmission_DiffConfig_PSHOnly_utest \ FreeRTOS_TCP_Transmission_DiffConfig_ARPOnly_utest \ FreeRTOS_TCP_Transmission_DiffConfig_Disabled_utest \ FreeRTOS_TCP_Transmission_DiffConfig_Defaults_utest \ FreeRTOS_TCP_Transmission_utest \ FreeRTOS_TCP_Transmission_IPv6_utest ctest --test-dir work/build \ -R '^FreeRTOS_TCP_Transmission.*_utest$' --verbose --output-on-failureResult: 7/7 CTest targets, 154/154 Unity cases passed, zero failures or ignored cases. Hang protection was enabled for these runs. The original four cases also passed in the minimal merged version before the matrix was added.
The initial matrix run exposed two fixture problems (stripped default definitions and a helper-local pointer retained by CMock); both were fixed before the successful final run, without changing production code.
Separate configuration failure reproduced in #1382: with
ipconfigTCP_HANG_PROTECTION=0, compilingFreeRTOS_TCP_Transmission_IPv4.csucceeds whenipconfigTCP_SKIP_ARP_LOOKUP_MS=0, but fails when it is1000:IPTCPSocket_thas no member namedxLastActTime. Both the member declaration and its update inprvTCPTouchSocket()are conditional on hang protection. This draft leaves that production issue visible for resolution in the feature change. The timestamp is also refreshed on TCP state changes, so it is not exclusively the last peer-receive time.Not run locally: the full repository test suite, sanitizers, coverage thresholds, board throughput measurements, or an IPv6-specific matrix with the PSH option enabled. The existing IPv6 suite uses defaults. Host tick wrap was checked with the POSIX port's 64-bit
TickType_t; this does not establish 16/32-bit target behavior.Checklist:
Related Issue
#1380
Depends on #1381 and #1382.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.