<div dir="ltr"><div>Hey guys,</div><div><br></div><div> I want to share my tests results with OpenvSwitch and DPDK on Xenial.</div><div><br></div><div> So far, I'm a little bit frustrated... At first look, OVS with DPDK is wrose then just plain OVS. However, it will be just a matter of tuning it, at least, I hope so...</div><div><br></div><div><br></div><div> I am using the following reference docs:</div><div><br></div><div> * <a href="https://github.com/openvswitch/ovs/blob/master/INSTALL.DPDK.md">https://github.com/openvswitch/ovs/blob/master/INSTALL.DPDK.md</a></div><div><br></div><div> * <a href="https://help.ubuntu.com/16.04/serverguide/DPDK.html">https://help.ubuntu.com/16.04/serverguide/DPDK.html</a></div><div><br></div><div> * <a href="http://wiki.qemu.org/Features/vhost-user-ovs-dpdk">http://wiki.qemu.org/Features/vhost-user-ovs-dpdk</a></div><div><br></div><div><br></div><div> I have a Dell server with:</div><div><br></div><div> - 16 CPU Cores on 2 sockets, reported by cpu_layout.py (32 CPUs on /proc/cpuinfo - 16 HT on each NUMA)</div><div><br></div><div>   Intel(R) Xeon(R) CPU E5-2640 v3 @ 2.60GHz</div><div><br></div><div> - 2 NUMA Nodes</div><div> - 128G of RAM</div><div> - 2 x 1G NICs for management / service</div><div> - 2 x 10G NICs (ixgbe) available for DPDK on Numa node 0</div><div> - Plenty of storage</div><div><br></div><div><br></div><div> Here are the tests that I want to do, on top of those 2 x 10G NICs:</div><div><br></div><div><br></div><div> 1- "Regular OVS" L2 Bridge on bare-metal (no DPDK) - test executed</div><div><br></div><div> 2- "OVS + DPDK" L2 Bridge on bare-metal (powered by DPDK) - test executed</div><div><br></div><div> 3- "Regular OVS" on bare-metal plus a KVM guest running another "Regular OVS" (no DPDK) - future test</div><div><br></div><div> 4- "Regular OVS" on bare-metal plus a KVM guest running OVS+DPDK (DPDK only inside of a KVM VM) - future test</div><div><br></div><div> 5- "OVS + DPDK" on bare-metal plus a KVM guest running "Regular OVS" (DPDK only at the host) - future test - looks buggy today, I'm about to fill another bug report</div><div><br></div><div> 6- "OVS + DPDK" on bare-metal plus a KVM guest running another "OVS + DPDK" (DPDK on both host and guest) - future test - blocked by BUG <a href="https://bugs.launchpad.net/bugs/1577088">https://bugs.launchpad.net/bugs/1577088</a></div><div><br></div><div><br></div><div> At a glance, the test that I want to do, is very simple, which is to create a OVS+DPDK L2 bridge between 2 x 10G NICs on bare-metal (tests 2), no KVM Guests involved, later, I'll bring virtualization to the table (tests 3-6).</div><div><br></div><div> Later, I'll try a more advanced use-case, which will be to move this bare-metal OVS+DPDK L2 bridge (of test 2), to a KVM Virtual Machine (by doing the test 6).</div><div><br></div><div> I have an IXIA traffic generator sending 10G of data in both directions.</div><div><br></div><div> I also have a proprietary L2 Bridge DPDK Application (similar with OVS+DPDK) that, after tuning it, like isolcpus, CPU pinning, NUMA placement, it can handle 19.9G/s without ANY packet drop. This proprietary DPDK App was tested on this very same hardware that I'm testing Ubuntu, OVS and DPDK now.</div><div><br></div><div> So, I want to do the same with Xenial+OVS+DPDK (19.X G/s, no packet loss), but, I am unable to do it, it is slow and hard to tune. I'll share the instructions about how to reproduce the tests that I am doing.</div><div><br></div><div><br></div><div>*** Test 1 - Regular OVS on bare-metal:</div><div><br></div><div><br></div><div>apt install openvswitch-switch</div><div><br></div><div><br></div><div>ip l set dev p1p1 up</div><div>ip l set dev p1p2 up</div><div><br></div><div>ovs-vsctl add-br ovsbr</div><div>ovs-vsctl add-port ovsbr p1p1</div><div>ovs-vsctl add-port ovsbr p1p2</div><div><br></div><div>ip l set dev ovsbr up</div><div><br></div><div>* Rate:</div><div><br></div><div>bwm-ng -I ovsbr</div><div><br></div><div>Total: ~2.05 GB/s (good, 10-Gigabit on each direction)</div><div><br></div><div><br></div><div>* CPU consumption:</div><div><br></div><div>Kernel process "ksoftirqd/*" consuming many CPU cores! As follows:</div><div><br></div><div>Screenshot: <a href="http://i.imgur.com/pAKtrQa.png">http://i.imgur.com/pAKtrQa.png</a></div><div><br></div><div><br></div><div><br></div><div>Test 2 - OVS with DPDK on bare-metal:</div><div><br></div><div><br></div><div>apt install openvswitch-switch-dpdk</div><div><br></div><div>service openvswitch-switch stop</div><div><br></div><div>update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk</div><div><br></div><div><br></div><div>---</div><div>PCI IDs and NUMA node of p1p1 and p1p2:</div><div><br></div><div>PCI - /etc/dpdk/interfaces:</div><div><br></div><div>-</div><div>pci 0000:06:00.0 uio_pci_generic</div><div>pci 0000:06:00.1 uio_pci_generic</div><div>-</div><div><br></div><div>NUMA Node of dual 10G NIC cards:</div><div><br></div><div>cat /sys/class/net/p1p1/device/numa_node</div><div>0</div><div>---</div><div><br></div><div>File /etc/default/grub have:</div><div><br></div><div>-</div><div>iommu=pt intel_iommu=on default_hugepagesz=1GB hugepagesz=1G hugepages=8</div><div>-</div><div><br></div><div>File /etc/dpdk/dpdk.conf have:</div><div><br></div><div>-</div><div>NR_1G_PAGES=4</div><div>-</div><div><br></div><div>File /etc/default/openvswitch-switch have:</div><div><br></div><div>-</div><div>DPDK_OPTS='--dpdk -c 0x1 -n 4 -m 2048,0'</div><div>-</div><div><br></div><div>After installing and reconfiguring, I am rebooting the server...</div><div><br></div><div>* The OVS + DPDK magic:</div><div><br></div><div>ovs-vsctl add-br ovsbr -- set bridge ovsbr datapath_type=netdev</div><div><br></div><div>ovs-vsctl add-port ovsbr dpdk0 -- set Interface dpdk0 type=dpdk</div><div>ovs-vsctl add-port ovsbr dpdk1 -- set Interface dpdk1 type=dpdk</div><div><br></div><div>ip link set dev ovsbr up</div><div><br></div><div>bwm-ng -I ovsbr</div><div><br></div><div><br></div><div>Total: 756.4 MB/s</div><div><br></div><div><br></div><div>WTF!!! OVS powered by DPDK is more than 2 times slower than "Regular OVS"???</div><div><br></div><div>Looks like that OVS+DPDK sucks (but I'll bet that I am doing it wrong)... Lets keep trying...</div><div><br></div><div><br></div><div>* CPU consumption:</div><div><br></div><div>Process ovs-vswitchd is consuming 100% of Core 0 / NUMA 0. In fact, it is consuming less CPU than "Regular OVS"... Mmmm... Lets give more CPU Cores to this guy...</div><div><br></div><div><br></div><div>After tuning OVS PMD:</div><div><br></div><div>ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=F</div><div><br></div><div>Log:</div><div>---</div><div>dpif_netdev|INFO|Created 2 pmd threads on numa node 0</div><div>dpif_netdev(pmd37)|INFO|Core 2 processing port 'dpdk1'</div><div>dpif_netdev(pmd38)|INFO|Core 0 processing port 'dpdk0'</div><div>---</div><div><br></div><div>Bingo!</div><div><br></div><div>ovs-vswitchd now consumes 200% of CPU (top -d3)</div><div><br></div><div>"bwm-ng -I ovsbr" now shows:</div><div><br></div><div>Tota: 1.18 GB/s</div><div><br></div><div>Much better! But not good enough, "Regular OVS" reach ~2 GB/s"... Lets try to add more cores for PMD...</div><div><br></div><div><br></div><div>ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=FF</div><div><br></div><div>Log:</div><div>---</div><div>dpif_netdev|INFO|Created 4 pmd threads on numa node 0</div><div>dpif_netdev(pmd40)|INFO|Core 0 processing port 'dpdk0'</div><div>dpif_netdev(pmd41)|INFO|Core 2 processing port 'dpdk1'</div><div>---</div><div><br></div><div>Bad news...</div><div><br></div><div>ovs-vswitchd now consumes 400% of CPU (top -d3)</div><div><br></div><div><br></div><div>"bwm-ng -I ovsbr" now shows:</div><div><br></div><div><br></div><div>Total: ~1.05 GB/s</div><div><br></div><div><br></div><div>It is worse now! Because it is consuming two times the CPU resources, while the throughput is basically the same, in fact, it is slower now!</div><div><br></div><div>1 PMD thread (default), very bad perf (~750 MB/s)</div><div><br></div><div>2 PMD threads = Good but, not even close to regular OVS (without DPDK) (~1.18 GB/s)</div><div><br></div><div>4 PMD threads = Very bad, slower than when with only 2 PMD, while consumes twice the resources (~1.05 GB/s)</div><div><br></div><div><br></div><div>So, here is my question:</div><div><br></div><div><br></div><div>*** How to make OVS + DPDK hit the "~2 GB/s" mark (what Regular OVS can do "naturally") ?</div><div><br></div><div><br></div><div><br></div><div>So far, for this e-mail message, I only executed "Tests 1 and 2", the other tests, I'll let open for the subsequent e-mails. I think that now, we have a good "stop point" here, where I want to see OVS + DPDK at full speed (similar with Regular OVS can do), then, I'll proceed with more tests and messages.</div><div><br></div><div>Thoughts?</div><div><br></div><div>Cheers!</div><div>Thiago</div><div><br></div></div>