JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

在Linux下查詢PCI Express Gen的Speed


話說最近剛好被問到Intel PCI-E SSD是不是真的有到Gen 3的速度,如果是在M$下面可以透過Deivce Manager來查詢,那在Linux下面呢?當然是用LSPCI去查詢囉,至於要怎麼查,看下去就知道囉,如下:
1) PCI Express各代的比較(這邊以1.x、2.x 與3.0為例)
PCI-E 1.x -> 2.5 GT/s(Raw bit rate) -> 2Gbps (Interconnect bandwidth) -> ~250MB/s(Bandwidth per lane per direction) -> ~8GB/s(Total bandwidth for x16 link)
PCI-E 2.x -> 5.0 GT/s(Raw bit rate) -> 4Gbps (Interconnect bandwidth) -> ~500MB/s(Bandwidth per lane per direction) -> ~16GB/s(Total bandwidth for x16 link)
PCI-E 3.x -> 8.0 GT/s(Raw bit rate) -> 8Gbps (Interconnect bandwidth) -> ~1GB/s(Bandwidth per lane per direction) -> ~32GB/s(Total bandwidth for x16 link)

2) 透過LSPCI查詢你想要知道的Device ID(這邊以Intel PCIe SSD為例,這邊有Wiki)
#lspci | grep -i intel | grep -i memory | grep -i vol
03:00.0 Non-Volatile memory controller: Intel Corporation Device 0953 (rev 01)
04:00.0 Non-Volatile memory controller: Intel Corporation Device 0953 (rev 01)

3) 透過上述指令得到ID後,再查詢PCI Vendor與Device Codes(EX:Bus Number:Device Number.Func Number)
#lspci -n | grep -i '03:00.0'
03:00.0 0108: 8086:0953 (rev 01)
#lspci -n | grep -i '04:00.0'
04:00.0 0108: 8086:0953 (rev 01)

4) 透過PCI Vendor與Device Codes來查詢PCI Express的速度(對照Step 1,得知真的是跑Gen3的速度)
#lspci -n -d 8086:0953 -vvv | grep -i width -> LnkSta(系統提供的速度),LnkCap(裝置採用速度)
LnkCap: Port #0, Speed 8GT/s, Width x4, ASPM L0s L1, Exit Latency L0s <4us, L1 <4us
LnkSta: Speed 8GT/s, Width x4, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
LnkCap: Port #0, Speed 8GT/s, Width x4, ASPM L0s L1, Exit Latency L0s <4us, L1 <4us
LnkSta: Speed 8GT/s, Width x4, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-

5) 這邊外插如何查詢SATA與SAS硬碟跑的Speed(Gen1->150MByte/s|300MByte/s、Gen2->300MByte/s|600MByte/s、Gen3->600MByte/s|1200MByte/s)
#hdparm -I /dev/sda |grep -i speed -> SATA
#cat /sys/class/ata_link/link1/sata_spd -> SATA
#cat /sys/class/sas_phy/phy-0\:0/maximum_linkrate -> SAS

◎、若發生LSPCI裡面有Unknown,可參考Benjr大文章來更新/usr/share/hwdata/pci.ids(pci.ids下載位置)。
◎、以上就是在Linux下查詢PCI Express Gen Speed的簡介詳情的部分可參考Benjr大文章,另外對於PCI Express的介紹可以欣賞這裡,或是維基百科介紹,先到這,收工!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro