Wednesday, October 26, 2016

VMware ESXi - vmkvsitools lspci

Lspci is a short name for list PCI (Peripheral Component Interconnect) devices. PCI is a standardised bus to attach different kinds of hardware on the motherboard of a x86 system. Many devices such as I/O cards (e.g. HBA, CNA, network cards) are PCI cards. In current hardware these PCI is replaced by the next generation standard PCIe (Peripheral Component Interconnect Express). PCIe delivers a high-speed serial computer expansion bus standard to replace PCI, PCI-X (Peripheral Component Interconnect eXtended) and AGB (Accelerated Graphics Port) bus standards. It is also expected that SATA will get replaced by PCIe which happens today already as Flash gets faster and there is a need for high demanding performance. With -h you see below that there are a few options to get info from detailed, over hex dump to verbose output.

~ # lspci -h

lspci  -p --pciinfo   Print detailed info on all PCI devices
     -n --nolookup  Don't look up PCI device names and info
     -d --dump      Print hex dump of the standard config space
     -e --extdump   Print hex dump of the extended config space
     -v --verbose   Verbose information
     -h --help      Print this help message

By default it will display the information you see below. The nomenclature is:

[Domain:]bus:device.function and Name (of the device attached and it’s manufactured company name).

Very often the domain number is filled up with zeroes. The four numbers are assigned to each device either on boot or when the device is hot-plugged. The PCI bus permits up to 256 buses while each bus can host up to 32 devices and one PCI device can cover up to 8 functions. In other words only very big systems will have a domain number other than 0000. Thinking in bit terms they are specified as follows:

  • The device location is specified by a 16-bit domain number
  • The bus number is specified by 8-bit
  • The device number is specified by 5-bit
  • The function number is specified by 3-bit

lspci

PCI devices are often referred to BDF (bus/device/function). Let’s take an example and look for the two physical nics vmnic0 & vmnic4 as they both use different backend network cards.

~ # lspci | grep  'vmnic0\|vmnic4'
0000:02:00.0 Network controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet [vmnic0]
0000:08:00.0 Network controller: Intel(R) 82599 10 Gigabit Dual Port Network Connection [vmnic4]

Below you see an example for the two network cards vmnic0 & vmnic4:
Segm:Bu:De.F Name
0000:02:00.0 Network controller: Broadcom Corporation NetXtreme BCM5719 Gigabit Ethernet [vmnic0]
0000:08:00:0 Network controller: Intel(R) 82599 10 Gigabit Dual Port Network Connection [vmnic4]

vmnic0 has domain ID: 0000 and BDF: 02:00:0
vmnic4 has domain ID: 0000 and BDF: 08:00:0

lspci -p (pciinfo)

If you would like to find out the driver module and vendor specific values you should use the -p option. VID:DID:SVID:SSID stands for:

  • VID: Vendor ID (Vend)
  • DID: Device ID (Dvid)
  • SVID: Subsystem Vendor ID (Subv)
  • SSID: Subsystem ID (Subd)

~ # lspci -p | grep -i 'segm\|vmnic1\|vmnic4'
Segm:Bu:De.F Vend:Dvid Subv:Subd ISA/irq/Vect P M Module  Name
0000:02:00.1 14e4:1657 103c:22be 255/   /0x2d B V tg3     vmnic1
0000:08:00.0 8086:10fb 8086:7a11 255/   /0x2c A V ixgbe   vmnic4
lspci -n (nolookup)
This option is interesting if you are just searching for information like:

  • Domain Number
  • Bus
  • Device
  • Function
  • Class
  • VID:DID:SVID:SSID

But no additional information like name or hex code data.

lspci -d (dump - print hex dump of standard config space)

If you want to get deeper you can even look at the hex data. Please keep in mind that all byte are inverted because of little-endian. Let’ take vmnic4 this time as an example.

~ # lspci -p | grep -i 'segm\|vmnic4'
Segm:Bu:De.F Vend:Dvid Subv:Subd ISA/irq/Vect P M Module  Name
0000:08:00.0 8086:10fb 8086:7a11 255/   /0x2c A V ixgbe   vmnic4

~ # lspci -d | grep -i -A 16 'vmnic4'
0000:08:00.0 Network controller: Intel(R) 82599 10 Gigabit Dual Port Network Connection [vmnic4]
00: 86 80 fb 10 47 01 10 00 01 00 00 02 10 00 80 00
10: 04 00 c8 92 00 00 00 00 21 20 00 00 00 00 00 00
20: 04 40 10 93 00 00 00 00 00 00 00 00 86 80 11 7a
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 23 48 00 20 00 2b 00 00 00 00 00 00 00 00
50: 05 70 80 01 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 11 a0 3f 80 04 00 00 00 04 20 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 10 00 02 00 c2 8c 00 10 36 58 09 00 82 c4 01 00
b0: 40 00 82 10 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 1f 00 00 00 00 00 00 00 00 00 00 00
d0: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

lspci -v (verbose)

With -v you will get verbose output which gives you the class ID of this device. The class ID is a 2 byte ID where the first byte refers the PCI class and the second the PCI subclass. Please follow this link to the class code table to find out more about your PCI devices.

~ # lspci -v | grep -A 1 'vmnic4'
0000:08:00.0 Ethernet controller Network controller: Intel(R) 82599 10 Gigabit Dual Port Network Connection [vmnic4]
Class 0200: 8086:10fb

This class ID you can then use with the command 'esxcli hardware pci list -c=0x0200' to get all devices with this class (Network Adapters) or if you want just more information about vmnic4 do the following.

esxcli hardware pci list | grep -A 33 0000:08:00.0

0000:08:00.0
Address: 0000:08:00.0
Segment: 0x0000
Bus: 0x08
Slot: 0x00
Function: 0x0
VMkernel Name: vmnic4
Vendor Name: Intel(R)
Device Name: 82599 10 Gigabit Dual Port Network Connection
Configured Owner: Unknown
Current Owner: VMkernel
Vendor ID: 0x8086
Device ID: 0x10fb
SubVendor ID: 0x8086
SubDevice ID: 0x7a11
Device Class: 0x0200
Device Class Name: Ethernet controller
Programming Interface: 0x00
Revision ID: 0x01
Interrupt Line: 0xff
IRQ: 255
Interrupt Vector: 0x2c
PCI Pin: 0x00
Spawned Bus: 0x00
Flags: 0x0201
Module ID: 4124
Module Name: ixgbe
Chassis: 0
Physical Slot: 3
Slot Description: PCI-E Slot 3
Passthru Capable: true
Parent Device: PCI 0:0:3:0
Dependent Device: PCI 0:8:0:0
Reset Method: Function reset
FPT Sharable: true

You now find even more information about your specific hardware.

Conclusion

Lspci is a very rich tool if you need deep level information about your hardware. It would also help you to find out actual driver versions using VID:DID:SVID:SSID. As always if you have any comment, ideas or recommendations please don’t hesitate to contact me.


11 comments:

  1. Excellent blog I visit this blog it's really awesome.The important thing is that in this blog content written clearly and understandable.PCI Vendor

    ReplyDelete

  2. Great Post,really it was very helpful for us.
    Thanks a lot for sharing!
    I found this blog to be very useful!!
    VMware training in Bangalore

    ReplyDelete
  3. This post is really nice and informative.
    Visit Best Astrologer in Belgaum.

    ReplyDelete
  4. This post is so useful and informative.Keep updating with more information.....
    Python Programming
    Python From Basics

    ReplyDelete
  5. very informative blog https//:www.propertyiconic.com

    ReplyDelete
  6. What a wonderful blog it has everything I was looking for thank you for this informative post also check out this IVF Centre In Faridabad

    ReplyDelete
  7. Thank you for this important information this blog contains interesting topics and helps me a lot to understand new things keep doing this work also have a look on this Best Fertility Clinic In Faridabad

    ReplyDelete
  8. Thanks for sharing this information For more info, please connect Best RPO Company in USA

    ReplyDelete