]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agodatapath: backport: geneve: avoid using stale geneve socket.
Pravin B Shelar [Sun, 30 Oct 2016 04:33:05 +0000 (21:33 -0700)]
datapath: backport: geneve: avoid using stale geneve socket.

Upstream commit:
    commit fceb9c3e38252992bbf1a3028cc2f7b871211533
    Author: pravin shelar <pshelar@ovn.org>
    Date:   Fri Oct 28 09:59:16 2016 -0700

    geneve: avoid using stale geneve socket.

    This patch is similar to earlier vxlan patch.
    Geneve device close operation frees geneve socket. This
    operation can race with geneve-xmit function which
    dereferences geneve socket. Following patch uses RCU
    mechanism to avoid this situation.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoFAQ: Mention conntrack capability for packet filtering.
Han Zhou [Fri, 28 Oct 2016 19:13:44 +0000 (12:13 -0700)]
FAQ: Mention conntrack capability for packet filtering.

The existing explanation didn't tell user the conntrack capability
and user may be unaware of the stateful feature of OVS.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoifnotifier: do not wake up when there is no db connection
Thadeu Lima de Souza Cascardo [Tue, 25 Oct 2016 17:44:43 +0000 (15:44 -0200)]
ifnotifier: do not wake up when there is no db connection

When bridge uses the interface notifier, it wakes up until a reconfiguration
takes place. However, if there is no connection or a lock contention to the
database, the check for reconfiguration will not take place.

This uses a seq and only seq_wait when checking for the interfaces change.

This is easily reproduced by starting ovs-vswitchd without starting
ovsdb-server, and then creating a new system interface, like using
'ip link add type veth'. ovs-vswitchd will then consume 100% CPU.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Set isActivated flag only on success
Shashank Ram [Mon, 10 Oct 2016 22:15:05 +0000 (15:15 -0700)]
datapath-windows: Set isActivated flag only on success

@Switch.c: Modifies OvsActivateSwitch() function
to mark the switch as activated only if the
the status is success. The callers itself
only call this method when the isActivated
flag is unset.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoFAQ.rst: Trivial link fixes.
Russell Bryant [Sat, 29 Oct 2016 20:13:49 +0000 (22:13 +0200)]
FAQ.rst: Trivial link fixes.

Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agotrivial: Resolve whitespace issues with acinclude
Stephen Finucane [Tue, 18 Oct 2016 20:03:45 +0000 (21:03 +0100)]
trivial: Resolve whitespace issues with acinclude

Completely unrelated, but annoying. Let's fix it up.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert FAQ to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:44 +0000 (21:03 +0100)]
doc: Convert FAQ to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert OPENFLOW-1.1+ to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:42 +0000 (21:03 +0100)]
doc: Convert OPENFLOW-1.1+ to rST

Rename it to OPENFLOW.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert CONTRIBUTING to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:41 +0000 (21:03 +0100)]
doc: Convert CONTRIBUTING to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert README-native-tunneling to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:40 +0000 (21:03 +0100)]
doc: Convert README-native-tunneling to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert README-lisp to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:39 +0000 (21:03 +0100)]
doc: Convert README-lisp to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert SECURITY to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:38 +0000 (21:03 +0100)]
doc: Convert SECURITY to rST

This is a top-level document, so plain old rST is preferred.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agodoc: Convert WHY-OVS to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:37 +0000 (21:03 +0100)]
doc: Convert WHY-OVS to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
7 years agoovn/TODO: Remove completed IPAM item.
Russell Bryant [Tue, 25 Oct 2016 14:10:42 +0000 (10:10 -0400)]
ovn/TODO: Remove completed IPAM item.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
8 years agodoc: Convert REPORTING-BUGS to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:36 +0000 (21:03 +0100)]
doc: Convert REPORTING-BUGS to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodoc: v2: fix bad link to dpdk advance installation guide
Mauricio Vasquez [Fri, 21 Oct 2016 04:51:24 +0000 (23:51 -0500)]
doc: v2: fix bad link to dpdk advance installation guide

Previous fix was also wrong.

Fixes: 167703d ("doc: Convert INSTALL.DPDK to rST")
Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Acked-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodoc: Convert README to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:35 +0000 (21:03 +0100)]
doc: Convert README to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodoc: Convert PORTING to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:34 +0000 (21:03 +0100)]
doc: Convert PORTING to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoconfigure: Support compiling with Linux 4.8.
Jarno Rajahalme [Thu, 20 Oct 2016 22:22:14 +0000 (15:22 -0700)]
configure: Support compiling with Linux 4.8.

Datapath should now compile and work with Linux 4.8.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agodatapath: Support a fixed size of 128 distinct labels.
Jarno Rajahalme [Thu, 20 Oct 2016 22:22:14 +0000 (15:22 -0700)]
datapath: Support a fixed size of 128 distinct labels.

Port upstream change in conntrack labels extension.  Add a new
configure macro HAVE_NF_CONN_LABELS_WITH_WORDS to detect the old
definition.  Unfortunately there is no conntrack API to hide the
difference, so the this makes conntrack.c deviate from upstream source
a bit.

Upstream commit:
    commit 23014011ba4209a086931ff402eac1c41abbe456
    Author: Florian Westphal <fw@strlen.de>
    Date:   Thu Jul 21 12:51:16 2016 +0200

    netfilter: conntrack: support a fixed size of 128 distinct labels

    The conntrack label extension is currently variable-sized, e.g. if
    only 2 labels are used by iptables rules then the labels->bits[] array
    will only contain one element.

    We track size of each label storage area in the 'words' member.

    But in nftables and openvswitch we always have to ask for worst-case
    since we don't know what bit will be used at configuration time.

    As most arches are 64bit we need to allocate 24 bytes in this case:

    struct nf_conn_labels {
        u8            words;   /*     0     1 */
        /* XXX 7 bytes hole, try to pack */
        long unsigned bits[2]; /*     8     24 */

    Make bits a fixed size and drop the words member, it simplifies
    the code and only increases memory requirements on x86 when
    less than 64bit labels are required.

    We still only allocate the extension if its needed.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
8 years agoovn-test: Fix 'test-ovn composition' crash
Andy Zhou [Tue, 11 Oct 2016 18:26:13 +0000 (11:26 -0700)]
ovn-test: Fix 'test-ovn composition' crash

Without this fix, the added test will core dump.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodoc: Convert MAINTAINERS to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:33 +0000 (21:03 +0100)]
doc: Convert MAINTAINERS to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodoc: Convert IntegrationGuide to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:32 +0000 (21:03 +0100)]
doc: Convert IntegrationGuide to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodoc: Convert CodingStyle to rST
Stephen Finucane [Tue, 18 Oct 2016 20:03:31 +0000 (21:03 +0100)]
doc: Convert CodingStyle to rST

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agofedora: do not restart the service on a pkg upgrade
Flavio Leitner [Tue, 18 Oct 2016 17:04:42 +0000 (15:04 -0200)]
fedora: do not restart the service on a pkg upgrade

There is no reliable way to restore the previous networking
state after a service restart. Many things like firewall
configuration, traffic shaping, stacked devices, custom setups
are completely out of OVS control.

The OVS might be providing the network used for remote
administration, so do not automatically restart the service
during a package upgrade.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoDocumentationStyle: Clarify what documentation is
Stephen Finucane [Thu, 20 Oct 2016 07:19:24 +0000 (08:19 +0100)]
DocumentationStyle: Clarify what documentation is

We're going to convert all docs to reStructuredText, so the "legacy
documents" warning is going to become outdated rather quickly. Simply
remove it.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodpif-netdev: Fix windows build.
Daniele Di Proietto [Wed, 19 Oct 2016 18:31:33 +0000 (11:31 -0700)]
dpif-netdev: Fix windows build.

OVS_ALIGNED_VAR(...) should be at the beginning of a definition, as
the example in include/openvswitch/compiler.h shows.

Fixes: 38ee0814978c ("dpif-netdev: Cache align netdev_flow_keys.")
Reported-by: Joe Stringer <joe@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
8 years agoovsdb-idl: Check internal graph in OVSDB tests.
Ben Pfaff [Wed, 7 Sep 2016 16:04:46 +0000 (09:04 -0700)]
ovsdb-idl: Check internal graph in OVSDB tests.

Some upcoming tests will add extra trickiness to the IDL internal graph.
This worries me, because the IDL doesn't have any checks for its graph
consistency.  This commit adds some.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idl: Mark ovsdb_idl_get_row_arc() parameter const.
Ben Pfaff [Thu, 25 Aug 2016 06:10:15 +0000 (23:10 -0700)]
ovsdb-idl: Mark ovsdb_idl_get_row_arc() parameter const.

This function doesn't modify its 'dst_table' parameter, so it might as well
be marked const.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idl: Add some more implementation comments.
Ben Pfaff [Mon, 29 Aug 2016 06:21:40 +0000 (23:21 -0700)]
ovsdb-idl: Add some more implementation comments.

I wrote this code and if I have to rediscover how it works, it's time to
improve the commnts.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Remove special case for "sizeof bool".
Ben Pfaff [Tue, 30 Aug 2016 23:58:44 +0000 (16:58 -0700)]
ovsdb-idlc: Remove special case for "sizeof bool".

The "sparse" checker used to warn about sizeof(bool).  These days, it does
not warn (without -Wsizeof-bool), so remove this ugly special case.

If you have a version of "sparse" that still warns by default, please
upgrade to a version that includes commit 2667c2d4ab33 (sparse: Allow
override of sizeof(bool) warning).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idl: Sort and unique-ify datum in ovsdb_idl_txn_write().
Ben Pfaff [Wed, 31 Aug 2016 18:42:53 +0000 (11:42 -0700)]
ovsdb-idl: Sort and unique-ify datum in ovsdb_idl_txn_write().

I noticed that there were lots of calls to ovsdb_datum_sort_unique() from
"set" functions in generated IDL code.  This moves that call into common
code, reducing redundancy.

There are more calls to the same function that are a little harder to
remove.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idl: Improve comment on ovsdb_idl_txn_write[_clone]().
Ben Pfaff [Wed, 31 Aug 2016 18:34:53 +0000 (11:34 -0700)]
ovsdb-idl: Improve comment on ovsdb_idl_txn_write[_clone]().

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Eliminate <prefix>_init() function from generated code.
Ben Pfaff [Wed, 24 Aug 2016 21:53:52 +0000 (14:53 -0700)]
ovsdb-idlc: Eliminate <prefix>_init() function from generated code.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Consolidate assertions.
Ben Pfaff [Wed, 24 Aug 2016 22:33:31 +0000 (15:33 -0700)]
ovsdb-idlc: Consolidate assertions.

There were lots of bits of code emitting "assert(inited);".  This combines
many of them.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Declare loop variables in for statements in generated code.
Ben Pfaff [Wed, 24 Aug 2016 19:38:39 +0000 (12:38 -0700)]
ovsdb-idlc: Declare loop variables in for statements in generated code.

This changes several instances of
    size_t i;
    for (i = 0; i < ...; i++)
into:
    for (size_t i = 0; i < ...; i++)
in generated code, making it slightly more compact and easier to read.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Make generated references to columns easier to read.
Ben Pfaff [Wed, 24 Aug 2016 19:32:59 +0000 (12:32 -0700)]
ovsdb-idlc: Make generated references to columns easier to read.

This replaces ovsrec_open_vswitch_columns[OVSREC_OPEN_VSWITCH_COL_CUR_CFG]
by the easier to read and equivalent ovsrec_open_vswitch_col_cur_cfg in
generated code.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Make generated references to table classes easier to read.
Ben Pfaff [Wed, 24 Aug 2016 19:00:21 +0000 (12:00 -0700)]
ovsdb-idlc: Make generated references to table classes easier to read.

This replaces &ovsrec_table_classes[OVSREC_TABLE_OPEN_VSWITCH] by the
easier to read and equivalent &ovsrec_table_open_vswitch in generated code.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Simplify code generation to parse sets and maps of references.
Ben Pfaff [Wed, 24 Aug 2016 18:47:56 +0000 (11:47 -0700)]
ovsdb-idlc: Simplify code generation to parse sets and maps of references.

This switches from code that looks like:
    if (keyRow) {
        ...
    }
to:
    if (!keyRow) {
        continue;
    }
    ...
which is a little easier to generate because the indentation of ... is
constant.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Factor out sorting columns.
Ben Pfaff [Wed, 24 Aug 2016 22:07:03 +0000 (15:07 -0700)]
ovsdb-idlc: Factor out sorting columns.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Remove obsolete documentation and usage.
Ben Pfaff [Thu, 25 Aug 2016 02:24:25 +0000 (19:24 -0700)]
ovsdb-idlc: Remove obsolete documentation and usage.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovsdb-idlc: Use ovsdb_datum_from_smap() instead of open-coding it.
Ben Pfaff [Thu, 1 Sep 2016 05:03:27 +0000 (22:03 -0700)]
ovsdb-idlc: Use ovsdb_datum_from_smap() instead of open-coding it.

There's no reason to have three copies of this code for every smap-type
column.

The code wasn't a perfect match for ovsdb_datum_from_smap(), so this commit
also changes ovsdb_datum_from_smap() to better suit it.  It only had one
caller and the new design is adequate for that caller.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoovn: fix build on FreeBSD
Thadeu Lima de Souza Cascardo [Wed, 19 Oct 2016 15:32:57 +0000 (13:32 -0200)]
ovn: fix build on FreeBSD

The missing include was needed for struct in6_addr.

Otherwise, this build failure would occur.

In file included from ovn/lib/actions.c:23:
ovn/lib/ovn-dhcp.h:163:21: error: field has incomplete type 'struct in6_addr'

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodoc: fix bad link to dpdk advance installation guide
Mauricio Vasquez [Tue, 18 Oct 2016 22:23:12 +0000 (17:23 -0500)]
doc: fix bad link to dpdk advance installation guide

The link was pointing to a wrong place after the file was converted to rst.

Fixes: 167703d664fc ("doc: Convert INSTALL.DPDK to rST")
Signed-off-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Acked-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoMakefile.am: Add DocumentationStyle.rst to distribution.
Jarno Rajahalme [Tue, 18 Oct 2016 23:59:56 +0000 (16:59 -0700)]
Makefile.am: Add DocumentationStyle.rst to distribution.

Compile fails otherwise.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoovn-controller.at: Stop hardcoding a list of iface types
YAMAMOTO Takashi [Tue, 18 Oct 2016 11:31:55 +0000 (11:31 +0000)]
ovn-controller.at: Stop hardcoding a list of iface types

The list of supported iface types hardcoded in the test
is wrong on NetBSD. (or any userland-only ports I guess)
Instead of adding another case for NetBSD following WIN32,
just get the list from ovsdb.

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn.at: Avoid using "printf -v"
YAMAMOTO Takashi [Tue, 18 Oct 2016 11:15:56 +0000 (11:15 +0000)]
ovn.at: Avoid using "printf -v"

It seems like a non-portable bash extension.

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoFix parent_pid on NetBSD
YAMAMOTO Takashi [Thu, 13 Oct 2016 07:42:27 +0000 (16:42 +0900)]
Fix parent_pid on NetBSD

Fix recently introduced parent_pid macro on NetBSD 7.0.
On NetBSD, procfs status file looks like the following.

    n7% cat /proc/$$/status
    zsh 18509 12970 18509 18509 5,8 ctty,sldr 1476344459,639266 0,15575 0,15575 pause 1000 100,100,0
    n7%

Signed-off-by: YAMAMOTO Takashi <yamamoto@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodocs: Add writing guide
Stephen Finucane [Sat, 8 Oct 2016 13:18:01 +0000 (14:18 +0100)]
docs: Add writing guide

Help documentation authors avoid common pitfalls.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodocs: Add documentation style guide
Stephen Finucane [Sat, 8 Oct 2016 13:18:00 +0000 (14:18 +0100)]
docs: Add documentation style guide

We have one for coding and could do with one for docs.

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

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

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

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>