fix(mesh): don't evict ACKs when a background-priority packet arrives full#10435
Open
DatanoiseTV wants to merge 1 commit into
Open
fix(mesh): don't evict ACKs when a background-priority packet arrives full#10435DatanoiseTV wants to merge 1 commit into
DatanoiseTV wants to merge 1 commit into
Conversation
fromRadioQueue is a plain FIFO of size 4. When it fills, the prior behaviour was to drop the oldest packet — usually a routing ACK or reply — to make room for whatever just arrived, even if the new packet was BACKGROUND priority. Reverse that for the low-priority case: if the incoming packet's priority is at or below BACKGROUND, drop it instead. Higher-priority arrivals still evict to fit. PointerQueue doesn't expose iteration, so a full priority-queue refactor would be a larger change; this addresses the worst case.
8 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves receive-side routing reliability by changing Router::enqueueReceivedMessage() to avoid evicting already-queued packets (often ACKs/routing replies) when fromRadioQueue is full and the newly arrived packet is low priority (≤ BACKGROUND). This targets a worst-case behavior where a burst of low-priority traffic could displace higher-value control-plane packets.
Changes:
- Drop incoming packets with priority ≤
BACKGROUNDwhenfromRadioQueueis full, instead of evicting the oldest queued packet. - Preserve the prior “evict oldest until it fits” behavior for higher-priority incoming packets.
| if (!fromRadioQueue.enqueue(p, 0)) { | ||
| if (p->priority != meshtastic_MeshPacket_Priority_UNSET && p->priority <= meshtastic_MeshPacket_Priority_BACKGROUND) { | ||
| printPacket("fromRadioQ full, drop incoming low-prio!", p); | ||
| packetPool.release(p); |
Member
|
Are you observing that the FIFO ever gets full? |
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.
fromRadioQueue is a plain FIFO of size 4. When it fills, the prior
behaviour was to drop the oldest packet — usually a routing ACK or
reply — to make room for whatever just arrived, even if the new packet
was BACKGROUND priority. Reverse that for the low-priority case: if
the incoming packet's priority is at or below BACKGROUND, drop it
instead. Higher-priority arrivals still evict to fit. PointerQueue
doesn't expose iteration, so a full priority-queue refactor would be a
larger change; this addresses the worst case.
Split out from #10424 per @thebentern's request — single-concern PR.
Build verification
pio run -e t-deck-tftsucceeds, no new warnings.Attestations
t-deck-tftonly.