]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agodoc: Convert INSTALL.Windows to rST
Stephen Finucane [Sat, 8 Oct 2016 16:30:28 +0000 (17:30 +0100)]
doc: Convert INSTALL.Windows to rST

This has been extensively reworked such that the format of the document
matches that of INSTALL.rst. The sum of the content remains the same,
however.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert INSTALL.Docker to rST
Stephen Finucane [Sat, 8 Oct 2016 16:30:27 +0000 (17:30 +0100)]
doc: Convert INSTALL.Docker to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert INSTALL.Debian to rST
Stephen Finucane [Sat, 8 Oct 2016 16:30:26 +0000 (17:30 +0100)]
doc: Convert INSTALL.Debian to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert INSTALL.DPDK to rST
Stephen Finucane [Sat, 8 Oct 2016 16:30:25 +0000 (17:30 +0100)]
doc: Convert INSTALL.DPDK to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert INSTALL to rST
Stephen Finucane [Sat, 8 Oct 2016 16:30:24 +0000 (17:30 +0100)]
doc: Convert INSTALL to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodist-docs: Add support for rST
Stephen Finucane [Sat, 8 Oct 2016 16:30:23 +0000 (17:30 +0100)]
dist-docs: Add support for rST

This will eventually go away once Sphinx starts doing all this work for
us. For now, however, let's make sure we don't break the OVS website.

This introduces a new dependency for the dist-docs script - 'rst2html'.
This tool is packaged on Ubuntu, Fedora (via 'python-docutils'), etc.
and can be installed from pip using the 'docsutils' package.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agosystem-traffic: 802.1ad: Add datapath ping tests for CVLANs.
Eric Garver [Fri, 23 Sep 2016 19:16:25 +0000 (15:16 -0400)]
system-traffic: 802.1ad: Add datapath ping tests for CVLANs.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-common-macros: Add macros to add 802.1ad ports.
Eric Garver [Fri, 23 Sep 2016 19:16:24 +0000 (15:16 -0400)]
system-common-macros: Add macros to add 802.1ad ports.

Add macros ADD_SVLAN() and ADD_CVLAN().

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-userspace-macros: allow passing sed args to OVS_TRAFFIC_VSWITCHD_STOP()
Eric Garver [Fri, 23 Sep 2016 19:16:23 +0000 (15:16 -0400)]
system-userspace-macros: allow passing sed args to OVS_TRAFFIC_VSWITCHD_STOP()

Passing sed arguments to OVS_TRAFFIC_VSWITCHD_STOP() was being ignored
for check-system-userspace. This is useful to selective ignore log
messages.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agotimeval: Reorder elements in clock structure.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:15 +0000 (15:37 +0100)]
timeval: Reorder elements in clock structure.

By reordering the elements in clock structure, pad bytes
can be reduced and also a cache line is saved.

Before: structure size:136, holes:3, sum padbytes:18, cachelines:3
After: structure size:120, holes:1, sum padbytes:2, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetlink-socket: Reorder elements in nl_dump structure.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:14 +0000 (15:37 +0100)]
netlink-socket: Reorder elements in nl_dump structure.

By reordering the elements in nl_dump structure, pad bytes can be
reduced there by saving a cache line.

Before: structure size:72, holes:1, sum padbytes:4, cachelines:2
After: structure size:64, holes:0, sum padbytes:0, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovsdb: Reorder elements in ovsdb_table_schema structure.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:13 +0000 (15:37 +0100)]
ovsdb: Reorder elements in ovsdb_table_schema structure.

By reordering the elements in ovsdb_table_schema structure, pad bytes
can be reduced and also a cache line is saved.

Before: structure size:72, holes:2, sum padbytes:10, cachelines:2
After: structure size:64, holes:1, sum padbytes:2, cachelines:1

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpif: Reorder elements in dpif_upcall structure.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:12 +0000 (15:37 +0100)]
dpif: Reorder elements in dpif_upcall structure.

By reordering the data elements in dpif_upcall structure, pad bytes can
be reduced and also a cache line. Also dp_packet should be the first
member of the structure because rte_mbuf, the first member of dp_packet
should be aligned atleast on a 64-byte boundary.

Before: structure size:768, holes:1, sum padbytes:60, cachelines:12
After: structure size:704, holes:1, sum padbytes:4, cachelines:11

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpif-netdev: Reorder elements in dp_netdev_port structure.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:11 +0000 (15:37 +0100)]
dpif-netdev: Reorder elements in dp_netdev_port structure.

By reordering the data elements in dp_netdev_port structure, pad bytes
can be reduced and there by saving a cache line.

Before: structure size:136, holes:3, sum padbytes:15, cachelines:3
After: structure size:128, holes:2, sum padbytes:7, cachelines:2

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpif-netdev: Cache align netdev_flow_keys.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:10 +0000 (15:37 +0100)]
dpif-netdev: Cache align netdev_flow_keys.

Aligning the 'keys' array seems to have positive performance impact.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpif-netdev: Add comments to dp_netdev_input__().
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:08 +0000 (15:37 +0100)]
dpif-netdev: Add comments to dp_netdev_input__().

Add comments in dp_netdev_input__() to explain the reason behind
clearing the flow batches before packet_batch_execute().

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agohash: Skip Invoking mhash_add__() with zero input.
Bhanuprakash Bodireddy [Fri, 14 Oct 2016 14:37:07 +0000 (15:37 +0100)]
hash: Skip Invoking mhash_add__() with zero input.

mhash_add__() is expensive and should be only called with valid input.
zero-valued 'data' will not affect the 'hash' value and expensive hash
computation can be skipped when input is zero.

This patch will validate the input in mhash_add__ to save some cpu
cycles.

Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agostream-ssl: Fix memory leak on error path.
Ben Pfaff [Fri, 14 Oct 2016 18:12:43 +0000 (11:12 -0700)]
stream-ssl: Fix memory leak on error path.

The commit that this fixes is from 2009.

Reported-by: Kai-Wei Fan <fank@vmware.com>
Fixes: 9467fe624698 ("Add SSL support to "stream" library and OVSDB.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoPython-IDL: getattr after mutate fix
Amitabha Biswas [Wed, 12 Oct 2016 21:36:57 +0000 (14:36 -0700)]
Python-IDL: getattr after mutate fix

This commit returns the updated column value when getattr is done
after a mutate operation is performed (but before the commit).

Signed-off-by: Amitabha Biswas <azbiswas@gmail.com>
Reported-by: Richard Theis <rtheis@us.ibm.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-September/080120.html
Fixes: a59912a0ee8e ("python: Add support for partial map and set updates")
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agorhel-systemd: Delay shutting down the services
Aaron Conole [Fri, 7 Oct 2016 17:36:45 +0000 (13:36 -0400)]
rhel-systemd: Delay shutting down the services

During testing it was found that systemd would consider the openvswitch
service as a part of networking component, but the dependent services of
ovs-vswitchd and ovsdb-server were not likewise considered.  This leads
to some strange race conditions, observed when using NFS over TCP, while
shutting down systems.

Fixes: 84ad12083491 ("rhel: Improved Systemd Integration")
Co-authored-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Update DPDK pdump documentation
Mark Kavanagh [Thu, 6 Oct 2016 10:25:33 +0000 (11:25 +0100)]
doc: Update DPDK pdump documentation

The DPDK pdump sample app was renamed from 'dpdk_pdump' to
'dpdk-pdump'. Update references to same within
INSTALL.DPDK-ADVANCED.md.

Add an additional sample command line that shows how to capture all
traffic traversing an interface within a single pcap file - a useful
tool for debugging DPDK-related issues.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpdk: Fix DPDK pdump compilation
Ciara Loftus [Thu, 13 Oct 2016 17:27:51 +0000 (18:27 +0100)]
dpdk: Fix DPDK pdump compilation

The rte_pdump header file was not included in the file that requires it.
Fix this.

Fixes: 01961bbdd34a ("dpdk: New module with some code from netdev-dpdk.")
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpdk: New module with some code from netdev-dpdk.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
dpdk: New module with some code from netdev-dpdk.

There's a lot of code in netdev-dpdk which is not at all related to the
netdev interface, mostly the library initialization code.

This commit moves it to a new 'dpdk' module, to simplify 'netdev-dpdk'.

Also a new module 'dpdk-stub' is introduced to implement some functions
when DPDK is not available.  This replaces the old 'netdev-nodpdk'
module.

Some redundant includes are removed or reorganized as a consequence.

No functional change.

CC: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Change vlog module name to 'netdev_dpdk'.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Change vlog module name to 'netdev_dpdk'.

It is customary to have the vlog module name similar to the filename.
Plus a following commit will introduce a 'dpdk' module.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Use init() function to initialize classes.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Use init() function to initialize classes.

It's better to use the classes init() functions to perform
initialization required for classes.

This will make it easier to move dpdk_init__() to a separate module in a
future commit.

No functional change.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Remove useless 'rte_eal_init_ret'.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Remove useless 'rte_eal_init_ret'.

If rte_eal_init() fails, we do not register the DPDK netdev classes,
therefore it's impossible to reach the classes construct functions.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Remove useless nonpmd_mempool_mutex.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Remove useless nonpmd_mempool_mutex.

Since DPDK commit 30e639989227("mempool: support non-EAL thread"),
non-EAL threads can use the mempool API safely.  Plus, nonpmd threads
access to netdev is already serialized with 'non_pmd_mutex' in
dpif-netdev.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Use xasprintf() when possible.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Use xasprintf() when possible.

We're in the slowpath.  I find it easier to allocate and free memory,
than to handle snprintf() error conditions.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Do not abort if out of hugepage memory.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Do not abort if out of hugepage memory.

We can run out of hugepage memory coming from rte_*alloc() more easily
than heap coming from malloc().

Therefore:

* We should not use hugepage memory if we're going to access it only in
  the slowpath.
* We shouldn't abort if we're out of hugepage memory.
* We should gracefully handle out of memory conditions.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Acquire dev->stats_lock only once.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Acquire dev->stats_lock only once.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Use RCU for egress QoS.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Use RCU for egress QoS.

I think it's clearer to use RCU than to check for a pointer twice in the
fast path (before and after taking the spinlock). Now the spinlock is
integrated into 'qos_conf'.

'qos_conf' objects cannot be modified, so, instead of having
'qos_set()', we now have 'qos_is_equal()', which tells us if an object
must be destroyed and recreated.

With this patch we also avoid passing the netdev parameter to qos ops,
since it was unused most of the times.

Lastly, some duplication is removed.

CC: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk: Refactor dpdk_mp_get().
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk: Refactor dpdk_mp_get().

The error handling path in dpdk_mp_get() is getting complicated, it
even requires a boolean variable.

Simplify it by extracting the function dpdk_mp_create().

CC: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-nodpdk.c: Add missing copyright.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-nodpdk.c: Add missing copyright.

Looks like we forgot to add the copyright headers to netdev-dpdk.h.
Looking at the contribution history of the file, this commit adds the
header with Red Hat copyright.

CC: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agonetdev-dpdk.h: Add missing copyright.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
netdev-dpdk.h: Add missing copyright.

Looks like we forgot to add the copyright headers to netdev-dpdk.h.
Looking at the contribution history of the file, this commit adds the
header with Nicira copyright.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Tested-by: Aaron Conole <aconole@redhat.com>
7 years agodpif-netdev: Fix crash in dpif_netdev_execute().
Daniele Di Proietto [Tue, 4 Oct 2016 21:53:31 +0000 (14:53 -0700)]
dpif-netdev: Fix crash in dpif_netdev_execute().

dp_netdev_get_pmd() is allowed to return NULL (even if we call it with
NON_PMD_CORE_ID) for different reasons:

* Since we use RCU to protect pmd threads, it is possible that
  ovs_refcount_try_ref_rcu() has failed.
* During reconfiguration we destroy every thread.

This commit makes sure that we always handle the case when
dp_netdev_get_pmd() returns NULL without crashing (the change in
dpif_netdev_run() doesn't fix anything, because everything is happening
in the main thread, but it's better to honor the interface in case we
change our threading model).

This actually fixes a pretty serious crash that happens if
dpif_netdev_execute() is called from a non pmd thread while
reconfiguration is happening.  It can be triggered by enabling bfd
(because it's handled by the monitor thread, which is a non pmd thread)
on an interface and changing something that requires datapath
reconfiguration (n_rxq, pmd-cpu-mask, mtu).

A testcase that reproduces the race condition is included.

This is a possible backtrace of the segfault:

 #0  0x000000000060c7f1 in dp_execute_cb (aux_=0x7f1dd2d2a320,
 packets_=0x7f1dd2d2a370, a=0x7f1dd2d2a658, may_steal=false) at
 ../lib/dpif-netdev.c:4357
 #1  0x00000000006448b2 in odp_execute_actions (dp=0x7f1dd2d2a320,
 batch=0x7f1dd2d2a370, steal=false, actions=0x7f1dd2d2a658,
 actions_len=8,
     dp_execute_action=0x60c7a5 <dp_execute_cb>) at
 ../lib/odp-execute.c:538
 #2  0x000000000060d00c in dp_netdev_execute_actions (pmd=0x0,
 packets=0x7f1dd2d2a370, may_steal=false, flow=0x7f1dd2d2ae70,
 actions=0x7f1dd2d2a658, actions_len=8,
     now=44965873) at ../lib/dpif-netdev.c:4577
 #3  0x000000000060834a in dpif_netdev_execute (dpif=0x2b67b70,
 execute=0x7f1dd2d2a578) at ../lib/dpif-netdev.c:2624
 #4  0x0000000000608441 in dpif_netdev_operate (dpif=0x2b67b70,
 ops=0x7f1dd2d2a5c8, n_ops=1) at ../lib/dpif-netdev.c:2654
 #5  0x0000000000610a30 in dpif_operate (dpif=0x2b67b70,
 ops=0x7f1dd2d2a5c8, n_ops=1) at ../lib/dpif.c:1268
 #6  0x000000000061098c in dpif_execute (dpif=0x2b67b70,
 execute=0x7f1dd2d2aa50) at ../lib/dpif.c:1233
 #7  0x00000000005b9008 in ofproto_dpif_execute_actions__
 (ofproto=0x2b69360, version=18446744073709551614, flow=0x7f1dd2d2ae70,
 rule=0x0, ofpacts=0x7f1dd2d2b100,
     ofpacts_len=16, indentation=0, depth=0, resubmits=0,
 packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif.c:3806
 #8  0x00000000005b907a in ofproto_dpif_execute_actions
 (ofproto=0x2b69360, version=18446744073709551614, flow=0x7f1dd2d2ae70,
 rule=0x0, ofpacts=0x7f1dd2d2b100,
     ofpacts_len=16, packet=0x7f1dd2d2b5c0) at
 ../ofproto/ofproto-dpif.c:3823
 #9  0x00000000005dea9b in xlate_send_packet (ofport=0x2b98380,
 oam=false, packet=0x7f1dd2d2b5c0) at
 ../ofproto/ofproto-dpif-xlate.c:5792
 #10 0x00000000005bab12 in ofproto_dpif_send_packet (ofport=0x2b98380,
 oam=false, packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif.c:4628
 #11 0x00000000005c3fc8 in monitor_mport_run (mport=0x2b8cd00,
 packet=0x7f1dd2d2b5c0) at ../ofproto/ofproto-dpif-monitor.c:287
 #12 0x00000000005c3d9b in monitor_run () at
 ../ofproto/ofproto-dpif-monitor.c:227
 #13 0x00000000005c3cab in monitor_main (args=0x0) at
 ../ofproto/ofproto-dpif-monitor.c:189
 #14 0x00000000006a183a in ovsthread_wrapper (aux_=0x2b8afd0) at
 ../lib/ovs-thread.c:342
 #15 0x00007f1dd75eb444 in start_thread (arg=0x7f1dd2d2c700) at
 pthread_create.c:333
 #16 0x00007f1dd6e1d20d in clone () at
 ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agovagrant: add CentOS 7.2 support
Thadeu Lima de Souza Cascardo [Tue, 27 Sep 2016 19:13:11 +0000 (16:13 -0300)]
vagrant: add CentOS 7.2 support

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotests: Get rid of overly specific --pidfile and --unixctl options.
Ben Pfaff [Thu, 6 Oct 2016 03:07:56 +0000 (20:07 -0700)]
tests: Get rid of overly specific --pidfile and --unixctl options.

At an early point in OVS development, OVS was built with fixed default
directories for pidfiles and sockets.  This meant that it was necessary to
use lots of --pidfile and --unixctl options in the testsuite, to point the
daemons to where they should put these files (since the testsuite cannot
and generally should not touch the real system /var/run).  Later on,
the environment variables OVS_RUNDIR, OVS_LOGDIR, etc. were introduced
to override these defaults, and even later the testsuite was changed to
always set these variables correctly in every test.  Thus, these days it
isn't usually necessary to specify a filename on --pidfile or to specify
--unixctl at all.  However, many of the tests are built by cut-and-paste,
so they tended to keep appearing anyhow.  This commit drops most of them,
making the testsuite easier to read and understand.

This commit also sweeps away some other historical detritus.  In
particular, in early days of the testsuite there was no way to
automatically kill daemons when a test failed (or otherwise ended).  This
meant that some tests were littered with calls to "kill `cat pidfile`" on
almost every line (or m4 macros that expanded to the same thing) so that if
a test failed partway through the testsuite would not hang waiting for a
daemon to die that was never going to die without manual intervention.
However, a long time ago we introduced the "on_exit" mechanism that
obsoletes this.  This commit eliminates a lot of the old litter of kill
invocations, which also makes those tests easier to read.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agotests: Fix double-rebuild of testsuite for "check-valgrind" and similar.
Ben Pfaff [Wed, 12 Oct 2016 17:40:53 +0000 (10:40 -0700)]
tests: Fix double-rebuild of testsuite for "check-valgrind" and similar.

When I ran "make check-valgrind -j10" and the testsuite needed to be
rebuilt, two copies of it were rebuilt in parallel and sometimes they
raced with each other.  I don't have the full story on exactly why this
happened, but this commit, which eliminates redundant dependencies from
check-* targets, fixes the problem for me.  The dependencies are redundant
because these targets depend on "all", which also depends on them.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agolex: Treat formfeeds as white space.
Ben Pfaff [Fri, 7 Oct 2016 17:04:35 +0000 (10:04 -0700)]
lex: Treat formfeeds as white space.

Also vertical tabs, whatever those are.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-northd: fix router ingress table ID in comments
Zongkai LI [Tue, 11 Oct 2016 07:50:20 +0000 (07:50 +0000)]
ovn-northd: fix router ingress table ID in comments

This patch fixes wrong table ID in comments for logical router ingress
table IP Routing, ARP Resolution and ARP request.

Signed-off-by: Zongkai LI <zealokii@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoexpr: Better simplify some special cases of expressions.
Ben Pfaff [Thu, 6 Oct 2016 22:31:07 +0000 (15:31 -0700)]
expr: Better simplify some special cases of expressions.

It's pretty unlikely that a human would write expressions like these, but
they can come up in machine-generated expressions and it seems best to
simplify them in an efficient way.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoexpr: Improve test so that it would have found the bugs I just fixed.
Ben Pfaff [Fri, 7 Oct 2016 03:19:52 +0000 (20:19 -0700)]
expr: Improve test so that it would have found the bugs I just fixed.

The test didn't check for x == 0/0 or x != 0/0 cases, and thus they were
buggy.

Also, add "expression" as a keyword for tests that only had "expressions"
(plural).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoexpr: Fix abort when simplifying "x != 0/0".
Ben Pfaff [Fri, 7 Oct 2016 01:08:30 +0000 (18:08 -0700)]
expr: Fix abort when simplifying "x != 0/0".

The test added by this commit is very specific to the particular problem,
whereas a more general test would be better.  A later commit adds the
general test.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoexpr: Simplify "x == 0/0" into 1.
Ben Pfaff [Fri, 7 Oct 2016 00:54:19 +0000 (17:54 -0700)]
expr: Simplify "x == 0/0" into 1.

An expression like "x == 0/0" does not test any actual bits in field x,
so it resolves to true, but expr_simplify() was not smart enough to see
this.

This goes beyond an optimization, to become a bug fix, because
expr_normalize() will assert-fail for expressions that become trivial
when this simplification is omitted.  For example:

    $ echo 'eth.dst == 0/0 && eth.dst == 0/0' | tests/ovstest test-ovn normalize-expr
    test-ovn: ../include/openvswitch/list.h:245: assertion !ovs_list_is_empty(list) failed in ovs_list_front()
    Aborted (core dumped)

This commit fixes this and related problems.

The test added by this commit is very specific to the particular problem,
whereas a more general test would be better.  A later commit adds the
general test.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agometa-flow: Fix the NXM_NX_* names of xxreg2 and xxreg3.
Jarno Rajahalme [Mon, 10 Oct 2016 18:27:57 +0000 (11:27 -0700)]
meta-flow: Fix the NXM_NX_* names of xxreg2 and xxreg3.

xxreg2 and xxreg3 had the same NXM_NX_* names as xxreg0 and xxreg1,
correspondingly.

Also add placeholders for future expansion for four more xxregs.

Found by inspection.

CC: Justin Pettit <jpettit@ovn.org>
Fixes: b23ada8eecfd ("Introduce 128-bit xxregs.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agovagrant: cleanup before building
Thadeu Lima de Souza Cascardo [Sat, 8 Oct 2016 10:27:17 +0000 (07:27 -0300)]
vagrant: cleanup before building

Clean the source directory before building, otherwise, build might fail if it
has been configured already.

Only do it if there is a Makefile present, as suggested by Ben Pfaff.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agovagrant: use RECHECK=yes for system checks
Thadeu Lima de Souza Cascardo [Mon, 19 Sep 2016 19:31:04 +0000 (16:31 -0300)]
vagrant: use RECHECK=yes for system checks

Use RECHECK=yes for both kernel and userspace datapath tests.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovn: Fix "trace" test to wait for synchronization of southbound ports.
Ben Pfaff [Tue, 20 Sep 2016 21:42:09 +0000 (14:42 -0700)]
ovn: Fix "trace" test to wait for synchronization of southbound ports.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-trace: Include source file and line number reference in output.
Ben Pfaff [Fri, 16 Sep 2016 05:25:51 +0000 (22:25 -0700)]
ovn-trace: Include source file and line number reference in output.

This should make it that much easier to track down the code that emitted
a particular flow.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agosmap: New macro SMAP_CONST2 for an immutable map of 2 key-value pairs.
Ben Pfaff [Tue, 29 Mar 2016 22:04:04 +0000 (15:04 -0700)]
smap: New macro SMAP_CONST2 for an immutable map of 2 key-value pairs.

Future commits will add a user.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-northd: Drop redundant matching constraints in build_stateful().
Ben Pfaff [Fri, 23 Sep 2016 22:45:11 +0000 (15:45 -0700)]
ovn-northd: Drop redundant matching constraints in build_stateful().

ip4.dst implies ip, udp.dst implies udp, and tcp.dst implies tcp.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoovn: Remove weird or unneeded keywords from tests.
Ben Pfaff [Wed, 21 Sep 2016 03:33:50 +0000 (20:33 -0700)]
ovn: Remove weird or unneeded keywords from tests.

AT_KEYWORDS are mostly there to make it easier to find the tests you're
looking for.  One might, for example, mark tests as "positive" or
"negative" so you can select the tests you want to run on that basis.
They're also useful for cases where Autotest just isn't good at splitting
words: for example, Autotest includes punctuation so that a test name
that has a word followed by a comma or colon won't be selected using a
keyword that lacks the comma or the colon.

But a lot of OVN tests had keywords that just didn't seem helpful in one
of these ways.  For example, it's hard to guess why running together
words into a longer word would help someone select a test, and it's not
helpful at all to repeat one of the words in the test name, since those
words are keywords by default anyway.

Therefore, this commit removes the keywords that don't seem helpful.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Fix some races in ovn-controller-vtep tests.
Ben Pfaff [Sat, 1 Oct 2016 00:56:54 +0000 (17:56 -0700)]
ovn: Fix some races in ovn-controller-vtep tests.

This fixes a few races for port bindings appearing and being bound to
a chassis.  The ones changed to use "ovn-sbctl wait-until" were previously
only waiting until a Port_Binding record appeared (created by ovn-northd),
but not until the Port_Binding record's 'chassis' column was set (by
ovn-controller).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Wait for ovn-northd to catch up in "ovn-sbctl" test.
Ben Pfaff [Fri, 23 Sep 2016 03:35:18 +0000 (20:35 -0700)]
ovn: Wait for ovn-northd to catch up in "ovn-sbctl" test.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Fix some races in IPAM connectivity test.
Ben Pfaff [Fri, 7 Oct 2016 15:32:22 +0000 (08:32 -0700)]
ovn: Fix some races in IPAM connectivity test.

It can take a way for dynamic addresses to propagate through ovn-northd,
so wait for it to happen.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Fix bugs in port security test.
Ben Pfaff [Sun, 11 Sep 2016 04:40:18 +0000 (21:40 -0700)]
ovn: Fix bugs in port security test.

A number of instances of "{i}" in this test should have been "${i}".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Fix races in MAC_Binding deletion test.
Ben Pfaff [Thu, 8 Sep 2016 17:08:20 +0000 (10:08 -0700)]
ovn: Fix races in MAC_Binding deletion test.

The test assumed that ovn-northd could delete the MAC_Binding rows
instantly, but it may take a while.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
7 years agoNEWS: Add release date for 2.6.0.
Ben Pfaff [Thu, 6 Oct 2016 20:51:08 +0000 (13:51 -0700)]
NEWS: Add release date for 2.6.0.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
7 years agoovn-northd: support IPAM with externally specified MAC
Lance Richardson [Thu, 6 Oct 2016 19:58:51 +0000 (15:58 -0400)]
ovn-northd: support IPAM with externally specified MAC

The current IPAM implementation allocates both a MAC address and
an IPv4 address when dynamic address allocation is requested. This
patch adds the ability to specify a fixed MAC address for use with
dynamic IPv4 address allocation.

Example:
   ovn-nbctl lsp-set-addresses p1 "00:01:02:03:04:05 dynamic"

Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: honor ovs_idl_txn when calculating and installing flows.
Ryan Moats [Thu, 6 Oct 2016 01:55:03 +0000 (20:55 -0500)]
ovn-controller: honor ovs_idl_txn when calculating and installing flows.

ovs_idl_txn is checked before various routines (like patch_run) execute.
However, flow calculation and installation does not also check this
variable, which can lead to oscillations as described in [1].

[1] http://openvswitch.org/pipermail/dev/2016-October/080247.html

Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: Make ipam tests more reliable
nickcooper-zhangtonghao [Thu, 6 Oct 2016 17:13:27 +0000 (10:13 -0700)]
ovn: Make ipam tests more reliable

The IPAM tests began to fail occasionally. Adding --wait=sb
to commands triggering address allocation eliminated these failures.

CC: Nimay Desai <nimaydesai1@gmail.com>
Fixes: 8639f9be ("ovn-northd, tests: Adding IPAM to ovn-northd.")
Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agojson: Fix non-static json char lookup table.
Joe Stringer [Thu, 6 Oct 2016 02:33:39 +0000 (11:33 +0900)]
json: Fix non-static json char lookup table.

This warning breaks the build on travis:
lib/json.c:1627:12: error: symbol 'chars_escaping' was not declared.
Should it be static?

CC: Esteban Rodriguez Betancourt <estebarb@hpe.com>
Reported-At: https://travis-ci.org/openvswitch/ovs/jobs/165300417
Fixes: 644ecb10a661 ("json: Serialize strings using a lookup table")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: Improve ovn-nbctl manpage
nickcooper-zhangtonghao [Wed, 5 Oct 2016 11:20:45 +0000 (04:20 -0700)]
ovn-nbctl: Improve ovn-nbctl manpage

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
[blp@ovn.org added further improvements]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: Fix memory leak in nbctl_lr_route_add
nickcooper-zhangtonghao [Wed, 5 Oct 2016 11:20:44 +0000 (04:20 -0700)]
ovn-nbctl: Fix memory leak in nbctl_lr_route_add

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: Check the length of MAC address
nickcooper-zhangtonghao [Wed, 5 Oct 2016 11:20:43 +0000 (04:20 -0700)]
ovn-nbctl: Check the length of MAC address

The command "ovn-nbctl lrp-add" should not set the MAC address
which length is invalid to logical router port. This patch
updates the eth_addr_from_string() to check trailing characters.
We should use the ovs_scan() to check the "addresses" owned by
the logical port, instead of eth_addr_from_string(). This patch
also updates the ovn-nbctl tests.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoDSCP marking on packets
Babu Shanmugam [Wed, 5 Oct 2016 08:27:47 +0000 (13:57 +0530)]
DSCP marking on packets

This patch adds support for marking qos on IP packets based on arbitrary
match criteria for a logical switch.

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Suggested-by: Mickey Spiegel <mickeys.dev@gmail.com>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
[blp@ovn.org fixes races in the test and added ovn-trace checks]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agojson: Serialize strings using a lookup table
Rodriguez Betancourt, Esteban [Wed, 5 Oct 2016 16:47:21 +0000 (16:47 +0000)]
json: Serialize strings using a lookup table

The existing implementation uses a switch with
many conditions, that when compiled is translated
to a not optimal series of conditional jumps.

With a lookup table the generated code has less conditional jumps,
that should translate in improving the CPU ability to predict the
jumps.

Performance Comparison:
All the timings are in nanoseconds, "OVS Master" corresponds to 13a1d36.
N is the number of repetitions

Serialize vswitch.ovsschema
N        OVS Master  Lookup Table    Difference    Diff per op
1           233182        200369       32813        32813
10         2724931       1919168      805763        80576.3
100       22802794      24406648    -1603854       -16038.54
1000     253645888     206259760    47386128        47386.128
10000   2352245703    1906839780   445405923        44540.5923
100000 23967770920   19012178655  4955592265        49555.92265

Serialize echo example
N        OVS Master  Lookup Table    Difference    Diff per op
1            3857        12565         -8708        -8708
10          17403         7312         10091         1009.1
100         57859        56613          1246           12.46
1000       592310       528110         64200           64.2
10000     6096334      5576109        520225           52.0225
100000   60970439     58477626       2492813           24.92813

Serialize mutate example
N        OVS Master  Lookup Table    Difference    Diff per op
1            7115          19051         -11936      -11936
10          34110          39561          -5451        -545.1
100        296613         298645          -2032        -20.32
1000      3510499        2930588         579911        579.911
10000    33898710       30278631        3620079        362.0079
100000  305069356      280622992       24446364        244.46364

Signed-off-by: Esteban Rodriguez Betancourt <estebarb@hpe.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Add SSL support to the python ovs client library
Numan Siddique [Wed, 5 Oct 2016 12:20:24 +0000 (17:50 +0530)]
python: Add SSL support to the python ovs client library

SSL support is added to the ovs/stream.py. pyOpenSSL library is used
to support SSL. If this library is not present, then the SSL stream
is not registered with the Stream class.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoINSTALL.Docker: Explain how to set up a system-id.
Ben Pfaff [Tue, 4 Oct 2016 23:01:05 +0000 (16:01 -0700)]
INSTALL.Docker: Explain how to set up a system-id.

Reported-by: Hui Kang <hkang.sunysb@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Always delete rules before deleting a meter.
Jarno Rajahalme [Wed, 5 Oct 2016 01:03:59 +0000 (18:03 -0700)]
ofproto: Always delete rules before deleting a meter.

When deleting a bridge it is currently possible to delete a mater
without deleting the rules using the meter first.  Fix this by moving
the meter's rule deletion to meter_delete().

Reported-by: Petr Machata <pertm@mellanox.com>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoNEWS: Move entry from 'v2.6.0' to 'Post-v2.6.0'
Ciara Loftus [Tue, 4 Oct 2016 12:58:30 +0000 (13:58 +0100)]
NEWS: Move entry from 'v2.6.0' to 'Post-v2.6.0'

Configurable queue sizing for DPDK ports did not make the 2.6 release
however the NEWS entry suggests it did. Fix this.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agojson: Use reference counting in JSON objects
Rodriguez Betancourt, Esteban [Tue, 4 Oct 2016 19:31:48 +0000 (19:31 +0000)]
json: Use reference counting in JSON objects

After profiling OVSDB insert performance it was found
that some significant portion of its time OVSDB is
calling the function json_clone.

Also, the current usages of json_clone never modify the json,
just keeps it to prevent it to be freed.

With that in mind the struct json, json_create, json_clone
and json_destroy were modified to keep a count of how many
references of the json struct are left. Only when that count
reaches zero the json struct is freed.

The old "json_clone" function was renamed as "json_deep_clone".

Some examples of the performance difference:

In these tests a test table with 4 columns (string, string,
bool, integer) was used. All the tests used "commit block".

*** 50 process each inserting 1000 rows ***

Master OVS
Test Duration                   131 seconds
Average Inserts Per second      746.2687 inserts/s
Average Insert Duration         134.1382 ms
Minimal Insert Duration           0.166202 ms
Maximum Insert Duration         489.8593 ms

JSON GC Patch
Test Duration                   86 seconds
Average Inserts Per second    1176 inserts/s
Average Insert Duration         82.26761 ms
Minimal Insert Duration          0.165448 ms
Maximum Insert Duration        751.2111 ms

*** 5 process each inserting 10000 rows ***

Master OVS
Test Duration                      8 seconds
Average Inserts Per second      7142.857 inserts/s
Average Insert Duration            0.656431 ms
Minimal Insert Duration            0.125197 ms
Maximum Insert Duration           11.93203 ms

JSON GC Patch
Test Duration                      7 seconds
Average Inserts Per second      8333.333 inserts/s
Average Insert Duration            0.55688 ms
Minimal Insert Duration            0.143233 ms
Maximum Insert Duration           26.26319 ms

Signed-off-by: Esteban Rodriguez Betancourt <estebarb@hpe.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovstest: Initialize command mode to RO
Aaron Conole [Tue, 4 Oct 2016 20:18:10 +0000 (16:18 -0400)]
ovstest: Initialize command mode to RO

When the read-only infrastucture support was added, the test-suite
registration was missed.  This causes tools like valgrind to complain
about uninitialized variable usage.

Fixes: 1f4a7252d9e7 ("Add read-only option to ovs-dpctl and...")
Cc: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-ctl: Handle start up errors.
Markos Chandras [Mon, 12 Sep 2016 09:07:57 +0000 (10:07 +0100)]
ovs-ctl: Handle start up errors.

Make sure we take the return values into consideration so we can
break early in case of failures. This makes the ovs-ctl helper more
accurate in reporting the real status of its managing processes.

Signed-off-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoovs-lib: Signal start_daemon failures.
Markos Chandras [Mon, 12 Sep 2016 09:07:56 +0000 (10:07 +0100)]
ovs-lib: Signal start_daemon failures.

Make sure we communicate failures to the caller when start_daemon fails
to start a process as the caller may not be able to proceed after this.

Signed-off-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agoCheck and allocate free qdisc queue id for ports with qos parameters
Babu Shanmugam [Wed, 7 Sep 2016 06:10:11 +0000 (11:40 +0530)]
Check and allocate free qdisc queue id for ports with qos parameters

ovn-northd processes the list of Port_Bindings and hashes the list of
queues per chassis. When it finds a port with qos_parameters and without
a queue_id, it allocates a free queue for the chassis that this port belongs.
The queue_id information is stored in the options field of Port_binding table.
Adds an action set_queue to the ingress table 0 of the logical flows
which will be translated to openflow set_queue by ovn-controller

ovn-controller opens the netdev corresponding to the tunnel interface's
status:tunnel_egress_iface value and configures a HTB qdisc on it. Then for
each SB port_binding that has queue_id set, it allocates a queue with the
qos_parameters of that port. It also frees up unused queues.

This patch replaces the older approach of policing

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoappveyor: Update OpenSSL version
Alin Serdean [Tue, 4 Oct 2016 14:47:28 +0000 (14:47 +0000)]
appveyor: Update OpenSSL version

OpenSSL version changed from 1.0.2h to 1.0.2j.

This patch bumps the version for the appveyor config.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoAUTHORS: Add Eric Garver.
Ben Pfaff [Tue, 4 Oct 2016 15:48:07 +0000 (08:48 -0700)]
AUTHORS: Add Eric Garver.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agonetdev-linux: double tagged packets should use 0x88a8
Eric Garver [Tue, 4 Oct 2016 14:14:46 +0000 (10:14 -0400)]
netdev-linux: double tagged packets should use 0x88a8

We need to check if a packet is double tagged. If so make sure to push
0x88a8 instead of 0x8100. Without this a simple port redirect of 802.1ad
frames means the outer tag gets translated from 0x88a8 to 0x8100 by the
userspace datapath.

This only affected kernels that don't use TP_STATUS_VLAN_TPID_VALID,
which is kernels < 3.14.

Signed-off-by: Eric Garver <e@erig.me>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-monitor tests: Allow '--detach' argument to be used on Windows
Alin Serdean [Mon, 3 Oct 2016 10:47:03 +0000 (10:47 +0000)]
ovsdb-monitor tests: Allow '--detach' argument to be used on Windows

This patch updates the ovsdb monitor tests to use it.

The --detach argument is needed to make the unixctl for the ovsdb-client,
to send commands.

Fixes hanging test:
monitor-cond-change

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-nbctl: Add LB commands.
nickcooper-zhangtonghao [Mon, 3 Oct 2016 08:57:37 +0000 (01:57 -0700)]
ovn-nbctl: Add LB commands.

This patch provides the command line to create a load balancer.
You can create a load balancer independently and add it to multiple
switches or routers. A single load balancer can have multiple vips.
Add a name column for the load balancer. With --add-duplicate,
the command really creates a new load balancer with a duplicate name.
This name has no special meaning or purpose other than to provide
convenience for human interaction with the ovn-nb database.
This patch also provides the unit tests and the documentation.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn: Avoid using bash "+=" extension in tests.
Ben Pfaff [Fri, 30 Sep 2016 17:12:04 +0000 (10:12 -0700)]
ovn: Avoid using bash "+=" extension in tests.

This fixes test failures when the tests are run under a shell like ash or
dash.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
7 years agoovn-nbctl: Remove unreachable code.
nickcooper-zhangtonghao [Mon, 3 Oct 2016 17:52:00 +0000 (10:52 -0700)]
ovn-nbctl: Remove unreachable code.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: Fix memory leak in nbctl_lrp_add.
nickcooper-zhangtonghao [Mon, 3 Oct 2016 15:19:09 +0000 (08:19 -0700)]
ovn-nbctl: Fix memory leak in nbctl_lrp_add.

Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller tests: Windows does not register "tap"
Alin Serdean [Mon, 3 Oct 2016 14:50:54 +0000 (14:50 +0000)]
ovn-controller tests: Windows does not register "tap"

On Windows we do not register "tap" as an interface type since it is not
supported.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotests/bundle: test bundle action with ports up and down
Thadeu Lima de Souza Cascardo [Fri, 30 Sep 2016 21:53:37 +0000 (18:53 -0300)]
tests/bundle: test bundle action with ports up and down

Also, add the keyword bundle_action to all the tests in bundle.at,
distinguishing it from OF bundles.

It came to my attention recently that bundle_load will load 0xFFFF in case all
the slaves are down, as bundle_execute will return OFPP_NONE.

As I noticed this was not explicitly tested, not even for the bundle action, I
thought it would be nice to do it as a way of documenting this behavior.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoChange some old references to nicira-ext.h.
Thadeu Lima de Souza Cascardo [Fri, 30 Sep 2016 18:31:03 +0000 (15:31 -0300)]
Change some old references to nicira-ext.h.

Some of these references are not valid anymore, as things were moved to
either meta-flow.h or ofp-actions.c.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: update docs for l2gateway port vlan tag
Gabe Beged-Dov [Thu, 29 Sep 2016 22:40:02 +0000 (15:40 -0700)]
ovn: update docs for l2gateway port vlan tag

update description of l2gateway logical switch ports to include optional
vlan tag. Also restore comment in ovn/controller/physical.c from original commit
by Russell Bryant (184bc3c ovn: Add software l2 gateway) on 7/1/2016.

Signed-off-by: Gabe Beged-Dov <gabe@begeddov.com>
Co-authored-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agonetdev-dpdk: Configure flow control only when necessary.
Ilya Maximets [Fri, 30 Sep 2016 07:48:45 +0000 (10:48 +0300)]
netdev-dpdk: Configure flow control only when necessary.

It is not necessary to touch the physical device each time, if the
configuration has not been changed. Also, few style issues fixed.

Thread-safety annotation added to 'dpdk_set_rxq_config()'. It was
missed while previous refactoring of the flow control configuration.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Tested-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: Allow configurable queue sizes for 'dpdk' ports
Ciara Loftus [Fri, 30 Sep 2016 13:50:53 +0000 (14:50 +0100)]
netdev-dpdk: Allow configurable queue sizes for 'dpdk' ports

The 'options:n_rxq_desc' and 'n_txq_desc' fields allow the number of rx
and tx descriptors for dpdk ports to be modified. By default the values
are set to 2048, but can be modified to an integer between 1 and 4096
that is a power of two. The values can be modified at runtime, however
require the NIC to restart when changed.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovs-ofctl: Tolerate differences in IPv6 formatting.
Ben Pfaff [Thu, 29 Sep 2016 21:41:51 +0000 (14:41 -0700)]
ovs-ofctl: Tolerate differences in IPv6 formatting.

glibc formats single zeros as 0: fec0:0:1234:f045:8fff:1111:fe4e:571
Musl formats single zeros as ::: fec0::1234:f045:8fff:1111:fe4e:571

This patch makes the OVS testsuite tolerate either one.

Reported-by: Stuart Cardall <developer@it-offshore.co.uk>
Reported-at: http://openvswitch.org/pipermail/discuss/2016-September/022803.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotests: Use Linux-specific way to get parent PID, to avoid noncompliant "ps".
Ben Pfaff [Thu, 29 Sep 2016 21:41:50 +0000 (14:41 -0700)]
tests: Use Linux-specific way to get parent PID, to avoid noncompliant "ps".

POSIX defines "ps" -o and -p options, but the "ps" implementation in
busybox (used in Alpine Linux) doesn't support -p, which makes some tests
fail for no good reason.  Therefore, this commit makes the testsuite
instead check for support for the Linux-specific /proc-based way to find
the parent of a process and prefer that over "ps" when available.

Reported-by: Stuart Cardall <developer@it-offshore.co.uk>
Reported-at: http://openvswitch.org/pipermail/discuss/2016-September/022803.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotests: Use standard -q option to grep in place of GNU --quiet extension.
Ben Pfaff [Thu, 29 Sep 2016 21:41:49 +0000 (14:41 -0700)]
tests: Use standard -q option to grep in place of GNU --quiet extension.

Reported-by: Stuart Cardall <developer@it-offshore.co.uk>
Reported-at: http://openvswitch.org/pipermail/discuss/2016-September/022803.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Fernandes <flavio@flaviof.com>
7 years agoovn: Do not reply to ARP or ND NS for a VM's own IP address.
Ben Pfaff [Fri, 30 Sep 2016 15:23:21 +0000 (08:23 -0700)]
ovn: Do not reply to ARP or ND NS for a VM's own IP address.

When a VM sends an ARP or an ND NS for its own IP address, it is trying to
check for a duplicate address in the network.  OVN needs to suppress the
reply in such a case, otherwise the VM thinks that its address is a
duplicate.

Reported-by: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-September/080037.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Darrell Ball <dlu998@gmail.com>
Tested-by: Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
7 years agoINSTALL.md: Add details about kernel module preference.
Gurucharan Shetty [Mon, 26 Sep 2016 14:09:41 +0000 (07:09 -0700)]
INSTALL.md: Add details about kernel module preference.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Darrell Ball <dlu998@gmail.com>
7 years agonetdev-dpdk: Fix coding style
Mark Kavanagh [Thu, 29 Sep 2016 10:27:03 +0000 (11:27 +0100)]
netdev-dpdk: Fix coding style

Coding style violations of the following conventions are present in netdev-dpdk.c:
    - limit lines to 79 characters
    - put a space after (but not before) the "sizeof" keyword
    - put a space between the () used in a cast and the
      expression whose type is cast: (void *) 0.

Resolve occurrences of each, and any other minor style infractions.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: consistent naming for mbuf variables
Mark Kavanagh [Thu, 29 Sep 2016 10:27:02 +0000 (11:27 +0100)]
netdev-dpdk: consistent naming for mbuf variables

Pointers to struct rte_mbuf are typically denoted within functions as
'pkt'; similarly, arrays of, and pointer-to-pointer to, struct rte_mbuf
are denoted by 'pkts'.

Update discrepancies to the above convention for consistency.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: Introduce dpdk_mp_mutex.
Ilya Maximets [Fri, 23 Sep 2016 13:17:58 +0000 (16:17 +0300)]
netdev-dpdk: Introduce dpdk_mp_mutex.

'dpdk_mutex' protects two independent things: list of dpdk devices
and list of memory pools. Let's spit it in two to avoid global blocking
inside 'netdev_dpdk.*_reconfigure()' as possible.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoCONTRIBUTING.md: Improve recommended command for Fixes: header.
Ben Pfaff [Fri, 23 Sep 2016 15:28:55 +0000 (08:28 -0700)]
CONTRIBUTING.md: Improve recommended command for Fixes: header.

It usually makes sense to CC the author of the commit being fixed.

The CC tag wasn't mentioned before, so describe it too.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoFAQ: ERSPAN is no longer undocumented.
Ben Pfaff [Thu, 15 Sep 2016 18:11:10 +0000 (11:11 -0700)]
FAQ: ERSPAN is no longer undocumented.

See https://tools.ietf.org/html/draft-foschiano-erspan-01.  Even though
that draft has expired, it's genuine documentation.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>