[dpdk] 熟悉SDK与初步使用 (一)(qemu搭建实验环境)
搭建实验环境:
troubleshoot
第一步加载驱动
第二步切换驱动
使用了所有qemu支持的卡
[tong@T7:~/VM/dpdk] % cat start.sh sudo qemu-system-x86_64 -nographic -vnc 127.0.0.1:1 -enable-kvm \ -m 2G -cpu Nehalem -smp cores=2,threads=2,sockets=2 \ -numa node,mem=1G,cpus=0-3,nodeid=0 \ -numa node,mem=1G,cpus=4-7,nodeid=1 \ -drive file=disk.img,if=virtio \ -net nic,vlan=0,model=virtio,macaddr='00:00:00:01:00:00' \ -net nic,vlan=1,model=ne2k_pci,macaddr='00:00:00:01:00:01' \ -net nic,vlan=2,model=i82551,macaddr='00:00:00:01:00:02' \ -net nic,vlan=2,model=i82557b,macaddr='00:00:00:01:00:03' \ -net nic,vlan=2,model=i82559er,macaddr='00:00:00:01:00:04' \ -net nic,vlan=2,model=rtl8139,macaddr='00:00:00:01:00:05' \ -net nic,vlan=2,model=e1000,macaddr='00:00:00:01:00:06' \ -net nic,vlan=2,model=pcnet,macaddr='00:00:00:01:00:07' \ -net tap,vlan=0,ifname=tap-dpdk-control \ -net tap,vlan=1,ifname=tap-dpdk-1,script=no,downscript=no \ -net tap,vlan=2,ifname=tap-dpdk-2,script=no,downscript=no & # -device vfio-pci,host='0000:00:19.0' \ #ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio [tong@T7:~/VM/dpdk]
只有virtio是对队列的
[root@dpdk ~]# lspci -vv |grep -E '^00|MSI' 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] (prog-if 80 [Master]) 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03) 00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) (prog-if 00 [VGA controller]) 00:03.0 Ethernet controller: Red Hat, Inc Virtio network device Capabilities: [98] MSI-X: Enable+ Count=3 Masked- 00:04.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8029(AS) 00:05.0 Ethernet controller: Intel Corporation 8255xER/82551IT Fast Ethernet Controller (rev 0f) 00:06.0 Ethernet controller: Intel Corporation 82557/8/9/0/1 Ethernet Pro 100 (rev 02) 00:07.0 Ethernet controller: Intel Corporation 8255xER/82551IT Fast Ethernet Controller (rev 09) 00:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8100/8101L/8139 PCI Fast Ethernet Adapter (rev 20) 00:09.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 03) 00:0a.0 Ethernet controller: Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10) 00:0b.0 SCSI storage controller: Red Hat, Inc Virtio block device Capabilities: [98] MSI-X: Enable+ Count=2 Masked- [root@dpdk ~]#
xxx
[root@dpdk tools]# ./dpdk-devbind.py -b igb_uio eth1 [root@dpdk tools]# ./dpdk-devbind.py -b igb_uio eth2 [root@dpdk tools]# ./dpdk-devbind.py -s Network devices using DPDK-compatible driver ============================================ 0000:00:04.0 'Virtio network device' drv=igb_uio unused= 0000:00:05.0 'Virtio network device' drv=igb_uio unused= Network devices using kernel driver =================================== 0000:00:03.0 'Virtio network device' if=eth0 drv=virtio-pci unused=igb_uio *Active* Other network devices ===================== <none> [root@dpdk tools]#
qemu的所有nic都可以使用uio
[root@dpdk tools]# ./dpdk-devbind.py -s Network devices using DPDK-compatible driver ============================================ <none> Network devices using kernel driver =================================== 0000:00:03.0 'Virtio network device' if=eth0 drv=virtio-pci unused=igb_uio *Active* 0000:00:08.0 'RTL-8100/8101L/8139 PCI Fast Ethernet Adapter' if=ens8 drv=8139cp unused=igb_uio 0000:00:09.0 '82540EM Gigabit Ethernet Controller' if=ens9 drv=e1000 unused=igb_uio Other network devices ===================== 0000:00:04.0 'RTL-8029(AS)' unused=igb_uio 0000:00:05.0 '8255xER/82551IT Fast Ethernet Controller' unused=igb_uio 0000:00:06.0 '82557/8/9/0/1 Ethernet Pro 100' unused=igb_uio 0000:00:07.0 '8255xER/82551IT Fast Ethernet Controller' unused=igb_uio 0000:00:0a.0 '79c970 [PCnet32 LANCE]' unused=igb_uio [root@dpdk tools]#