[pcied] Honour PCIE_DETACH_INFO on platforms that are not smartswitches

未关闭 适合新手
#900 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

从 sonic-pcied/scripts/pcied 开始,检查第 109 行附近对 PCIE_DETACH_INFO 的无条件设置,以及第 211-213 行附近仅针对 smartswitch 的处理。跟踪 detached bus_info 如何影响 poll result、err 和 PCIE_DEVICES|status。完成的标准是:有意分离的设备在非 smartswitch 平台上得到正确处理,同时不会让 status 保持为 FAILED。

由索引模型根据 Issue 内容生成。

描述

pcied only consults the PCIE_DETACH_INFO table when the platform is a smartswitch:

https://github.com/sonic-net/sonic-platform-daemons/blob/a9d71d7218e72423b3b993c39cfb07f1cdac8705/sonic-pcied/scripts/pcied#L211-L213

On anything else device_info.is_smartswitch() is False, so the table is never read and a device that has been deliberately detached is reported as missing on every poll:

pcied: PCIe Device: <name> Not Found

err is non-zero as a result, so PCIE_DEVICES|status in STATE_DB stays FAILED for as long as the device is detached, which in turn trips anything watching that field (e.g. loganalyzers in sonic-mgmt tests).

Nothing about the table is smartswitch-specific. pcied creates it unconditionally at startup:

https://github.com/sonic-net/sonic-platform-daemons/blob/a9d71d7218e72423b3b993c39cfb07f1cdac8705/sonic-pcied/scripts/pcied#L109

and its contract is just "this bus_info is expected to be absent right now". Smartswitches are simply the first consumer; a fixed-form switch that detaches a PCIe device to upgrade it in service (an FPGA or a retimer, say) has exactly the same need and no way to express it.

pcied should honour PCIE_DETACH_INFO regardless of platform type.

主要语言
Python
星标
38
派生
236
平均合并
3 天 18 小时
30 天内合并 PR
5

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sonic-net/sonic-platform-daemons 的其他 Issue

查看 sonic-net/sonic-platform-daemons 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。