lspci -s [[[[]:]]:][][.[]] 显示指定PCI设备的信息,域名通常可以省略。如下图所示,lspci -s 02:00.0 中02表示bus number,00表示device number,0表示function number。-mm选项用于产生一种易于机器解析的输出格式。输出的信息将以一种结构化的、通常是键值对的形式展现,便于脚本或其他自动化工具处理和分析。以总线树的方式呈现所有PCI设备,设备信息量较少,仅仅只有[[[[]:]]:][][.[]],不含其他信息,因此为了显示更多信息,可以使用lspci -tv 列出所有PCI设备的详细信息,v数量越多,信息越详细为了方便比较,我们指定了bc:00.0设备使用lspci -v和lspci -vv,显示效果如下。lspci -v 显示的信息比较少,只显示了PCI设备存在的能力结构名称,其中能力结构字段没有显示,而lspci -vv显示的信息比较多,显示了PCI设备配置空间的所有能力结构NOTE: lspci 显示的并不全是PCI配置空间的真实值,其中部分字段来自系统缓存的信息,例如bar0~bar5,一旦PCI设备因为链路不稳定等问题发生复位导致bar寄存器被清零时,lspci显示的bar数值依旧是复位之前的数值。 lspci -PP 针对endpoint设备,会额外添加当前设备的bridge设备的bus and device number lspci -s 04:00.0 -PP 获取指定Endpoint PCIe设备04:00.0的对接bridge设备号,如图所示lspci -nn 显示PCI设备的class code、vendor id以及device id。如下图所示,lspci -s 74:00.0 -nn显示了class code[0604],显示了vendor id[19e5]以及device id[a121]。 lspci -Q :通过DNS(域名系统)查询所有PCI设备的vendor id和device id,新申请的vendor id在旧版本的lspci中是无法显示公司名称的,只能显示vendor id和device id。通过lspci -Q命令可以更新本地vendor id和device id数据库,之后使用lspci就能显示公司名称了。lspci -d []:[][:] : 查询指定的PCI设备,输入命令时至少需要输入vendor id和device id。lspci -x 以16进制的形式显示PCI标准配置空间内容lspci -xxxx 以16进制的形式显示4KB配置空间内容 2.lspci --help
[root@asic icxiaoge]# lspci --help-mm Produce machine-readable output (single -m for an obsolete format )-v Be verbose (-vv or -vvv for higher verbosity)-k Show kernel drivers handling each device-x Show hex-dump of the standard part of the config space-xxx Show hex-dump of the whole config space (dangerous; root only)-xxxx Show hex-dump of the 4096-byte extended config space (root only)-b Bus-centric view (addresses and IRQ's as seen by the bus) -D Always show domain numbers-P Display bridge path in addition to bus and device number-PP Display bus path in addition to bus and device number Resolving of device id's to names:-nn Show both textual and numeric ID's (names & numbers)-q Query the PCI ID database for unknown ID's via DNS-qq As above, but re-query locally cached entries-Q Query the PCI ID database for all ID's via DNS -s [[[[]:]]:][][.[]] Show only devices in selected slots -d []:[][:] Show only devices with specified ID's -i Use specified ID database instead of /usr/share/hwdata/pci.ids-p Look up kernel modules in a given file instead of default modules.pcimap-M Enable `bus mapping' mode (dangerous; root only) -A Use the specified PCI access method (see `-A help' for a list)-O= Set PCI access parameter (see `-O help' for a list)-G Enable PCI access debugging-F Read PCI configuration dump from a given file |
本站声明: 本文章由作者或相关机构授权发布,目的在于传递更多信息,并不代表本站赞同其观点,本站亦不保证或承诺内容真实性等。需要转载请联系该专栏作者,如若文章内容侵犯您的权益,请及时联系本站删除。