Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft pull #722

Closed
wants to merge 1 commit into from
Closed

Draft pull #722

wants to merge 1 commit into from

Conversation

carycelestica
Copy link
Contributor

- What I did
Add some PCIe command line to show the platform PCIe and check the PCIe with config file
- How I did it
1.Add an pcieutil moudle file in sonic-utilities
eg :
sonic-utilities/pcieutil/main.py
And that will import the API pcieutil.py funtion in different vendor 's plugins file
the main file
eg:
device/celestica/x86_64-cel_seastone-r0/plugins/pcieutil.py
the config file
eg:
device/celestica/x86_64-cel_seastone-r0/plugins/pcie.yaml
different vendors can can put their own API file and device PCIe info file in current platform file, also can use the comand line to generate an new config file with your current platform PCIe info if you don't want to
add it manually

  1. Add the support in show command
    eg:
    (1)
    show platform pcieinfo
    wiil run the command
    pcieutil pcie_show
    (2)
    show platform pcieinfo -c
    wiil run the command
    pcieutil pcie_check
    (3)
    show platform pcieinfo -g
    wiil run the command
    pcieutil pcie_generate
    - How to verify it
    pcie.yaml format
    - bus: '00'
    dev: '00'
    fn: '0'
    id: 1f0c
    name: 'Host bridge: Intel Corporation Atom processor C2000 SoC Transaction Router'
    - bus: '00'
    dev: '01'
    fn: '0'
    id: 1f10
    name: 'PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 1'
    - bus: '00'
    dev: '02'
    fn: '0'
    id: 1f11
    name: 'PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 2'

- New command output (if the output of a command-line utility has changed)
`root@sonic:/home/admin# show platform pcieinfo
==============================Display PCIe Device===============================
bus:dev.fn 00:00.0 - dev_id=0x1f0c, Host bridge: Intel Corporation Atom processor C2000 SoC Transaction Router
bus:dev.fn 00:01.0 - dev_id=0x1f10, PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 1
bus:dev.fn 00:02.0 - dev_id=0x1f11, PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 2
bus:dev.fn 00:03.0 - dev_id=0x1f12, PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 3
bus:dev.fn 00:0e.0 - dev_id=0x1f14, Host bridge: Intel Corporation Atom processor C2000 RAS
bus:dev.fn 00:0f.0 - dev_id=0x1f16, IOMMU: Intel Corporation Atom processor C2000 RCEC
bus:dev.fn 00:13.0 - dev_id=0x1f15, System peripheral: Intel Corporation Atom processor C2000 SMBus 2.0
bus:dev.fn 00:14.0 - dev_id=0x1f41, Ethernet controller: Intel Corporation Ethernet Connection I354
bus:dev.fn 00:16.0 - dev_id=0x1f2c, USB controller: Intel Corporation Atom processor C2000 USB Enhanced Host Controller
bus:dev.fn 00:17.0 - dev_id=0x1f22, SATA controller: Intel Corporation Atom processor C2000 AHCI SATA2 Controller
bus:dev.fn 00:18.0 - dev_id=0x1f32, SATA controller: Intel Corporation Atom processor C2000 AHCI SATA3 Controller
bus:dev.fn 00:1f.0 - dev_id=0x1f38, ISA bridge: Intel Corporation Atom processor C2000 PCU
bus:dev.fn 00:1f.3 - dev_id=0x1f3c, SMBus: Intel Corporation Atom processor C2000 PCU SMBus
bus:dev.fn 01:00.0 - dev_id=0xb960, Ethernet controller: Broadcom Limited Device b960
bus:dev.fn 01:00.1 - dev_id=0xb960, Ethernet controller: Broadcom Limited Device b960
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# show platform pcieinfo -h
Usage: show platform pcieinfo [OPTIONS]

Show Device PCIe Info

Options:
--verbose Enable verbose output
-c, --check Check the platfome PCIe device
-g, --generate Generate the config file with current platfrom PCIe info ,will cover the old config file !
-?, -h, --help Show this message and exit.
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# show platform pcieinfo -c
===============================PCIe Device Check================================
PCI Device: Host bridge: Intel Corporation Atom processor C2000 SoC Transaction Router ----------------- [Passed]
PCI Device: PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 1 ------------------------ [Passed]
PCI Device: PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 2 ------------------------ [Passed]
PCI Device: PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 3 ------------------------ [Passed]
PCI Device: Host bridge: Intel Corporation Atom processor C2000 RAS ------------------------------------ [Passed]
PCI Device: IOMMU: Intel Corporation Atom processor C2000 RCEC ----------------------------------------- [Passed]
PCI Device: System peripheral: Intel Corporation Atom processor C2000 SMBus 2.0 ------------------------ [Passed]
PCI Device: Ethernet controller: Intel Corporation Ethernet Connection I354 ---------------------------- [Passed]
PCI Device: USB controller: Intel Corporation Atom processor C2000 USB Enhanced Host Controller -------- [Passed]
PCI Device: SATA controller: Intel Corporation Atom processor C2000 AHCI SATA2 Controller -------------- [Passed]
PCI Device: SATA controller: Intel Corporation Atom processor C2000 AHCI SATA3 Controller -------------- [Passed]
PCI Device: ISA bridge: Intel Corporation Atom processor C2000 PCU ------------------------------------- [Passed]
PCI Device: SMBus: Intel Corporation Atom processor C2000 PCU SMBus ------------------------------------ [Passed]
PCI Device: Ethernet controller: Broadcom Limited Device b960 ------------------------------------------ [Passed]
PCI Device: Ethernet controller: Broadcom Limited Device b960 ------------------------------------------ [Passed]
PCIe Device Checking All Test ----------->>> PASSED
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# show platform pcieinfo -g
generate PCIe config file successfully ! ! !
root@sonic:/home/admin# `

@maipbui maipbui closed this Aug 18, 2023
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.

2 participants