可以使用以下命令来查看网口PCIe速率:
lspci -vvv | grep -i eth -A 7
该命令会列出所有以“eth”为关键字的设备,并显示它们的详细信息。其中,关注以下两个字段:
- Capabilities: [48] Power Management version 3
- Link Width: x1, x2, x4, x8, x16
第一个字段表示设备支持的功能和版本,不是我们需要的信息。而第二个字段则表示设备与PCIe总线之间的链接宽度,即PCIe速率。x1表示单通道,x2表示双通道,以此类推。
例如,在下面这个输出中:
00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (3) I218-V (rev 03)
Subsystem: Gigabyte Technology Co., Ltd Ethernet Connection (3) I218-V
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 255
Region 0: Memory at f7a00000 (32-bit, non-prefetchable) [size=128K]
Region 1: Memory at f7a36000 (32-bit, non-prefetchable) [size=4K]
Region 2: I/O ports at f040 [size=32]
Capabilities: [c8] Power Management version 3
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [d0] MSI-X: Enable+ Count=10 Masked-
Vector table: BAR=0 offset=00000000
PBA: BAR=0 offset=00002000
Capabilities: [a4] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus:
可以看到,该设备的PCIe速率是x1。