PCIe网卡查看工具
今天測試部匯報了一個設(shè)備出現(xiàn)問題:” 8個1g電口 +8個1g光口+4個10g bp光口+4個10g非bp光口,其中有4個口沒有up起來,ifconfig看不到接口“
拿到這個問題我就在想:“怎樣確定是不是只有4個網(wǎng)口沒有up?ifconfig只是一個查看內(nèi)核虛擬設(shè)備,那么物理網(wǎng)卡設(shè)備呢? 怎樣確定這個4個口就是測試人員所說的10g非bp光口?
?ù---所以為了弄清楚上述問題,需要確認什么信息,使用什么工具作為輔助?----€
物理拓撲:簡要情況就是網(wǎng)口插入PCIe板卡
所以首先要確認PCIe板卡是否被識別!
那么有什么工具幫助查看呢?
linux的lspci命令可以幫助查看
執(zhí)行l(wèi)spci命令如下:lspci |grep Eth
03:00.0 Ethernet controller: Intel Corporation Device 1521 (rev 01) 03:00.1 Ethernet controller: Intel Corporation Device 1521 (rev 01) 03:00.2 Ethernet controller: Intel Corporation Device 1521 (rev 01) 03:00.3 Ethernet controller: Intel Corporation Device 1521 (rev 01) 04:00.0 Ethernet controller: Intel Corporation Device 1521 (rev 01) 04:00.1 Ethernet controller: Intel Corporation Device 1521 (rev 01) 04:00.2 Ethernet controller: Intel Corporation Device 1521 (rev 01) 04:00.3 Ethernet controller: Intel Corporation Device 1521 (rev 01) 07:00.0 Ethernet controller: Intel Corporation Device 1521 (rev 01) 07:00.1 Ethernet controller: Intel Corporation Device 1521 (rev 01) 07:00.2 Ethernet controller: Intel Corporation Device 1521 (rev 01) 07:00.3 Ethernet controller: Intel Corporation Device 1521 (rev 01) 08:00.0 Ethernet controller: Intel Corporation Device 1521 (rev 01) 08:00.1 Ethernet controller: Intel Corporation Device 1521 (rev 01) 08:00.2 Ethernet controller: Intel Corporation Device 1521 (rev 01) 08:00.3 Ethernet controller: Intel Corporation Device 1521 (rev 01) 0a:00.0 Ethernet controller: Intel Corporation Device 1533 (rev 03) 0b:00.0 Ethernet controller: Intel Corporation Device 1533 (rev 03) 0c:00.0 Ethernet controller: Intel Corporation Device 1572 (rev 02) 0c:00.1 Ethernet controller: Intel Corporation Device 1572 (rev 02) 0c:00.2 Ethernet controller: Intel Corporation Device 1572 (rev 02) 0c:00.3 Ethernet controller: Intel Corporation Device 1572 (rev 02)
可以看到PCIe數(shù)目不對,可知為PCIe板卡沒有被識別到
這次主要想說的問題是:
0c:00.3 Ethernet controller: Intel Corporation Device 1572 (rev 02)
這些數(shù)值是什么意思??
以及l(fā)spci還能查看那些信息;除了lspci還有哪些工具可以幫助分析問題
先看lspci幫助:lspci - 列出所有PCI設(shè)備
-v
使得 lspci 以冗余模式顯示所有設(shè)備的詳細信息。
-vv
使得 lspci 以過冗余模式顯示更詳細的信息 (事實上是 PCI 設(shè)備能給出的所有東西)。這些數(shù)據(jù)的確切意義沒有在此手冊頁中解釋,如果你想知道更多,請參照 /usr/include/linux/pci.h 或者 PCI 規(guī)范。
-n
以數(shù)字形式顯示 PCI 生產(chǎn)廠商和設(shè)備號,而不是在 PCI ID 數(shù)據(jù)庫中查找它們。
-x
以十六進制顯示 PCI 配置空間 (configuration space) 的前64個字節(jié)映象 (標(biāo)準(zhǔn)頭部信息)。此參數(shù)對調(diào)試驅(qū)動和 lspci 本身很有用。
-xxx
以十六進制顯示所有 PCI 配置空間的映象。此選項只有 root 可用,并且很多 PCI 設(shè)備在你試圖讀取配置空間的未定義部分時會崩潰 (此操作可能不違反PCI標(biāo)準(zhǔn),但是它至少非常愚蠢)。
-b
以總線為中心進行查看。顯示所有 IRQ 號和內(nèi)存地址,就象 PCI 總線上的卡看到的一樣,而不是內(nèi)核看到的內(nèi)容。
-t
以樹形方式顯示包含所有總線、橋、設(shè)備和它們的連接的圖表。
-s [[<bus>]:][<slot>][.[<func>]]
僅顯示指定總線、插槽上的設(shè)備或設(shè)備上的功能塊信息。設(shè)備地址的任何部分都可以忽略,或以“*”代替 (意味著所有值)。所有數(shù)字都是十六進制。例如:“0:”指的是在0號總線上的所有設(shè)備;“0”指的是在任意總線上0號設(shè)備的所有功能塊;“0.3”選擇 了所有總線上0號設(shè)備的第三個功能塊;“.4”則是只列出每一設(shè)備上的第四個功能塊。
-d [<vendor>]:[<device>]
只顯示指定生產(chǎn)廠商和設(shè)備 ID 的設(shè)備。 這兩個 ID 都以十六進制表示,可以忽略或者以“*”代替 (意味著所有值)。
-i <file>
使用 <file> 作為 PCI ID 數(shù)據(jù)庫而不是使用默認的 /usr/share/hwdata/pci.ids。
-p <dir>
使用 <dir> 作為包含 PCI 總線信息的目錄而不是使用默認的目錄 /proc/bus/pci。
-m
以機器可讀的方式轉(zhuǎn)儲 PCI 設(shè)備數(shù)據(jù) (支持兩種模式:普通和冗余),便于腳本解析。
常用問題&命令:
首先在x86系統(tǒng)中PCIe支持256個Bus,每條Bus支持32個Device,每個Device支持8個Function,所以PCIe設(shè)備關(guān)鍵信息組成為:DBDF(Domain,Bus,Deivce,Function)
PCIe的拓撲和Linux的PCIe ID
lspci –vt
所以使用lspci -vt 可以查看PCIe拓撲;根據(jù)拓撲就可以看出,接入幾個板卡,每個板卡下面接入了多少設(shè)備
dmidecode –t slot”命令查看PCIE Slot的信息
dmidecode,讀取DMI表中的數(shù)據(jù)來提取硬件信息,可查看bios,cpu,memory等信息
結(jié)合/proc和/sys可以查詢硬件使用的驅(qū)動信息
總結(jié)
以上是生活随笔為你收集整理的PCIe网卡查看工具的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 教你一个电脑上上传图片的好方法电脑如何传
- 下一篇: 电脑中了病毒电脑中了病毒后可能的表现