Skip to content

[pcied] Honour PCIE_DETACH_INFO on platforms that are not smartswitches - #899

Open
gordon-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:pcied-honour-pcie-detach-info-on
Open

gordon-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:pcied-honour-pcie-detach-info-on

Conversation

@gordon-nexthop

@gordon-nexthop gordon-nexthop commented Sep 21, 2026

Copy link
Copy Markdown

Description

Fixes: #900

Drop the is_smartswitch() gate on PCIE_DETACH_INFO handling, read a generic
device_state field (falling back to dpu_state) to allow non smartswitch platforms
to report when a pcie device has been intentionally brought down.

Motivation and Context

A PCIe device can be powered off/cycled, not just a smartswitch, so its endpoints
stop answering and pcied reports them missing for the duration of a the power off it
was asked to perform.

The support for this already exists in the case of DPUs on smartswitches #546
The table is already device-shaped rather than DPU-shaped — it is keyed by BDF,
ModuleBase.handle_pci_removal() already fans one module out to a list of
buses, and the value detaching says nothing about DPUs. Only the dpu_state
field name carried the DPU assumption, and writing that field on a pizzabox
would describe nothing. Reading device_state first keeps
ModuleBase.pci_entry_state_db() working unchanged.

How Has This Been Tested?

Extended test_is_device_in_detaching_mode to cover both field names, and added

  • test_detaching_is_honoured_on_a_non_smartswitch — a claimed BDF is no longer
    warned about on a non-smartswitch platform (the behaviour this PR adds).

Additional Information (Optional)

Signed-off-by: gordon-nexthop <gordon@nexthop.ai>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@gordon-nexthop
gordon-nexthop marked this pull request as ready for review September 21, 2026 23:16
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pcied] Honour PCIE_DETACH_INFO on platforms that are not smartswitches

2 participants