[ovs-discuss] ovs + dpdk vhost-user VMs can not communication with PC

lifuqiong lifuqiong at cncloudsec.com
Sat Apr 16 08:51:47 UTC 2016


Hi:

 

I want to test dpdk vhost-user port on ovs to follow https://software.intel.com/en-us/blogs/2015/06/09/building-vhost-user-for-ovs-today-using-dpdk-200;
I create ovs+dpdk environment followed INSTALL.DPDK.md; and create 2 VMs, VMs Can communication with each other, but VM can not communicate with PC in the outside

Network, VMs and PC in a same subnet.

PC(192.168.0.103/24) ping vm(192.168.0.90);  vm’s host’s dpdk NIC and PC are in a L2 switch. And DPDK NIC connected to switch’s Port Eth1/0/8

 

Investigation:

         Binding VM’s IP and Mac in PC’s ARP table, and binding VM’s Mac in Port Eth1/0/8; PC is pinging vm, I can see Output packets of Eth1/0/8 increasing regularly, which means the ping request packet has send to DPDK NIC.

 

But the ovs-ofctl dump-flows show there is no packet comes into OVS. Why? 

 

ovs-ofctl dump-flows ovsbr0. (the n_packets keeps 11174 while PC is pinging VM);

NXST_FLOW reply (xid=0x4):

cookie=0x0, duration=115939.684s, table=0, n_packets=11174, n_bytes=873856, idle_age=935, hard_age=65534, priority=0 actions=NORMAL

       

         My switch has NO vlan , the default VLAN is 1. But when I ping from vm1 to vm2 , showing MaC address in OVS which shows as follows:

port  VLAN  MAC                Age

    4     0  00:00:00:00:02:12    1

3     0  00:00:00:00:00:04    1

 

 

What was the reason why VM cannot communication with the PC? Thank you

 

My environment as follows:

1.
        OVS: 2.5.0
        Dpdk: 2.2.0
        Qemu: 2.5.0

2. ovs-ofctl dump-flows ovsbr0. (the n_packets keeps 11174 while PC is pinging VM);

NXST_FLOW reply (xid=0x4):

cookie=0x0, duration=115939.684s, table=0, n_packets=11174, n_bytes=873856, idle_age=935, hard_age=65534, priority=0 actions=NORMAL


root at host52:~# ovs-vsctl show

4ed1b9ac-4644-4c0f-a44d-bdf40770e9a1

    Bridge "ovsbr0"

        Port "vhost-user-0"

            Interface "vhost-user-0"

                type: dpdkvhostuser

        Port "dpdk0"

            Interface "dpdk0"

                type: dpdk

        Port "vhost-user-1"

            Interface "vhost-user-1"

                type: dpdkvhostuser

        Port "ovsbr0"

            Interface "ovsbr0"

                type: internal

4. Start VM info:
qemu-system-x86_64 -m 1024 -smp 2 -hda /root/vm11.qcow2 -boot c -enable-kvm -vnc 0.0.0.0:1 -chardev socket,id=char1,path=/usr/local/var/run/openvswitch/vhost-user-0 -netdev type=vhost-user,id=mynet1,chardev=char1,vhostforce -device virtio-net-pci,mac=00:00:00:00:01:12,netdev=mynet1 -object memory-backend-file,id=mem,size=1024M,mem-path=/dev/hugepages,share=on -numa node,memdev=mem -mem-prealloc -d exec


5. My build command as follows:
#!/bin/bash



################ config and compile qemu ################ 

 

# cd qemu 

 

# ./configure 

 

# make 

 

# make install 

 

########################################################


################ config and compile dpdk  ################ 

 

# cd dpdk # make config T=x86_64-native-linuxapp-gcc 

 

# make install T=x86_64-native-linuxapp-gcc 

 

########################################################

################ config and compile ovs ################ 

 

# cd ovs # ./boot.sh 

# ./configure --localstatedir=/var --with-dpdk=/root/workplane/dpdk/x86_64-native-linuxapp-gcc
# make
# make install
########################################################



## set hugepage number, use boot cmdline or procfs 

 

echo 8 > /proc/sys/vm/nr_hugepages

## insert the kernel modules
modprobe uio
insmod $DPDK_BUILD/kmod/igb_uio.ko
insmod $DPDK_BUILD/kmod/rte_kni.ko
insmod $DPDK_DIR/lib/librte_vhost/eventfd_link/eventfd_link.ko

# unbind the dpdk interface

$DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio 01:00.0 $DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio 01:00.1

#Mount hugetable
mkdir -p /dev/hugepages
mount -t hugetlbfs -o pagesize=1G none /dev/hugepages

#first time
#ovsdb-tool create /usr/local/etc/openvswitch/conf.db /usr/local/share/openvswitch/vswitch.ovsschema

ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach --log-file

#firsttime only
#ovs-vsctl --no-wait init
ovs-vswitchd --dpdk -c 0x77 -n 2 --socket-mem 2048,0 -- unix:$DB_SOCK --pidfile --detach --log-file

##############################################################################
## Add brige
/usr/local/bin/ovs-vsctl add-br ovsbr0 -- set bridge ovsbr0 datapath_type=netdev

## Add dpdk port
/usr/local/bin/ovs-vsctl add-port ovsbr0 dpdk0 -- set Interface dpdk0 type=dpdk 

 



## Add vhost-user port
/usr/local/bin/ovs-vsctl add-port ovsbr0 vhost-user-0 -- set Interface vhost-user-0 type=dpdkvhostuser 

 

/usr/local/bin/ovs-vsctl add-port ovsbr0 vhost-user-1 -- set Interface vhost-user-1 type=dpdkvhostuser





 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20160416/bb061749/attachment-0002.html>


More information about the discuss mailing list