Skip to content

[swss] Support per-VLAN MAC learning disable - #4819

Open
thanushgowda123 wants to merge 3 commits into
sonic-net:masterfrom
thanushgowda123:feat/vlan-learn-disable
Open

[swss] Support per-VLAN MAC learning disable#4819
thanushgowda123 wants to merge 3 commits into
sonic-net:masterfrom
thanushgowda123:feat/vlan-learn-disable

Conversation

@thanushgowda123

@thanushgowda123 thanushgowda123 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Implements per-VLAN MAC learning control in SONiC SWSS daemons:

  • vlanmgr: Parses and propagates learn_disable from CONFIG_DB to APPL_DB
  • portsorch: Programs SAI_VLAN_ATTR_LEARN_DISABLE via SAI API
  • DVS Test: End-to-end regression test for complete pipeline

What Changed

cfgmgr/vlanmgr.cpp

  • Reads learn_disable from CONFIG_DB VLAN events
  • Forwards to APPL_DB VLAN_TABLE

orchagent/portsorch.cpp

  • Reads learn_disable from APPL_DB
  • Calls SAI: sai_vlan_api->set_vlan_attribute(vlan_oid, SAI_VLAN_ATTR_LEARN_DISABLE)

tests/test_vlan_mac_learning.py

  • DVS regression test validating complete pipeline

Testing

Tested on:

  • Single Switch Topology: Verified vlanmgr and portsorch functionality, SAI API calls confirmed in syslog
  • Dual Switch + Trunk Topology: Validated multi-switch independence, cross-leaf traffic
  • Leaf-Spine CLOS Fabric: Enterprise-scale validation with 3 leaves and 2 spines

Backward Compatibility

Fully backward compatible - default learning enabled, optional field

Related PRs

Part of a coordinated 3-PR feature submission:

Merge order: buildimage #28861 → swss #4819 (this PR) → utilities #4747

@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown
Collaborator

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants