Skip to content

[fdbsyncd]: Make VXLAN FDB delete idempotent#4674

Merged
prsunny merged 2 commits into
sonic-net:masterfrom
tahmed-dev:fix/pr4615-vxlan-fdb-delete-idempotent
Jun 16, 2026
Merged

[fdbsyncd]: Make VXLAN FDB delete idempotent#4674
prsunny merged 2 commits into
sonic-net:masterfrom
tahmed-dev:fix/pr4615-vxlan-fdb-delete-idempotent

Conversation

@tahmed-dev

Copy link
Copy Markdown
Contributor

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 #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.

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

  • Changed the missing-entry log in FdbSync::macDelVxlan() from SWSS_LOG_ERROR to SWSS_LOG_INFO.
  • Extended the existing TestMacDelVxlan C++/GMock test to call macDelVxlan() twice and verify the cache remains empty after the duplicate delete.

How I verified it

Validated from sonic-buildimage using the official SONiC bookworm slave build flow:

BLDENV=bookworm SONIC_BUILD_JOBS=4 make -f Makefile.work target/debs/bookworm/swss_1.0.0_amd64.deb-clean
BLDENV=bookworm SONIC_BUILD_JOBS=4 make -f Makefile.work target/debs/bookworm/swss_1.0.0_amd64.deb

Results from target/debs/bookworm/swss_1.0.0_amd64.deb.log:

  • swss_1.0.0_amd64.deb built successfully.
  • dh_auto_test ran.
  • 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.

Signed-off-by: Tamer Ahmed <tamerahmed@microsoft.com>
@tahmed-dev
tahmed-dev requested a review from prsunny as a code owner June 15, 2026 16:29
Copilot AI review requested due to automatic review settings June 15, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread fdbsyncd/fdbsync.cpp Outdated
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);
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Tamer Ahmed <tamerahmed@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@prsunny

prsunny commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

@tahmed-dev , could you link the github issue? @prabhataravind for viz

@yijingyan2

Copy link
Copy Markdown
Contributor

Hi @prsunny, is this PR ready to merge? Thanks

@mssonicbld

Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants