Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- 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
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# `