PCIe with lspci

PCIe with lspci PCIe Width

# lspci -s 81:00.0 -vvv | grep Width LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported, Exit Latency L0s unlimited, L1 unlimited LnkSta: Speed 8GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-

PCIe Speed
# lspci -s 81:00.0 -vvv | grep Speed LnkCap: Port #0, Speed 8GT/s, Width x16, ASPM not supported, Exit Latency L0s unlimited, L1 unlimited LnkSta: Speed 8GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt- LnkCtl2: Target Link Speed: 8GT/s, EnterCompliance- SpeedDis-# lspci -s 81:00.0 -vvv | grep PCIeGen [V0] Vendor specific: PCIeGen3 x16

PCIe Max Payload Size
# lspci -s 81:00.0 -vvv | grep DevCtl: -C 2 DevCap: MaxPayload 512 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset+ SlotPowerLimit 0.000W DevCtl: Report errors: Correctable- Non-Fatal+ Fatal+ Unsupported- RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop- FLReset- MaxPayload 256 bytes, MaxReadReq 4096 bytes

PCIe Max Read Request
# lspci -s 81:00.0 -vvv | grep MaxReadReq MaxPayload 256 bytes, MaxReadReq 1024 bytes

【PCIe with lspci】修改PCIe Max Read Request
lspci -s -vvv | grep MaxReadReq setpci -s 68.w setpci -s 68.w=3XXX

0 - 128B, 1 - 256B, 2 - 512B, 3 - 1024B, 4 - 2048B and 5 - 4096B.
Maximum PCIe Bandwidth PCIe 最大带宽计算公式:
Maximum PCIe Bandwidth = SPEED * WIDTH * (1 - ENCODING) - 1Gb/s.

PCIe-Gen3 x8 带宽
Maximum PCIe Bandwidth = 8G * 8 * (1 - 2/130) - 1G = 64G * 0.985 - 1G = ~62Gb/s.

PCIe-Gen2 x16 带宽
Maximum PCIe Bandwidth = 5G * 16 * (1 - 1/5) - 1G = 80G * 0.8 - 1G = ~63Gb/s.

    推荐阅读