[code sync] Merge code from sonic-net/sonic-swss:202511 to 202601#241
Merged
Conversation
mssonicbld
commented
Jun 20, 2026
Collaborator
**What I did**
Clean up the stale `PFC_WD_TABLE_INSTORM:<port>` entry in APPL_DB when PFC watchdog is stopped on a port. In `PfcWdSwOrch::unregisterFromWdDb()`, the per-queue cleanup loop already removed the COUNTERS_DB watchdog fields; this change additionally drops each queue's field from the port's `INSTORM` hash so the table is consistent once watchdog is stopped.
**Why I did it**
When PFC watchdog is stopped on a port while one or more of its queues are in storm, the per-queue fields under `PFC_WD_TABLE_INSTORM:<port>` were left behind (e.g. `PFC_WD_TABLE_INSTORM:Ethernet20` -> `{'3':'storm','4':'storm'}`) with no active storm.
The stale row is replayed on warm boot: on startup, pfcwdorch drains the `APP_PFC_WD_TABLE` consumer, reads the stale in-storm queues, and re-enters the storm handler even though no storm exists.
**How I verified it**
- `pfcwd start` on a port, inject a storm so the queue is detected as stormed and `PFC_WD_TABLE_INSTORM:<port>` is populated.
- `pfcwd stop <port>`; confirm `sonic-db-cli APPL_DB HGETALL PFC_WD_TABLE_INSTORM:<port>` returns `{}`.
- Warm restart swss with no active storm; confirm the port no longer comes up in `show pfcwd stats` as stormed.
**Details if related**
Related to #1691, which addresses the same stale in-storm state for warm-reboot but also bundles a broader portsorch/big-red-switch refactor and has remained unmerged since 2021. This PR is a minimal, self-contained fix for the pfcwd-stop case only.
Fixes #4667
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
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.