vhost switch

本文介绍了在虚拟机中如何绑定VFIO设备,并详细讨论了在接收到VHOST_CONFIG: read message VHOST_USER_GET_VRING_BASE消息时的网络虚拟化场景。通过学习C/C++、Linux服务器开发和网络编程,可以深入理解这种高级的服务器和网络性能优化技术。同时,提供相关的学习资源,包括视频教程、面试题、资料和学习路线图,帮助读者提升技能。
摘要由CSDN通过智能技术生成

> my steps at host:
> 1. enabling VHOST defines and building x86_64-native-linuxapp-gcc.
>
> 2. both interfaces are bind like:
> 0000:04:00.0 'Ethernet 10G 2P X520 Adapter' drv=igb_uio unused=ixgbe
> 0000:04:00.1 'Ethernet 10G 2P X520 Adapter' drv=igb_uio unused=ixgbe
>
> 3. then making the project examples/vhost and executing:
> ./build/vhost-switch -c 0x03 -n 4 --socket-mem 1024 --file-prefix p1  --
> -p 1 --vm2vm 0 --socket-file /tmp/sock1 --client -P
> ./build/vhost-switch -c 0x30 -n 4 --socket-mem 1024 --file-prefix p2  --
> -p 2 --vm2vm 0 --socket-file /tmp/sock2 --client -P
>
> 4. creating the guest
> qemu- system-x86_64 -chardev socket,id=char1,path=/tmp/sock1,server
> -netdev type=vhost-user,id=hostnet1,chardev=char1,queues=2 -device
> virtio-net-pci,mq=on,vectors=2,netdev=hostnet1,id=net1,mac=00:00:00:00:00:01
> -chardev socket,id=char2,path=/tmp/sock2,server -netdev
> type=vhost-user,id=hostnet2,chardev=char2,queues=2 -device
> virtio-net-pci,mq=on,vectors=2,netdev=hostnet2,id=net2,mac=00:00:00:00:00:02
> -object
> memory-backend-file,id=mem2,size=2048M,mem-path=/run/hugepages,share=on  ...
>
> my steps on the guest:
> 1. enabling VHOST defines and building x86_64-native-linuxapp-gcc.
>
> 2. successfully setting up environment:
> modprobe uio_pci_generic
> ./tools/dpdk-devbind.py -b uio_pci_generic 0000:00:07.0
> ./tools/dpdk-devbind.py -b uio_pci_generic 0000:00:08.0
> ./examples/l3fwd/build/l3fwd -c 0x3 -n 3 -- --parse-ptype -p 0x3 -P -L
> --config="(0,0,0),(0,1,1),(1,0,0),(1,1,1)" --no-numa

(gdb) set args -l 0-3 -n 4 --socket-mem 1024  -- --socket-file /tmp/sock0 --client  -p 0x1
(gdb) r
Starting program: /data1/dpdk-19.11/examples/vhost/build/app/vhost-switch -l 0-3 -n 4 --socket-mem 1024  -- --socket-file /tmp/sock0 --client  -p 0x1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
EAL: Detected 128 lcore(s)
EAL: Detected 4 NUMA nodes
[New Thread 0xffffbe43d910 (LWP 52584)]
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
[New Thread 0xffffbdc2d910 (LWP 52585)]
EAL: Selected IOVA mode 'VA'
EAL: No available hugepages reported in hugepages-2048kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
[New Thread 0xffffbd40d910 (LWP 52586)]
[New Thread 0xffffbcbfd910 (LWP 52587)]
[New Thread 0xffffbc3ed910 (LWP 52588)]
EAL: PCI device 0000:05:00.0 on NUMA socket 0
EAL:   probe driver: 19e5:200 net_hinic
EAL:   using IOMMU type 1 (Type 1)
net_hinic: Initializing pf hinic-0000:05:00.0 in primary process
net_hinic: Hwif is not ready
net_hinic: Initialize hwif failed, dev_name: 0000:05:00.0
net_hinic: Initialize hwif failed, dev_name: 0000:05:00.0
net_hinic: Create nic device failed, dev_name: 0000:05:00.0
net_hinic: Initialize 0000:05:00.0 in primary failed
EAL: Releasing pci mapped resource for 0000:05:00.0
EAL: Calling pci_unmap_resource for 0000:05:00.0 at 0x8300000000
EAL: Calling pci_unmap_resource for 0000:05:00.0 at 0x8300030000
EAL: Requested device 0000:05:00.0 cannot be used
EAL: PCI device 0000:06:00.0 on NUMA socket 0
EAL:   probe driver: 19e5:200 net_hinic
EAL:   using IOMMU type 1 (Type 1)
net_hinic: Initializing pf hinic-0000:06:00.0 in primary process
net_hinic: Hwif is not ready
net_hinic: Initialize hwif failed, dev_name: 0000:06:00.0
net_hinic: Initialize hwif failed, dev_name: 0000:06:00.0
net_hinic: Create nic device failed, dev_name: 0000:06:00.0
net_hinic: Initialize 0000:06:00.0 in primary failed
EAL: Releasing pci mapped resource for 0000:06:00.0
EAL: Calling pci_unmap_resource for 0000:06:00.0 at 0x8300130000
EAL: Calling pci_unmap_resource for 0000:06:00.0 at 0x8300160000
EAL: Requested device 0000:06:00.0 cannot be used
EAL: PCI device 0000:7d:00.0 on NUMA socket 0
EAL:   probe driver: 19e5:a222 net_hns3
EAL: PCI device 0000:7d:00.1 on NUMA socket 0
EAL:   probe driver: 19e5:a221 net_hns3
EAL: PCI device 0000:7d:00.2 on NUMA socket 0
EAL:   probe driver: 19e5:a222 net_hns3
EAL: PCI device 0000:7d:00.3 on NUMA socket 0
EAL:   probe driver: 19e5:a221 net_hns3
VHOST_PORT: 
Specified port number(1) exceeds total system port number(0)
VHOST_DATA: Procesing on Core 1 started
​
Breakpoint 1, rte_vhost_driver_register (path=0x10c5550 "/tmp/sock0", flags=
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值