About this task
Procedure
-
Create the OVS Provider bridge:
ovs-vsctl --if-exists del-br br0 ovs-vsctl add-br br0 -- set bridge br0 \ datapath_type=netdev \ -- br-set-external-id br0 bridge-id br0 \ -- set bridge br0 fail-mode=standalone # Add physical port ovs-vsctl add-port br0 dpdk0 \ -- set interface dpdk0 type=dpdk \ options:dpdk-devargs=class=eth,mac=xx:xx:xx:xx:xx:xx \ mtu_request=1600
where:mac=xx:xx:xx:xx:xx:xx is the MAC address of the SmartNIC physical port.
For more information see Reading MAC Addresses of the SmartNIC.
-
Bring up the br0 internal port and bind it with an IP address to the
kernel TCPIP stack:
ip addr add 172.16.1.1/24 dev br0 ip link set br0 up
Note: 172.16.1.x is the local host IP address of the SmartNIC port.- When setting up host1, use address 172.16.1.1
- When setting up host2, use address 172.16.1.2
-
Start two VMs on host1:
/usr/libexec/qemu-kvm \ -enable-kvm -cpu host -m 4G -smp 4 \ -object memory-backend-file,id=mem,size=4G,mem-path=/mnt/huge,share=on \ -chardev socket,id=char0,path=/usr/local/var/run/stdvio5,server=on \ -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce=on \ -device virtio-net-pci,netdev=mynet1,mac=DE:AD:BE:EF:0A:01 \ -numa node,memdev=mem -mem-prealloc \ -net user,hostfwd=tcp::10021-:22 \ -net nic,macaddr=BA:AD:CA:FE:0A:01 \ -nographic \ /path/to/images/vm1.img /usr/libexec/qemu-kvm \ -enable-kvm -cpu host -m 4G -smp 4 \ -object memory-backend-file,id=mem,size=4G,mem-path=/mnt/huge,share=on \ -chardev socket,id=char0,path=/usr/local/var/run/stdvio6,server=on \ -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce=on \ -device virtio-net-pci,netdev=mynet1,mac=DE:AD:BE:EF:0A:02 \ -numa node,memdev=mem -mem-prealloc \ -net user,hostfwd=tcp::10022-:22 \ -net nic,macaddr=BA:AD:CA:FE:0A:02 \ -nographic \ /path/to/images/vm2.img