Skip to content

[Nexthop][fboss2-dev] allow addressing interfaces by port logical ID or interface ID - #1471

Open
benoit-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:fboss2-intfid
Open

[Nexthop][fboss2-dev] allow addressing interfaces by port logical ID or interface ID#1471
benoit-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:fboss2-intfid

Conversation

@benoit-nexthop

Copy link
Copy Markdown
Contributor

Summary

InterfaceList now accepts a purely-numeric argument and resolves it as a port logical ID or an interface ID, so e.g. fboss2-dev config interface 2001 mtu 9000 works on the interface with ID 2001.

Name lookups always take precedence over ID lookups, consistently for both ports and interfaces: port name -> port logical ID -> interface name -> interface ID.

Adds PortMap::getPortNameForLogicalId(), the reverse of the existing getPortLogicalId().

Test Plan

Unit tests cover resolution by port logical ID, by interface ID, by interface name, and that an unknown numeric ID still throws.

InterfaceList now accepts a purely-numeric argument and resolves it as a
port logical ID or an interface ID, so e.g. `fboss2-dev config interface
2001 mtu 9000` works on the interface with ID 2001. Name lookups always
take precedence over ID lookups, consistently for both ports and
interfaces: port name -> port logical ID -> interface name -> interface ID.

Adds PortMap::getPortNameForLogicalId(), the reverse of the existing
getPortLogicalId().
@meta-codesync

meta-codesync Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D114968244. (Because this pull request was imported automatically, there will not be any future comments.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant