[ovs-dev] How to setup IVSHM in OVS-DPDK

Mauricio Vásquez mauricio.vasquezbernal at studenti.polito.it
Sat Jan 9 03:59:00 UTC 2016


Hello Furong,

Unfortunately it is not well documented, I'm going to explain what you need
to start:

- The ivshmem mechanism of DPDK does not work with a standard version of
QEMU, then you need a patched version. It could be found at the dpdk-ovs
project: https://github.com/01org/dpdk-ovs.
You can find information about how to compile it in the QEMU website.

- The dpdkr ports are composed of a pair of DPDK rte_rings, these rings
have to be shared to the VM using the IVSHMEM mechanism, it requires to
create a metadata file and pass it as argument to QEMU.
There is not a standard tool for creating this metadatafile, we developed a
tool for doing it:
https://github.com/netgroup-polito/un-orchestrator/blob/master/orchestrator/compute_controller/plugins/kvm-libvirt/cmdline_generator/cmdline_generator.c,
it is not documented but the code is very simple.
You can build your own using the dpdk ivshmem library if you want.

- In the guest operating system you have to install DPDK and enable the
huge pages.

I propose to try this configuration
https://github.com/01org/dpdk-ovs/blob/development/docs/04_Sample_Configurations/01_IVSHM.md
but using ovs-dpdk, the steps are the following:

Once ovs is running:

1. Create a switch
ovs-vsctl --no-wait add-br br0 -- set bridge br0 datapath_type=netdev

2. add physicals ports to the switch
ovs-vsctl --no-wait add-port br0 dpdk0 -- set Interface dpdk0   type=dpdk
ofport_request=1
ovs-vsctl --no-wait add-port br0 dpdk1 -- set Interface dpdk1   type=dpdk
ofport_request=2

3. add a dpdkr port to connect to the VM
ovs-vsctl --no-wait add-port br0 dpdkr1 -- set Interface dpdkr1
type=dpdkr ofport_request=3

4. create the flows
....

5. create the metadata file
Using our tool:
./cmdline_generator -m -p dpdkr1
It will generate a file with the command line to be added to qemu.

6. launch qemu with the command line generated in step 5.

7. Inside the VM compile and run the
https://github.com/openvswitch/ovs/blob/master/tests/dpdk/ring_client.c
program
./ring_client -c 1 -n 4 -- -n 1

If everything goes well, the system will be forward all the traffic that
receives in the interface dpdk0 to the interface dpdk1.











On 7 January 2016 at 06:16, Furong <WBAHACER at 126.com> wrote:

> Hello everybody:
>     I am trying to use IVSHM to exchange packets between VMs.
> On OVS side, I know the IVSHM channel is built upon the ring
> devices from DPDK. However, I do not know how to setup qemu
> to share this ring device's memory to VMs.
>
>     Could somebody give a short tutorial? Thanks!!
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



More information about the dev mailing list