Skip to content

config: add 'config mac add/del' for static FDB entries - #4713

Open
AnantKishorSharma wants to merge 1 commit into
sonic-net:masterfrom
AnantKishorSharma:config-mac-static-fdb
Open

config: add 'config mac add/del' for static FDB entries#4713
AnantKishorSharma wants to merge 1 commit into
sonic-net:masterfrom
AnantKishorSharma:config-mac-static-fdb

Conversation

@AnantKishorSharma

@AnantKishorSharma AnantKishorSharma commented Jul 22, 2026

Copy link
Copy Markdown

What I did

Added a config mac command group for static MAC (FDB) entries via CONFIG_DB:
config mac add <mac> <vlan> <interface> and config mac del <mac> <vlan>. Both write the
CONFIG_DB FDB table (consumed by vlanmgr, modeled by sonic-fdb.yang). Part of
config-driven static L2 forwarding — HLD sonic-net/SONiC#2468.

How I did it

Added the mac click group + add/del subcommands with MAC/VLAN/interface validation;
they set/clear the FDB table entry (Vlan, mac) → {port} in CONFIG_DB.

How to verify it

Unit tests tests/config_mac_test.py (add/del + validation). Hardware: config mac add/del
→ CONFIG_DB FDB → APPL FDB_TABLE → ASIC SAI_FDB_ENTRY_TYPE_STATIC; the target MAC is
forwarded to the configured port.

Previous command output (if the output of a command-line utility has changed)

N/A — new command.

New command output (if the output of a command-line utility has changed)

admin@sonic:~$ sudo config mac add 00:11:22:33:44:55 100 Ethernet72
admin@sonic:~$ sudo config mac del 00:11:22:33:44:55 100

@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).

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

@AnantKishorSharma
AnantKishorSharma marked this pull request as ready for review July 22, 2026 10:06
@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

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