[Nexthop][fboss2-dev] Add CLI command for configuring trunk VLAN#1097
Open
hillol-nexthop wants to merge 6 commits intofacebook:mainfrom
Open
[Nexthop][fboss2-dev] Add CLI command for configuring trunk VLAN#1097hillol-nexthop wants to merge 6 commits intofacebook:mainfrom
hillol-nexthop wants to merge 6 commits intofacebook:mainfrom
Conversation
dccc722 to
c7d63e3
Compare
b6082aa to
3e8b12c
Compare
…ete handler Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
047074e to
c19188c
Compare
c19188c to
914ada3
Compare
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.
Based on #1096
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
This PR implements trunk VLAN management functionality for the FBOSS CLI, allowing users to add and remove VLANs from trunk ports.
Examples:
Implementation Details
Adding VLANs: Creates VlanPort entries with emitTags=true (tagged traffic) for each port-VLAN combination
Removing VLANs: Removes the corresponding VlanPort entries from the configuration
Validation:
VLANs must exist in the configuration with an associated interface (SVI)
Ports must exist in the hardware platform mapping
VLAN IDs must be in the valid range (1-4094)
Idempotency: Adding an existing VLAN or removing a non-existent VLAN reports "No changes made" without error
Files Changed
fboss/cli/fboss2/commands/config/interface/switchport/trunk/ - New command hierarchy
fboss/cli/fboss2/utils/CmdUtils.h/cpp - Added TrunkVlanAction argument type
fboss/cli/fboss2/CmdList.cpp - Registered new commands
fboss/cli/fboss2/CmdArgsLists.h - Added argument type mapping
Test Plan
AddAndRemoveTrunkVlan
AddMultipleVlans
AddExistingVlan
RemoveVlansOneByOne
RemoveNonExistingVlan
AddVlanToMultiplePorts
RemoveVlanFromMultiplePorts
AddMultipleVlansToMultiplePorts