小樱 发表于 2022/1/1 23:05

linux centos查看网卡信息的方法,安装pciutils使用lspci命令,KVM虚拟化网络性能定义SR-IOV > Virtio > 模拟卡

linux centos查看网卡信息的方法,安装pciutils使用lspci命令,KVM虚拟化网络性能定义SR-IOV > Virtio > 模拟卡

yum -y install pciutils

查看基本信息:
lspci
模拟卡显示为
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03)
00:04.0 RAM memory: Red Hat, Inc. Virtio memory balloon
Virtio显示为
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Cirrus Logic GD 5446
00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:04.0 SCSI storage controller: Red Hat, Inc. Virtio block device
00:05.0 Unclassified device : Red Hat, Inc. Virtio memory balloon
00:06.0 Unclassified device : Red Hat, Inc. Virtio RNG
查看详细信息:
lspci -vvv
查看网卡信息:
lspci | grep Ethernet
模拟卡显示为
00:03.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03)
Virtio显示为
00:03.0 Ethernet controller: Red Hat, Inc. Virtio network device

查看网卡驱动版本
lshw -c network -businfo
模拟卡显示为
Bus info          Device      Class      Description
====================================================
pci@0000:00:03.0ens3      network    82540EM Gigabit Ethernet Controller
Virtio显示为
Bus info          Device      Class      Description
====================================================
pci@0000:00:03.0            network    Virtio network device
virtio@0          eth0      network    Ethernet interface

ethtool -i eth0
模拟卡显示为
driver: e1000
version: 7.3.21-k8-NAPI
firmware-version:
expansion-rom-version:
bus-info: 0000:00:03.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
Virtio显示为
driver: virtio_net
version: 1.0.0
firmware-version:
expansion-rom-version:
bus-info: 0000:00:03.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
查看是否支持SR-IOV(00:03.0字符串通过lspci | grep Ethernet 命令获取)
lspci -s 00:03.0 -vvv | grep -i "modules"
输出e1000代表是模拟卡,输出virtio_pci代表是Virtio

性能区别,网络性能定义在 SR-IOV > Virtio > 模拟卡:https://bbs.itzmx.com/thread-99381-1-1.html
参考:https://www.linux-kvm.org/page/10G_NIC_performance:_VFIO_vs_virtio
https://www.juniper.net/documentation/en_US/junos/topics/concept/disaggregated-junos-virtio-sr-iov.html

小樱 发表于 2022/1/9 02:28

补一张hyper的
lspci -vvv
00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0

00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
        Subsystem: Microsoft Corporation Device 0000
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0

00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 80 )
        Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Region 0: Memory at 000001f0 (32-bit, non-prefetchable)
        Region 1: Memory at 000003f0 (type 3, non-prefetchable)
        Region 2: Memory at 00000170 (32-bit, non-prefetchable)
        Region 3: Memory at 00000370 (type 3, non-prefetchable)
        Region 4: I/O ports at ffa0
        Kernel driver in use: ata_piix
        Kernel modules: ata_generic, pata_acpi, ata_piix

00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
        Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 9
        Kernel modules: i2c-piix4

00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA (prog-if 00 )
        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- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 11
        Region 0: Memory at f8000000 (32-bit, non-prefetchable)
        Expansion ROM at <unassigned>
        Kernel driver in use: hyperv_fb
        Kernel modules: hyperv_fb
ethtool -i eth0
driver: hv_netvsc
version: 3.1
firmware-version: N/A
bus-info:
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
页: [1]
查看完整版本: linux centos查看网卡信息的方法,安装pciutils使用lspci命令,KVM虚拟化网络性能定义SR-IOV > Virtio > 模拟卡