Skip to content

Static L2 forwarding: per-VLAN mac_learning, BUM flood control, static FDB#4780

Open
AnantKishorSharma wants to merge 3 commits into
sonic-net:masterfrom
AnantKishorSharma:static-l2-fwd
Open

Static L2 forwarding: per-VLAN mac_learning, BUM flood control, static FDB#4780
AnantKishorSharma wants to merge 3 commits into
sonic-net:masterfrom
AnantKishorSharma:static-l2-fwd

Conversation

@AnantKishorSharma

@AnantKishorSharma AnantKishorSharma commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What I did

Config-driven static L2 forwarding — wires three independent, per-VLAN, SAI-backed
sub-features from CONFIG_DB to the ASIC, each defaulting to today's behavior (no
functional change unless configured). Kept as three commits, one per sub-feature:

  1. Per-VLAN MAC-learning disable — SAI_VLAN_ATTR_LEARN_DISABLE
  2. Per-VLAN BUM flood disable — SAI_VLAN_ATTR_{UNKNOWN_UNICAST,UNKNOWN_MULTICAST,BROADCAST}_FLOOD_CONTROL_TYPE = NONE
  3. Static FDB via CONFIG_DB — vlanmgr consumes the reserved FDB table → APPL FDB_TABLE (type=static); FdbOrch already programs SAI_FDB_ENTRY_TYPE_STATIC (unchanged).

Why I did it

None of these per-VLAN behaviors is configurable today (learning is per-bridge-port only;
per-VLAN flood control is set only internally by proxy_arp / VXLAN-EVPN; the CONFIG_DB FDB
table is reserved but has no consumer). The SAI attributes already exist, so the gap is the
CONFIG_DB schema + config→APPL plumbing. HLD: sonic-net/SONiC#2468.

How I verified it

  • Mock (tests/mock_tests/portsorch_ut.cpp) + VS (tests/test_vlan.py, tests/test_fdb.py) tests.
  • Hardware end-to-end: config apply-patch/gNMI → CONFIG_DB → APPL → ASIC verified for
    LEARN_DISABLE=true, the three *_FLOOD_CONTROL_TYPE=NONE, and SAI_FDB_ENTRY_TYPE_STATIC;
    plus L2 traffic (broadcast not flooded when disabled; unknown-unicast dropped without an
    entry, forwarded once a static FDB entry exists).

Details if related

Needs YANG sonic-net/sonic-buildimage#28545 and the config mac CLI sonic-net/sonic-utilities#4713.
Feature request: sonic-net/sonic-buildimage#28539.

Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

Comment thread tests/dvslib/dvs_vlan.py Fixed
@AnantKishorSharma
AnantKishorSharma marked this pull request as ready for review July 22, 2026 10:07
@azure-pipelines

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

Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

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.

3 participants