[fdbsyncd]: Make VXLAN FDB delete idempotent#4674
Merged
prsunny merged 2 commits intoJun 16, 2026
Merged
Conversation
Signed-off-by: Tamer Ahmed <tamerahmed@microsoft.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Makes VXLAN FDB delete handling idempotent and reduces severity of logs when a delete arrives for a non-cached entry.
Changes:
- Update unit test to assert
macDelVxlan()removes the entry and tolerates a repeated delete. - Downgrade “missing entry” log from ERROR to INFO with a clearer message.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/mock_tests/fdbsyncd/fdbsyncd_ut.cpp | Strengthens test expectations around idempotent VXLAN FDB delete behavior. |
| fdbsyncd/fdbsync.cpp | Adjusts logging when a VXLAN FDB delete is received for an unknown key. |
| m_mac.erase(key); | ||
| } else { | ||
| SWSS_LOG_ERROR("DEL_KEY %s entry doesn't exist", key.c_str()); | ||
| SWSS_LOG_INFO("DEL_KEY %s ignored; entry is not present in VXLAN FDB cache", key.c_str()); |
Comment on lines
+1557
to
+1561
| ASSERT_EQ(m_mockFdbSync.m_mac.count(key), 0); | ||
|
|
||
| // A later kernel delete for the same VXLAN FDB entry is expected after a local MAC wins. | ||
| m_mockFdbSync.macDelVxlan(key); | ||
| ASSERT_EQ(m_mockFdbSync.m_mac.count(key), 0); |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Tamer Ahmed <tamerahmed@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prsunny
approved these changes
Jun 15, 2026
Collaborator
|
@tahmed-dev , could you link the github issue? @prabhataravind for viz |
Contributor
|
Hi @prsunny, is this PR ready to merge? Thanks |
Collaborator
|
Cherry-pick PR to msft-202606: Azure/sonic-swss.msft#247 |
Yogapriya-cisco
pushed a commit
to prhoskot/sonic-swss
that referenced
this pull request
Jul 13, 2026
What I did Make duplicate VXLAN FDB delete handling idempotent in fdbsyncd by lowering the missing-entry path in FdbSync::macDelVxlan() from error-level logging to info-level logging. This fixes the regression introduced by PR sonic-net#4615 where an expected later kernel delete for a VXLAN FDB entry could log: macDelVxlan: DEL_KEY <key> entry doesn't exist That message was treated as a syslog error by loganalyzer in sonic-buildimage PR sonic-net/sonic-buildimage#27663, causing vxlan/test_vxlan_decap.py::test_vxlan_decap[Enabled] to fail even though the VXLAN decap dataplane test body passed. Signed-off-by: Yogapriya Mohankumar <ymohanku@cisco.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.
What I did
Make duplicate VXLAN FDB delete handling idempotent in
fdbsyncdby lowering the missing-entry path inFdbSync::macDelVxlan()from error-level logging to info-level logging.This fixes the regression introduced by PR #4615 where an expected later kernel delete for a VXLAN FDB entry could log:
That message was treated as a syslog error by loganalyzer in
sonic-buildimagePR sonic-net/sonic-buildimage#27663, causingvxlan/test_vxlan_decap.py::test_vxlan_decap[Enabled]to fail even though the VXLAN decap dataplane test body passed.Why I did it
When a remote/VXLAN-learned MAC is replaced by a local MAC,
updateLocalMac()intentionally removes the entry from the VXLAN FDB cache. A later kernel delete event for the same VXLAN FDB entry is expected and should be a no-op, not an error.Before PR #4615, this missing-cache-entry delete path was silently ignored. This change restores the idempotent behavior while still leaving an info-level trace for debugging.
How I did it
FdbSync::macDelVxlan()fromSWSS_LOG_ERRORtoSWSS_LOG_INFO.TestMacDelVxlanC++/GMock test to callmacDelVxlan()twice and verify the cache remains empty after the duplicate delete.How I verified it
Validated from
sonic-buildimageusing the official SONiC bookworm slave build flow:Results from
target/debs/bookworm/swss_1.0.0_amd64.deb.log:swss_1.0.0_amd64.debbuilt successfully.dh_auto_testran.orchagent/p4orch/tests: 770 passed, 3 skipped, 0 failed, 0 errors.tests/mock_tests: 1071 passed, 1 skipped, 0 failed, 0 errors.tests: 70 passed, 0 failed, 0 errors.