'How to attach vhostuser port to VM: ports are not being shown in VM
I am struggling with attaching OVS-DPDK ports to my VM. I am new to openstack, OVS-DPDK and here is my current setup:
I have created a VM with ports of physnets which are SRIOV port. I have other 2 ports which will be associated to OVS-DPDK. OVS-DPDK installed and have done below steps ( ovs-vswitchd (Open vSwitch) 2.17.0 DPDK 21.11.0)
- Binding UIO driver for NIC port
dpdk-devbind.py -b vfio-pci 08:00.0
dpdk-devbind.py -b vfio-pci 08:00.1
- Binding this DPDK port to OVS, called dpdkport
ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
ovs-vsctl add-port br0 dpdk-p0 -- set Interface dpdk-p0 type=dpdk ofport_request=1 options:dpdk-devargs=0000:08:00.0
ovs-vsctl add-port br0 dpdk-p1 -- set Interface dpdk-p1 type=dpdk ofport_request=2 options:dpdk-devargs=0000:08:00.1
/usr/libexec/qemu-kvm -name guest=instance-0000000c -chardev socket,id=char1,path=/var/run/dpdkvhostclient1,server -netdev type=vhost-user,id=mynet1,chardev=char1,vhostforce -device virtio-net-pci,mac=00:00:00:00:00:01,netdev=mynet1 -object memory-backend-file,id=mem1,size=0x8000000,mem-path=/dev/hugepages,share=on -numa node,memdev=mem1 -mem-prealloc &
and
/usr/libexec/qemu-kvm -name guest=instance-0000000c -chardev socket,id=char1,path=/var/run/dpdkvhostclient2,server -netdev type=vhost-user,id=mynet1,chardev=char1,vhostforce -device virtio-net-pci,mac=00:00:00:00:00:02,netdev=mynet1 -object memory-backend-file,id=mem1,size=0x8000000,mem-path=/dev/hugepages,share=on -numa node,memdev=mem1 -mem-prealloc &
- Add a vhostuser port to OVS
ovs-vsctl add-port br0 dpdkvhostclient1 -- set Interface dpdkvhostclient1 type=dpdkvhostuserclient ofport_request=3 options:vhost-server-path=/var/run/dpdkvhostclient1
ovs-vsctl add-port br0 dpdkvhostclient2 -- set Interface dpdkvhostclient2 type=dpdkvhostuserclient ofport_request=4 options:vhost-server-path=/var/run/dpdkvhostclient2
- Add a flow that forwarding PKT from vhostuser to dpdkport
ovs-ofctl del-flows br0
ovs-ofctl add-flow br0 in_port=1,actions=output:3
ovs-ofctl add-flow br0 in_port=2,actions=output:4
ovs-ofctl add-flow br0 in_port=3,actions=output:1
ovs-ofctl add-flow br0 in_port=4,actions=output:2
Logged into VM and I don't see any of dpdk port being shown in ipconfig -a also.
I am following https://docs.openvswitch.org/en/latest/topics/dpdk/vhost-user/#dpdk-vhost-user-client
I also tried putting in xml of my VM instance
<cpu mode='host-model' check='partial'>
<model fallback='allow'/>
<topology sockets='6' cores='1' threads='1'/>
<numa>
<cell id='0' cpus='0-5' memory='4096' unit='KiB' memAccess='shared'/>
</numa>
</cpu>
<memoryBacking>
<hugepages>
<page size='2048' unit='G'/>
</hugepages>
<locked/>
<source type='file'/>
<access mode='shared'/>
<allocation mode='immediate'/>
<discard/>
</memoryBacking>
<interface type='vhostuser'>
<mac address='0c:c4:7a:ea:4b:b2'/>
<source type='unix' path='/var/run/dpdkvhostclient1' mode='server'/>
<target dev='dpdkvhostclient1'/>
<model type='virtio'/>
<driver queues='2'>
<host mrg_rxbuf='on'/>
</driver>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
<interface type='vhostuser'>
<mac address='0c:c4:7a:ea:4b:b3'/>
<source type='unix' path='/var/run/dpdkvhostclient2' mode='server'/>
<target dev='dpdkvhostclient2'/>
<model type='virtio'/>
<driver queues='2'>
<host mrg_rxbuf='on'/>
</driver>
<address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/>
</interface>
Mac addresses of these dpdkuserports are some random and slots are also the one which were not present in xml. NUMA block was added in CPU section and memoryBacking was also added, rebooted instance hen but new interfaces didnt appear in VM.
dpduserport were shown DOWN as below
ovs-ofctl show br0
OFPT_FEATURES_REPLY (xid=0x2): dpid:00001cfd0870760c
n_tables:254, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
1(dpdk-p0): addr:1c:fd:08:70:76:0c
config: 0
state: 0
current: 1GB-FD AUTO_NEG
speed: 1000 Mbps now, 0 Mbps max
2(dpdk-p1): addr:1c:fd:08:70:76:0d
config: 0
state: 0
current: 1GB-FD AUTO_NEG
speed: 1000 Mbps now, 0 Mbps max
3(dpdkvhostclient): addr:00:00:00:00:00:00
config: 0
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
4(dpdkvhostclient): addr:00:00:00:00:00:00
config: 0
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
LOCAL(br0): addr:1c:fd:08:70:76:0c
config: PORT_DOWN
state: LINK_DOWN
current: 10MB-FD COPPER
speed: 10 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
What Am I missing ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|