Skip to content

Navigation Menu

Sign in
Sign up

[Cisco] Handle fboss2 interface phymap without XPHY - #1627

Open
selekkala wants to merge 1 commit into
facebook:main from
selekkala:fix/fboss2-interface-phymap-no-xphy
Open

[Cisco] Handle fboss2 interface phymap without XPHY #1627
selekkala wants to merge 1 commit into
facebook:main from
selekkala:fix/fboss2-interface-phymap-no-xphy

Conversation

@selekkala

@selekkala selekkala commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Make fboss2 show interface phymap handle platforms without an external PHY (XPHY) or MACsec-capable PHY ports as a supported empty result.

The command now checks the QsfpService MACsec-capable port list before requesting the MACsec PHY map. When the list is empty, it returns the existing user-facing result:

No Phy port map for this platform

Root cause

CmdShowInterfacePhymap::queryClient() unconditionally called macsecGetPhyPortInfo(). QsfpService protects that RPC with validateHandler(), which throws FbossError("Macsec handler not initialized") when the platform did not create a MACsec handler.

That is expected on platforms such as Cisco C8501 / Morgan800CC, which do not have an XPHY. The CLI treated a supported platform capability difference as a command failure.

Fix details and compatibility

  • Query getMacsecCapablePorts() first. This API returns an empty list when there is no PHY manager or no PHY port advertising the MACsec feature.
  • Call macsecGetPhyPortInfo() only when at least one MACsec-capable port exists.
  • Reuse the existing empty-model output instead of matching exception strings.
  • No Thrift API or server behavior changes are required.
  • Platforms with MACsec-capable XPHY ports continue through the existing PHY-map RPC and rendering path.

Unit-test coverage

  • Added CmdShowInterfacePhymapTest.noXphyPlatform with a mocked empty MACsec-capable port list.
  • The test verifies that query execution succeeds, the returned model has no PHY map, and output is exactly No Phy port map for this platform.
  • Added the test to both BUCK and CMake FBOSS CLI test targets.

Test Plan

  • pre-commit run --from-ref upstream/main --to-ref HEAD — passed, including clang-format and repository checks.
  • Built a full C8501 FBOSS image carrying the equivalent backport: fboss-gr2-stable-20260903-fbc276b.1-1-ge405635.
  • Validated on a Cisco C8501 / Morgan800CC lab switch.

Before:

$ fboss2 show interface phymap
Thrift call failed: 'Macsec handler not initialized'

After:

$ fboss2 show interface phymap
No Phy port map for this platform
  • The fixed command exited with status 0 in 32 ms.
  • Confirmed fboss_sw_agent, fboss_hw_agent@0, and qsfp_service remained active after validation.

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

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /