Skip to content

Apply the interface naming schema only once, when reporting nics - #209

Open
GeertJohan wants to merge 1 commit into
metal-stack:naming-schema-optionfrom
GeertJohan:naming-schema-single-application
Open

Apply the interface naming schema only once, when reporting nics#209
GeertJohan wants to merge 1 commit into
metal-stack:naming-schema-optionfrom
GeertJohan:naming-schema-single-application

Conversation

@GeertJohan

@GeertJohan GeertJohan commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Targets #208 (branch naming-schema-option).

While adding the naming schema option in our SONiC setup (Edgecore AS7726-32X, Broadcom SONiC 4.5.2, native intf_naming_mode) I noticed the schema gets applied twice: getPortsConfig transforms the ports and keys the map by the transformed name, and GetNics then calls getPortByNamingSchema again on the already transformed values. That has three consequences:

  • swap swaps twice in GetNics and ends up behaving exactly like default
  • under swap and alias the interface blacklist (spine uplinks etc.) is compared against transformed map keys and no longer matches, so uplinks would get registered as machine nics
  • GetSwitchPorts returns the transformed names, and ConstantlyPhoneHome opens one LLDP pcap client per returned name, so under swap/alias it would try to open netdevs like Eth1/1 that do not exist on an Ethernet0-named system and machine liveness would silently break

This change keeps the port map keyed by the real interface names (blacklist matching and pcap handles need the actual netdevs) and applies the schema in one place only, when building the V1SwitchNic list for the metal-api.

…al-api

getPortsConfig applied the schema and keyed the port map by the
transformed name, and GetNics then applied the schema a second time on
the already transformed values. Consequences:

- swap swapped twice and behaved like default
- under swap and alias the interface blacklist no longer matched,
  because it is compared against the transformed map keys
- GetSwitchPorts returned transformed names, so the phone-home LLDP
  clients tried to open pcap handles on netdev names that do not exist

Keep the port map keyed by the real interface names and apply the
schema once, in GetNics.
@GeertJohan
GeertJohan requested a review from a team as a code owner August 7, 2026 16:23
@metal-robot metal-robot Bot added this to Development Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant