Repository navigation
Conversation
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.
2 tasks done
htibosch
reviewed
Nov 9, 2026
htibosch
left a comment
Contributor
There was a problem hiding this comment.
I will test this PR and come back to it. I like it.
| } | ||
| #else /* if ( ipconfigTCP_SKIP_ARP_LOOKUP_MS > 0U ) */ | ||
| { | ||
| eResult = eARPGetCacheEntry( &ulDestinationIPAddress, &xMACAddress, &pxEndPoint ); |
Contributor
There was a problem hiding this comment.
Hi @comotion
You are right, this was a waste of time to call eARPGetCacheEntry over and again, knowing that the function has no optimisation.
This is indeed the place to store the counter MAC-address:
pxSocket->u.xTCP.xPacket.u.ucLastPacket )->xEthernetHeader.xSourceAddress.ucBytes.
I am curious what other developers think about this proposal. I like it!
I will test it together with your PR #1381
Thanks,
Hein
2 tasks done
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.
Author
|
Thanks for testing. I'm adding CBMC proof run for this branch and a dependency on ipconfigTCP_HANG_PROTECTION, since the build fails if that is set to off. |
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.
Skip the ARP cache search for an active TCP peer
Description
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.
The search runs for every sent segment and limits send throughput ona slow CPU.
Test Steps
Measure transmit speeds for MSS, 16KB and 256KB transmits.
My measurements are on a 125MHz Nios-V with a msgDMA ethernet driver and a 10GbE PHY.
On TX, 1514 byte MSS sends this is 8% faster than baseline, 16KB sends, this is 3% faster and on 256KB sends, 2% faster.
Checklist:
Related Issue
#1380
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.