[Nexthop][fboss2-dev] Add CLI command for managing static MAC entries on VLANs#837
Closed
benoit-nexthop wants to merge 1 commit intofacebook:mainfrom
Closed
[Nexthop][fboss2-dev] Add CLI command for managing static MAC entries on VLANs#837benoit-nexthop wants to merge 1 commit intofacebook:mainfrom
benoit-nexthop wants to merge 1 commit intofacebook:mainfrom
Conversation
This was referenced Jan 26, 2026
03e8084 to
4da44f1
Compare
ea1247d to
c5e8e1b
Compare
meta-codesync bot
pushed a commit
that referenced
this pull request
Mar 5, 2026
…esolution (#832) Summary: **Pre-submission checklist** - [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install` - [x] `pre-commit run` When multiple users have concurrent config sessions, the first user to commit succeeds, but subsequent users get an error because their session is based on a stale commit. Previously, whoever committed last would overwrite changes of other users that committed before them. This commit adds a `config session rebase` command that: 1. Takes the diff between the config as of the base commit and the session 2. Re-applies this diff on top of the current HEAD (similar to git rebase) 3. Uses a recursive 3-way merge algorithm for JSON objects 4. Detects and reports conflicts at specific JSON paths 5. Updates the session's base to the current HEAD on success The 3-way merge algorithm handles: - Objects: recursively merges each key - Arrays: element-by-element merge if sizes match - Scalars: conflict if both head and session changed differently from base Note: this change is part of a series, the previous one is #825, the next one is #837. Pull Request resolved: #832 Test Plan: Add unit tests covering: - Successful rebase with non-conflicting changes - Rebase failure when changes conflict - Rebase not needed when session is already up-to-date ## Sample usage TBD Reviewed By: srikrishnagopu Differential Revision: D95099578 Pulled By: joseph5wu fbshipit-source-id: b665afa35a43829981ce9dd8434abf5b3942882a
c5e8e1b to
cf2969f
Compare
|
@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D95454566. |
Add new fboss2-dev CLI commands for managing static MAC address entries on VLANs: - `config vlan <vlan-id> static-mac add <mac-address> <port-id>` - `config vlan <vlan-id> static-mac delete <mac-address>` These commands allow operators to configure static MAC address entries in the FBOSS switch configuration, which is useful for scenarios where MAC addresses need to be pinned to specific ports. Features: * VLAN ID validation (1-4094 range) * MAC address format validation * Port existence validation with automatic logical ID resolution * Duplicate entry detection for add operations * Integration with ConfigSession for proper config management Unit Tests: ``` ./fboss/oss/scripts/nhfboss-test.sh --timeout 30 --retry 0 --filter 'CmdConfigVlanStaticMac' Output: [==========] Running 33 tests from 1 test suite. ... [ PASSED ] 33 tests. ``` Manual CLI Testing: ``` $ fboss2-dev config vlan 2001 static-mac add 02:00:00:E2:E2:01 eth1/1/1 Successfully added static MAC entry: MAC 02:00:00:E2:E2:01 -> VLAN 2001, Port eth1/1/1 (ID 9) $ fboss2-dev config session commit Config session committed successfully as r77 and config reloaded. $ fboss2-dev config vlan 2001 static-mac delete 02:00:00:E2:E2:01 Successfully deleted static MAC entry: MAC 02:00:00:E2:E2:01 from VLAN 2001 ```
cf2969f to
ce44eea
Compare
Contributor
|
@benoit-nexthop has updated the pull request. You must reimport the pull request before landing. |
|
@joseph5wu merged this pull request in d3a68c6. |
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.
Add new fboss2-dev CLI commands for managing static MAC address entries
on VLANs:
config vlan <vlan-id> static-mac add <mac-address> <port-id>config vlan <vlan-id> static-mac delete <mac-address>These commands allow operators to configure static MAC address entries
in the FBOSS switch configuration, which is useful for scenarios where
MAC addresses need to be pinned to specific ports.
Features:
Unit tests:
Note: this change is part of a series, the previous one is #832, the next one is #838.
Sample usage
Original change by @manoharan-nexthop