cascardo/ovs.git
8 years agoAUTHORS: Add Ben Warren.
Ben Pfaff [Wed, 30 Mar 2016 20:29:15 +0000 (13:29 -0700)]
AUTHORS: Add Ben Warren.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotun-metadata: Break header file into public and private parts.
Ben Warren [Fri, 25 Mar 2016 21:10:26 +0000 (14:10 -0700)]
tun-metadata: Break header file into public and private parts.

Public (struct definitions and some prototypes) go in
include/openvswitch.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoutil: Move build assertion macros to compiler.h.
Ben Warren [Fri, 25 Mar 2016 21:10:25 +0000 (14:10 -0700)]
util: Move build assertion macros to compiler.h.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoMove lib/ofpbuf.h to include/openvswitch directory
Ben Warren [Fri, 25 Mar 2016 21:10:24 +0000 (14:10 -0700)]
Move lib/ofpbuf.h to include/openvswitch directory

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoMove ofp-parse.h to include/openvswitch directory
Ben Warren [Fri, 25 Mar 2016 21:10:23 +0000 (14:10 -0700)]
Move ofp-parse.h to include/openvswitch directory

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agolist: Rename all functions in list.h with ovs_ prefix.
Ben Warren [Fri, 25 Mar 2016 21:10:22 +0000 (14:10 -0700)]
list: Rename all functions in list.h with ovs_ prefix.

This attempts to prevent namespace collisions with other list libraries

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agolist: Remove lib/list.h completely.
Ben Warren [Fri, 25 Mar 2016 21:10:21 +0000 (14:10 -0700)]
list: Remove lib/list.h completely.

All code is now in include/openvswitch/list.h.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agolist: Move contents of lib/list.h to include/openvswitch directory.
Ben Warren [Fri, 25 Mar 2016 21:10:20 +0000 (14:10 -0700)]
list: Move contents of lib/list.h to include/openvswitch directory.

Most of the list code is properly namespaced, so is OK to move to the
global export directory.  Some "lib/util.h" code had to move to the
other directory as well, but I've tried to make that as small as
possible

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoINSTALL.md: Explain the effect of using different configure options.
Gurucharan Shetty [Wed, 30 Mar 2016 15:01:57 +0000 (08:01 -0700)]
INSTALL.md: Explain the effect of using different configure options.

Over the years, I have seen multiple users inadvertantly end up with 2 copies
of OVS executables in their filesystem. In all the cases, it was because of
using different configure options while installing a new version of
Open vSwitch.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-actions: Fix use-after-free with ofpact_finish().
Joe Stringer [Mon, 7 Mar 2016 23:36:37 +0000 (15:36 -0800)]
ofp-actions: Fix use-after-free with ofpact_finish().

ofpact_finish() may now reallocate the buffer it is passed, but not all
callers updated their local pointers to the current action in the
buffer. This could potentially lead to several use-after-free bugs.

Update ofpact_finish() to return the new pointer to the ofpact which is
provided, and update the calling points to ensure that their local
pointers are pointing into the correct (potentially reallocated) buffer.

Fixes: 2bd318dec242 ("ofp-actions: Make composing actions harder to screw up.")
Reported-by: William Tu <u9012063@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agonx-match: Fix use-after-free parsing matches.
Joe Stringer [Mon, 7 Mar 2016 19:31:02 +0000 (11:31 -0800)]
nx-match: Fix use-after-free parsing matches.

Address pointed by header_ptr might be free'd due to realloc
happened in ofpbuf_put_hex(). Reported by valgrind in the test
379: check TCP flags expression in OXM and NXM.

Invalid write of size 4
    nx_match_from_string_raw (nx-match.c:1510)
    nx_match_from_string (nx-match.c:1538)
    ofctl_parse_nxm__ (ovs-ofctl.c:3325)
    ovs_cmdl_run_command (command-line.c:121)
    main (ovs-ofctl.c:137)

Address 0x7a2cc40 is 0 bytes inside a block of size 64 free'd
    free (vg_replace_malloc.c:530)
    ofpbuf_resize__ (ofpbuf.c:246)
    ofpbuf_put (ofpbuf.c:386)
    ofpbuf_put_hex (ofpbuf.c:414)
    nx_match_from_string_raw (nx-match.c:1488)
    nx_match_from_string (nx-match.c:1538)
    ofctl_parse_nxm__ (ovs-ofctl.c:3325)

Reported-by: William Tu <u9012063@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-dpdk: vhost: Fix txq enabling in the absence of notifications.
Ilya Maximets [Tue, 29 Mar 2016 06:20:41 +0000 (09:20 +0300)]
netdev-dpdk: vhost: Fix txq enabling in the absence of notifications.

According to QEMU documentation (docs/specs/vhost-user.txt) one queue
should be enabled initially. More queues are enabled dynamically, by
sending message VHOST_USER_SET_VRING_ENABLE.

Currently all queues in OVS disabled by default. This breaks above
specification. So, queue #0 should be enabled by default to support
QEMU versions less than 2.5 and fix probable issues if QEMU will not
send VHOST_USER_SET_VRING_ENABLE for queue #0 according to documentation.
Also this will fix currently broken vhost-cuse support in OVS.

Fixes: 585a5beaa2a4 ("netdev-dpdk: vhost-user: Fix sending packets to
                      queues not enabled by guest.")
Reported-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agotests/automake.mk: Prohibition of parallel system-traffic test execution.
Ilya Maximets [Fri, 4 Mar 2016 05:31:58 +0000 (08:31 +0300)]
tests/automake.mk: Prohibition of parallel system-traffic test execution.

'make check-system-userspace', 'make check-kernel' and 'make check-kmod'
work with real environment and can not be run in parallel mode.

To prevent violation of the system environment force '-j1' option for
this targets.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
8 years agocheck-system-userspace: Waiting for port's availability before creation.
Ilya Maximets [Fri, 4 Mar 2016 05:31:57 +0000 (08:31 +0300)]
check-system-userspace: Waiting for port's availability before creation.

Fixes failure of test due to not yet fully destroyed ports from
previous test if ovs-vswitchd was killed.

Example:

netdev_linux|WARN|br0: creating tap device failed: Device or resource busy
bridge|WARN|could not open network device br0 (Device or resource busy)

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
8 years agosystem-traffic.at: Skip tests if namespaces or veths aren't supported.
Ilya Maximets [Fri, 4 Mar 2016 05:31:56 +0000 (08:31 +0300)]
system-traffic.at: Skip tests if namespaces or veths aren't supported.

This prevents failure of test scenarios 'make check-kernel'
and 'make check-system-userspace' if creation of veth pairs or
network namespaces is not supported by kernel (or module isn't loaded).

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
8 years agoovn: Fix a typo in ovn-northd documentation.
Bruce Davie [Tue, 29 Mar 2016 20:12:43 +0000 (13:12 -0700)]
ovn: Fix a typo in ovn-northd documentation.

Signed-off-by: Bruce Davie <bdavie@vmware.com>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
8 years agoSECURITY.md: Add advisory document details.
Ben Pfaff [Tue, 29 Mar 2016 19:32:45 +0000 (12:32 -0700)]
SECURITY.md: Add advisory document details.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoovn: Add ovn-bridge-mappings to Chassis external_ids.
Russell Bryant [Mon, 28 Mar 2016 19:10:21 +0000 (15:10 -0400)]
ovn: Add ovn-bridge-mappings to Chassis external_ids.

Publish ovn-controller's local bridge mappings configuration
in the external_ids column of the Chassis table.  Having this
information available for reading is useful to applications
integrating with OVN.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodebian: Ship ovn-[ns]b man pages in ovn-common.
Russell Bryant [Fri, 25 Mar 2016 00:03:01 +0000 (20:03 -0400)]
debian: Ship ovn-[ns]b man pages in ovn-common.

Move ovn-nb and ovn-sb man pages to ovn-common so that the man pages for
these DB schemas are always available with the corresponding command
line utilities, ovn-nbctl and ovn-sbctl.

Signed-off-by: Russell Bryant <russell@ovn.org>
Tested-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Gurucharan Shetty <guru@ovn.org>
8 years agoCONTRIBUTING.md: Describe a new "Vulnerability" tag.
Ben Pfaff [Tue, 29 Mar 2016 02:34:58 +0000 (19:34 -0700)]
CONTRIBUTING.md: Describe a new "Vulnerability" tag.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agoAUTHORS: Add Bhargava Shastry and Kashyap Thimmaraju.
Ben Pfaff [Tue, 29 Mar 2016 02:40:53 +0000 (19:40 -0700)]
AUTHORS: Add Bhargava Shastry and Kashyap Thimmaraju.

Bhargava and Kashyap reported vulnerability CVE-2016-2074, which was
present only on the branches for 2.3 and 2.4 and thus did not require any
commits on master.  They still deserve credit as bug reporters, so this
commit provides that.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agoovn: Add external_ids to Chassis table.
Russell Bryant [Mon, 28 Mar 2016 18:54:01 +0000 (14:54 -0400)]
ovn: Add external_ids to Chassis table.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosmap: Include hash.h.
Russell Bryant [Mon, 28 Mar 2016 19:04:58 +0000 (15:04 -0400)]
smap: Include hash.h.

SMAP_CONST1 uses the hash_string() function from hash.h.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb: Remove unused "struct ovsdb_log_read_cbdata".
Ben Pfaff [Mon, 28 Mar 2016 04:49:01 +0000 (21:49 -0700)]
ovsdb: Remove unused "struct ovsdb_log_read_cbdata".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agoovs-thread: Do not always end quiescent state in ovs_thread_create().
Daniele Di Proietto [Wed, 23 Mar 2016 23:37:47 +0000 (16:37 -0700)]
ovs-thread: Do not always end quiescent state in ovs_thread_create().

A new thread must be started in a non quiescent state.  There is a call
to ovsrcu_quiesce_end() in ovsthread_wrapper(), to enforce this.

ovs_thread_create(), instead, is executed in the parent thread. It must
call ovsrcu_quiesce_end() on its first invocation, to put the main
thread in a non quiescent state.  On every other invocation, it doesn't
make sense to alter the calling thread state, so this commits wraps the
call to ovsrcu_quiesce_end() in an ovsthread_once construct.

This fixes a bug in ovs-rcu where the first call in the process to
ovsrcu_quiesce_start() will not be honored, because the calling thread
will need to create the 'urcu' thread (and creating a thread will
wrongly end its quiescent state).

ovsrcu_quiesce_start()
  ovs_rcu_quiesced()
    if (ovsthread_once_start(&once)) {
        ovs_thread_create("urcu") /*This will end the quiescent state*/
    }

This bug affects in particular ovs-vswitchd with DPDK.
In the DPDK case the first threads created are "vhost_thread" and
"dpdk_watchdog".  If dpdk_watchdog is the first to call
ovsrcu_quiesce_start() (via xsleep()), the call is not honored and
the RCU grace period lasts at least for DPDK_PORT_WATCHDOG_INTERVAL
(5s on current master).  If vhost_thread, on the other hand, is the
first to call ovsrcu_quiesce_start(), the call is not honored and the
RCU grace period lasts undefinitely, because no more calls to
ovsrcu_quiesce_start() are issued from vhost_thread.

For some reason (it's a race condition after all), on current master,
dpdk_watchdog will always be the first to call ovsrcu_quiesce_start(),
but with the upcoming DPDK database configuration changes, sometimes
vhost_thread will issue the first call to ovsrcu_quiesce_start().

Sample ovs-vswitchd.log:

2016-03-23T22:34:28.532Z|00004|ovs_rcu(urcu3)|WARN|blocked 8000 ms
waiting for vhost_thread2 to quiesce
2016-03-23T22:34:30.501Z|00118|ovs_rcu|WARN|blocked 8000 ms waiting for
vhost_thread2 to quiesce
2016-03-23T22:34:36.532Z|00005|ovs_rcu(urcu3)|WARN|blocked 16000 ms
waiting for vhost_thread2 to quiesce
2016-03-23T22:34:38.501Z|00119|ovs_rcu|WARN|blocked 16000 ms waiting for
vhost_thread2 to quiesce

The commit also adds a test for the ovs-rcu module to make sure that:
* A new thread is started in a non quiescent state.
* The first call to ovsrcu_quiesce_start() is honored.
* When a process becomes multithreaded the main thread is put in an
  active state

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Fix alignment in Flow.c.
Nithin Raju [Fri, 25 Mar 2016 17:16:08 +0000 (10:16 -0700)]
datapath-windows: Fix alignment in Flow.c.

Cosmetic changes.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Revert unrelated change to ovs-atomic.h
Sorin Vinturis [Fri, 25 Mar 2016 15:56:01 +0000 (15:56 +0000)]
datapath-windows: Revert unrelated change to ovs-atomic.h

There was an unwanted change to ovs-atomic.h header made by the
recirculation patch, ee25964a60c6b2c6e60a4c5fbfc9e90cf304f970 commit.
This patch reverts that change.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-ctl: Allow selective start for db and switch
Aaron Conole [Thu, 24 Mar 2016 17:42:29 +0000 (13:42 -0400)]
ovs-ctl: Allow selective start for db and switch

Currently, ``ovs-ctl start'' will attempt to start both the DB and
vswitchd. This is quite convenient when the database already has all of
the configuration values required, and when using a single services file
for systemd integration. The same goes for the ``ovs-ctl stop'' command.

However, there are some cases which are not easily covered. The case
where we want to set values in the database prior to starting the
forwarding path, as well as the case of supporting multiple service
files, one per daemon (which is how systemd expects services to look).

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Updated FAQ regarding Hyper-V recirculation.
Sorin Vinturis [Fri, 25 Mar 2016 14:49:27 +0000 (14:49 +0000)]
datapath-windows: Updated FAQ regarding Hyper-V recirculation.

Updated FAQ document to reflect recirculation support for Hyper-V.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Extract flow metadata in execute cmd handler.
Sorin Vinturis [Fri, 25 Mar 2016 14:49:27 +0000 (14:49 +0000)]
datapath-windows: Extract flow metadata in execute cmd handler.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Support for OVS_ACTION_ATTR_HASH attribute
Sorin Vinturis [Fri, 25 Mar 2016 14:49:27 +0000 (14:49 +0000)]
datapath-windows: Support for OVS_ACTION_ATTR_HASH attribute

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Allow recirculation feature probe.
Sorin Vinturis [Fri, 25 Mar 2016 14:49:27 +0000 (14:49 +0000)]
datapath-windows: Allow recirculation feature probe.

Recirculation feature probe messages sent from userspace are
suppressed by the OVS extension.

This patch changes the current behaviour to allow feature probe
for recirculation.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Added recirculation support.
Sorin Vinturis [Fri, 25 Mar 2016 14:49:27 +0000 (14:49 +0000)]
datapath-windows: Added recirculation support.

Recirculation support for the OVS extension.

Tested using PING and iperf with Driver Verifier enabled.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/104
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodatapath-windows: Percpu allocation support function
Sorin Vinturis [Fri, 25 Mar 2016 14:49:26 +0000 (14:49 +0000)]
datapath-windows: Percpu allocation support function

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Co-authored-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Get hostname from ovs external-ids.
Russell Bryant [Fri, 25 Mar 2016 00:38:07 +0000 (00:38 +0000)]
ovn: Get hostname from ovs external-ids.

A previous commit updated ovs-ctl to store the system's hostname as an
external-id in the Open_vSwitch table by default.  Make ovn-controller
read this by default and fall back to gethostname() only if needed.

Suggested-by: Justin Pettit <jpettit@ovn.org>
Suggested-at: http://openvswitch.org/pipermail/dev/2016-March/068225.html
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoovs-ctl: Store hostname as an external-id.
Russell Bryant [Fri, 25 Mar 2016 00:31:22 +0000 (00:31 +0000)]
ovs-ctl: Store hostname as an external-id.

Update ovs-ctl to store the system hostname as an external-id, similar
to the system-id.  This is largely for convenience.  ovn-controller
will make use of it in a future commit.  Someone in the OpenDaylight
community requested the same thing in a discussion earlier this week.

While we're at it, set external-ids:hostname in ovs-sandbox as well.

Suggested-by: Justin Pettit <jpettit@ovn.org>
Suggested-at: http://openvswitch.org/pipermail/dev/2016-March/068225.html
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agorhel: Packaging for OVN is split as per functionality
bschanmu@redhat.com [Thu, 24 Mar 2016 06:07:29 +0000 (11:37 +0530)]
rhel: Packaging for OVN is split as per functionality

rhel packaging for OVN is split to host(controller), central(northd),
common(command line utilities) and docker(docker network plugin). This is
similar to OVN packaging for Debian.

Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
[russell@ovn.org Updated INSTALL.Fedora.md]
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoovn: Fix some split db issues in ovn-ctl.
Russell Bryant [Thu, 24 Mar 2016 21:40:41 +0000 (17:40 -0400)]
ovn: Fix some split db issues in ovn-ctl.

The default location for databases should be $dbdir, not $rundir.

The default location for log files comes from $logdir, not $OVS_LOGDIR.

Fix ovs-appctl commands.  The code assumed that passing
--unixctl=ovnnb_db was sufficient to allow an argument of "-t ovnnb_db"
to ovs-appctl.  Unfortunately, that's not the case.  This literally
results in a unix socket called "ovnnb_db" and ovs-appctl will look for
one in the form "onnb_db.PID.ctl".  For now, add ".ctl" to the name and
pass it by full path to ovs-appctl.  In the future, it would be even
better to have an option similar to --unixctl that specifies a prefix
for ".PID.ctl", as I believe that would give the behavior we want.

Reported-by: Gurucharan Shetty <guru@ovn.org>
Reported-at: http://openvswitch.org/pipermail/dev/2016-March/068498.html
Fixes: 60bdd01148e4 ("Separating OVN NB and SB database processes")
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
8 years agotests: Run Python 3 tests with Python 3.
Russell Bryant [Thu, 24 Mar 2016 19:11:46 +0000 (15:11 -0400)]
tests: Run Python 3 tests with Python 3.

I noticed one spot where there intention was to run some tests with
Python 3, but a typo was making it still run with Python 2.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotunnel-tests: Fix travis build failure.
Pravin B Shelar [Thu, 24 Mar 2016 18:04:57 +0000 (11:04 -0700)]
tunnel-tests: Fix travis build failure.

Travis does not allow tcpdump utility which causes the neighbour
discovery and ARP verification tests failures. Following patch
fixes the issue by using ovs-pcap utility instead of tcpdump.

Suggested-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosflow: use ovs route API to get source IP address.
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
sflow: use ovs route API to get source IP address.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev: remove netdev_get_in4()
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
netdev: remove netdev_get_in4()

Since netdev can have multiple IP address use
generic api netdev_get_addr_list().  This also make it
easier to handle IPv4 and IPv6 address across vswitchd
layers.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotunneling: Enable IPv6 tuneling.
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
tunneling: Enable IPv6 tuneling.

There is check to disable IPv6 tunneling. Following patch
removes it and reintroduces the tunneling automake tests.

This reverts mostly commit 250bd94d1e500a89c76cac944e660bd9c07ac364.
There are couple of new autotests and updated documentation
related to ipv6 tunneling added in this patch.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-dummy: change netdev seq on ip address change.
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
netdev-dummy: change netdev seq on ip address change.

tnl-port monitors netdev change using netdev sequence number.
So to propagate ip address change we need to change netdev seq-no.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotnl-neigh-cache: tighten arp and nd snooping.
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
tnl-neigh-cache: tighten arp and nd snooping.

Currently arp and nd snooping is pretty loose. That causes
unnecessary entries in neighbour cache. Following patch
adds required checks.
Thanks Cascardo for detailed comment msg.

CC: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
8 years agotunneling: Handle multiple ip address for given device.
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
tunneling: Handle multiple ip address for given device.

Device can have multiple IP address but netdev_get_in4/6()
returns only one configured IPv6 address. Following
patch fixes it.
OVS router is also updated to return source ip address for
given destination, This is required when interface has multiple
IP address configured.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agolib: Fix compose nd
Pravin B Shelar [Thu, 24 Mar 2016 16:30:57 +0000 (09:30 -0700)]
lib: Fix compose nd

Following patch fixes number of issues with compose nd, like
setting ip packet header, set ICMP opt-len, checksum.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoEnsure that dumped OF flows in ovn tests include counters
RYAN D. MOATS [Wed, 23 Mar 2016 15:22:41 +0000 (10:22 -0500)]
Ensure that dumped OF flows in ovn tests include counters

Signed-off-by: RYAN D. MOATS <rmoats@us.ibm.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoSeparating OVN NB and SB database processes
RYAN D. MOATS [Mon, 21 Mar 2016 20:40:01 +0000 (15:40 -0500)]
Separating OVN NB and SB database processes

OVN NB & SB DB's should be run in separate ovsdb-server processes
and should run with ovn-ctl start_northd / stop_northd.  This patch
includes changes to unit tests, tutorial and debian scripts to remain
self-consistent.

Signed-off-by: RYAN D. MOATS <rmoats@us.ibm.com>
Signed-off-by: Michael Arnaldi <arnaldimichael@gmail.com>
Co-authored-by: Michael Arnaldi <arnaldimichael@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agobuild windows: Update OpenSSL download link
Alin Serdean [Wed, 23 Mar 2016 20:42:19 +0000 (20:42 +0000)]
build windows: Update OpenSSL download link

This patch updates the appveyor dowload link for OpenSSL prebuilt binaries.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotravis: support OS X builds
Lance Richardson [Wed, 23 Mar 2016 20:04:47 +0000 (16:04 -0400)]
travis: support OS X builds

Add support for travis-ci OS X builds:
  - Add linux- prefix to existing build/prepare scripts
  - Create new OS X flavored build/prepare scripts
  - Update .travis.yml for OS X

At this time only one build job included in the matrix for OS X.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoosx: Fix OS X build issues
Lance Richardson [Wed, 23 Mar 2016 20:04:46 +0000 (16:04 -0400)]
osx: Fix OS X build issues

Newer versions of OS X define ntohll() and htonll() macros,
while older versions (including the version used for travis-ci
builds) do not.  Adjust conditional compilation test to work
for both cases.

Eliminate an unused variable warning in lib/rtbsd.c.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Fix windows build.
Russell Bryant [Wed, 23 Mar 2016 20:02:34 +0000 (16:02 -0400)]
ovn: Fix windows build.

AppVeyor reports that the windows build fails because HOST_NAME_MAX is
not defined.

Fixes: 2229f3ecc136 ("ovn: Add hostname to Chassis.")
Reported-at: https://ci.appveyor.com/project/blp/ovs/build/1.0.1472
Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Document chassis->name for ovn-controller-vtep.
Russell Bryant [Wed, 23 Mar 2016 19:56:32 +0000 (15:56 -0400)]
ovn: Document chassis->name for ovn-controller-vtep.

ovn-controller-vtep populates the Chassis name field with the name
column from the Physical_Switch table in the hardware_vtep database.
Add this to the documentation of the OVN_Southbound schema.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-By: Kyle Mestery <mestery@mestery.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agolib/util.c: Optimise bitwise_rscan.
Han Zhou [Sun, 20 Mar 2016 07:08:48 +0000 (00:08 -0700)]
lib/util.c: Optimise bitwise_rscan.

bitwise_rscan() is found to be hot spot in ovn-controller during OVN
scalability tests. It is triggered by lflow_run() when processing
lflow updates from SB ovsdb. The perf result shows:

+  35.90%  ovn-controller  ovn-controller      [.] bitwise_rscan
+  13.39%  ovn-controller  [kernel.kallsyms]   [k] 0xffffffff8104f45a
+   5.02%  ovn-controller  libc-2.19.so        [.] _int_malloc
+   3.47%  ovn-controller  libc-2.19.so        [.] _int_free

After optimization, bitwise_rscan percentage dropped from 36% to less
than 6%:

+  11.34%  ovn-controller  [kernel.kallsyms]   [k] 0xffffffff8104f45a
+   8.15%  ovn-controller  libc-2.19.so        [.] _int_malloc
+   5.77%  ovn-controller  ovn-controller      [.] bitwise_rscan
+   5.49%  ovn-controller  libc-2.19.so        [.] _int_free

Signed-off-by: Han Zhou <zhouhan@gmail.com>
[blp@ovn.org enhanced the test]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Add hostname to Chassis.
Russell Bryant [Tue, 22 Mar 2016 02:29:38 +0000 (22:29 -0400)]
ovn: Add hostname to Chassis.

We currently use the system-id from the Open_vSwitch schema on each host
to populate the unique name field of a Chassis in OVN_Southbound.  On
most systems, this is a UUID.  It would be very convenient to also have
the hostname available as that will allow people to more quickly
identify which host a Chassis record is associated with in most cases.

This is also useful for correlating an OVN Chassis with the knowledge of
hosts that exists in other systems (such as OpenStack).

Also add the hostname of each chassis to the output of "ovn-sbctl show".

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agodatapath-windows: Change reported time for flows
Alin Serdean [Tue, 15 Mar 2016 19:41:44 +0000 (19:41 +0000)]
datapath-windows: Change reported time for flows

Currently the datapath reports the tick counter to the userspace.
The userspace uses KeQueryPerformanceCounter as a monotonic clock.

This patch changes the flow stats to be reported in a monotonic format, while
also decaying the time between the flow actual usage and the flow report usage.

This patch also changes to report EEXIST if the userspace tries to add the same
flow twice.

After adding a flow, lookup the flow only if the extension is compiled in debug
mode.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoofpbuf: Don't include unneeded "packets.h".
Ben Pfaff [Mon, 21 Mar 2016 16:23:26 +0000 (09:23 -0700)]
ofpbuf: Don't include unneeded "packets.h".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoofproto/trace: Fix "unchanged" output for Final flow
YAMAMOTO Takashi [Wed, 16 Mar 2016 10:55:48 +0000 (10:55 +0000)]
ofproto/trace: Fix "unchanged" output for Final flow

Clear actset_output so that it can be compared via flow_equal.
Note: trace->key has actset_output == 0.

Found by OVS flow tests under development for Neutron. [1]

[1] https://review.openstack.org/#/c/235155/10/neutron/tests/functional/agent/test_ovs_flows.py@399

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovlog.at: Avoid using GNU sed extension
YAMAMOTO Takashi [Wed, 16 Mar 2016 07:48:48 +0000 (07:48 +0000)]
vlog.at: Avoid using GNU sed extension

BRE alternative (\|) is an GNU sed extension. [1]
It isn't available in NetBSD sed.

[1] http://www.gnu.org/software/sed/manual/sed.html#Regular-Expressions
    regexp1\|regexp2
        Matches either regexp1 or regexp2. Use parentheses to use
        complex alternative regular expressions. The matching process
        tries each alternative in turn, from left to right, and the
        first one that succeeds is used. It is a GNU extension.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovs_strerror, ovs_format_message: Always use "Success" for errno 0
YAMAMOTO Takashi [Wed, 16 Mar 2016 07:19:35 +0000 (07:19 +0000)]
ovs_strerror, ovs_format_message: Always use "Success" for errno 0

So that testsuite can compare log messages including the string.

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoINSTALL.NetBSD.md: Update for six
YAMAMOTO Takashi [Wed, 16 Mar 2016 06:54:48 +0000 (06:54 +0000)]
INSTALL.NetBSD.md: Update for six

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agobyte-order: use system ntohll() and htonll() for OS X
Lance Richardson [Tue, 15 Mar 2016 15:52:59 +0000 (11:52 -0400)]
byte-order: use system ntohll() and htonll() for OS X

Avoid collision with system headers when building under OS X.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoosx: handle differences between OS X and other BSDs
Lance Richardson [Tue, 15 Mar 2016 15:52:58 +0000 (11:52 -0400)]
osx: handle differences between OS X and other BSDs

Conditional compilation to account for:
  - OS X does not implement RTM_IFANNOUNCE.
  - OS X does not implement tap netdeivces.
  - OS X does not implement RT_ROUNDUP().

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-pki: OS X compatibility
Lance Richardson [Tue, 15 Mar 2016 15:52:57 +0000 (11:52 -0400)]
ovs-pki: OS X compatibility

Handle OS X like other BSDs (date -r is not supported, use sha1
instead of sha1sum).

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotimeval: Add clock_gettime() for OS X
Lance Richardson [Tue, 15 Mar 2016 15:52:56 +0000 (11:52 -0400)]
timeval: Add clock_gettime() for OS X

OS X does not implement clock_gettime(), implement replacement.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoofproto-dpif: rename wait() to avoid collision with system wait(2)
Lance Richardson [Tue, 15 Mar 2016 15:52:55 +0000 (11:52 -0400)]
ofproto-dpif: rename wait() to avoid collision with system wait(2)

Rename ofproto-dpif wait() to avoid collision with wait(2) under OS X.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-dpdk: Fix crash when changing the vhost-user port.
Ilya Maximets [Tue, 22 Mar 2016 12:42:03 +0000 (15:42 +0300)]
netdev-dpdk: Fix crash when changing the vhost-user port.

According to netdev-provider API:
'The "destruct" function is not allowed to fail.'

netdev-dpdk breaks this restriction for vhost-user ports.
This leads to SIGABRT or SIGSEGV in dpdk_watchdog thread
because 'dealloc' will be called anyway indifferently
to result of 'destruct'.

For example, if we call
# ovs-vsctl set interface vhost1 ofport_request=5
while QEMU still attached, we'll get:
------------------[cut]------------------
|dpdk|ERR|Can not remove port, vhost device still attached
VHOST_CONFIG: socket created, fd:98
VHOST_CONFIG: fail to bind fd:98, remove file:/home/vhost1 and try again.
|dpdk|ERR|vhost-user socket device setup failure for socket /home/vhost1
|bridge|WARN|could not open network device vhost1 (Unknown error -1)
ovs-vswitchd(dpdk_watchdog1): lib/netdev-dpdk.c:532: ovs_mutex_lock_at()
        passed uninitialized ovs_mutex

Program received signal SIGABRT, Aborted.
------------------[cut]------------------

Fix that by removing port anyway even when guest is still
attached. Guest becomes an orphan in that case but OVS
will not crash and will continue forwarding for other ports.
VM restart required to restore connectivity.

Fixes: 58397e6c1e6c ("netdev-dpdk: add dpdk vhost-cuse ports")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Kevin Traynor <kevin.traynor@intel.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agobond: don't re-zero recirc_id when creating bond
Simon Horman [Tue, 8 Mar 2016 05:50:04 +0000 (14:50 +0900)]
bond: don't re-zero recirc_id when creating bond

The bond structure is already zeroed as it is allocated
using xzalloc so there is no need to re-zero the recirc_id field.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-idl: Present tracked changes in increasing change number order.
RYAN D. MOATS [Fri, 11 Mar 2016 21:06:17 +0000 (15:06 -0600)]
ovsdb-idl: Present tracked changes in increasing change number order.

Currently changes are added to the front of the track list, so
they are looped through in LIFO order. Incremental processing
is more efficient with a FIFO presentation, so
(1) add new changes to the back of the track list, and
(2) move updated changes to the back of the track list

Signed-off-by: RYAN D. MOATS <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoAdd useful information to ovn E2E tests
RYAN D. MOATS [Fri, 11 Mar 2016 21:06:16 +0000 (15:06 -0600)]
Add useful information to ovn E2E tests

Modify E2E test to output the OF flows from all three
hypervisors to help debug when something goes wrong.

Signed-off-by: RYAN D. MOATS <rmoats@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoFAQ: Document that new fields need to be added to nx_put_raw() also.
Ben Pfaff [Tue, 22 Mar 2016 15:39:05 +0000 (08:39 -0700)]
FAQ: Document that new fields need to be added to nx_put_raw() also.

Reported-by: Enas Ahmad <enas.ahmad@kaust.edu.sa>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agobridge: Dump configurable QoS types.
Ian Stokes [Fri, 18 Mar 2016 17:14:16 +0000 (17:14 +0000)]
bridge: Dump configurable QoS types.

This commit adds a new command 'qos/show-types' for use with appctl.
This allows a user to query the types of QoS which are configurable via
Open vSwitch on a given interface.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
[blp@ovn.org made style and message changes]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agobridge: Fix qos_unixctl_show bug.
Ian Stokes [Tue, 8 Mar 2016 23:10:31 +0000 (23:10 +0000)]
bridge: Fix qos_unixctl_show bug.

netdev_get_qos returns a value to indicate if an error has occurred while
attempting to query the QoS configuration of an interface. If an error does
occur the pointer argument passed to it will be set to null before returning.
Currently the vswitch will segfault if this occurs as qos_unixctl_show will
attempt to access the pointer directly after it calls netdev_get_qos.

Avoid this by adding a check for the return value and flagging an appropriate
error message to appctl.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
[blp@ovn.org changed details of error report]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodb-ctl-base: Fix a typo.
Russell Bryant [Mon, 21 Mar 2016 17:41:45 +0000 (13:41 -0400)]
db-ctl-base: Fix a typo.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoovn: Remove outdated debug messages.
Russell Bryant [Mon, 21 Mar 2016 15:09:52 +0000 (11:09 -0400)]
ovn: Remove outdated debug messages.

ovn-northd used to only call ovnsb_db_run() and ovnnb_db_run() when
seqnos indicated that they had changed.  It now always calls these
functions from the main loop.  Remove these outdated log messages
that indicate that we called this function because contents changed.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoovn: Update the test case for localnet port.
Han Zhou [Thu, 17 Mar 2016 08:55:36 +0000 (01:55 -0700)]
ovn: Update the test case for localnet port.

Localnet port is now able to connect vif ports on different HVs.
Change the test case accordingly.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodatapath: Check for sock argument to v6ops->fragment.
Jesse Gross [Mon, 21 Mar 2016 18:39:38 +0000 (11:39 -0700)]
datapath: Check for sock argument to v6ops->fragment.

Ubuntu 3.13.0-83-generic has backported a patch that adds an intermediate
version of the v6ops->fragment function that doesn't seem to ever been
part of a released upstream kernel. This version is missing the sock
argument to the fragment function.

Since we already have a backported version of the function from a newer
kernel, this simply ignores the version that Ubuntu is now making available
and continues to use the OVS version, similar to what it was doing before.

Reported-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Reported-by: Aaron Rosen <aaronorosen@gmail.com>
Reported-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Jesse Gross <jesse@kernel.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agolist.h: Define OVS_LIST_POISON statically
Nithin Raju [Fri, 18 Mar 2016 20:17:54 +0000 (13:17 -0700)]
list.h: Define OVS_LIST_POISON statically

The previous definitions of these variables using designated
initializers caused a variety of issues when attempting to
compile with MSVC, particularly if including these headers from C++
code. By defining them like this, we can appease MSVC and keep the
definitions the same on all platforms.

Suggested-by: Yin Lin <linyi@vmware.com>
Signed-off-by: Nithin Raju <nithin@vmware.com>
[blp@ovn.org changed large literal to avoid sparse warning]
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoMove lib/dynamic-string.h to include/openvswitch directory
Ben Warren [Thu, 3 Mar 2016 18:20:46 +0000 (10:20 -0800)]
Move lib/dynamic-string.h to include/openvswitch directory

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoMove lib/ofp-errors.h to include/openvswitch directory
Ben Warren [Thu, 3 Mar 2016 18:20:43 +0000 (10:20 -0800)]
Move lib/ofp-errors.h to include/openvswitch directory

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoMove lib/geneve.h to include/openvswitch directory
Ben Warren [Thu, 3 Mar 2016 18:20:42 +0000 (10:20 -0800)]
Move lib/geneve.h to include/openvswitch directory

Signed-off-by: Ben Warren <ben@skyportsystems.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: enable basic lcov code coverage reporting support
Lance Richardson [Wed, 2 Mar 2016 21:40:48 +0000 (16:40 -0500)]
tests: enable basic lcov code coverage reporting support

Add "check-lcov" target to generate an HTML code coverage report
for testsuite execution using lcov and genhtml.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: consistently use OVS_APP_EXIT_AND_WAIT() for daemon termination
Lance Richardson [Wed, 2 Mar 2016 21:40:47 +0000 (16:40 -0500)]
tests: consistently use OVS_APP_EXIT_AND_WAIT() for daemon termination

Tools such as gcov rely on normal termination (via exit()), ensure
consistent graceful termination of daemons in tests by using
the OVS_APP_EXIT_AND_WAIT() macro.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: make as() function as documented
Lance Richardson [Wed, 2 Mar 2016 21:40:46 +0000 (16:40 -0500)]
tests: make as() function as documented

As documented, the as() function should only create a subshell
to execute the provided command when a command is present. Correct
the implementation to check for the presence of the command parameter
instead of the sandbox name (which is always present in current
usage).

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Make OVS_APP_EXIT_AND_WAIT() wait for process termination
Lance Richardson [Wed, 2 Mar 2016 21:40:45 +0000 (16:40 -0500)]
tests: Make OVS_APP_EXIT_AND_WAIT() wait for process termination

Currently OVS_APP_EXIT_AND_WAIT() only waits for the pid file
to be removed.  When using gcov (and likely other utilities),
we need to ensure that the application has actually exited.

Also adding AT_CHECK() around the exit request to allow simplification
of tests using open-coded versions of this macro.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Add l3 port security for IPv4 and IPv6
Numan Siddique [Wed, 2 Mar 2016 19:08:42 +0000 (00:38 +0530)]
ovn: Add l3 port security for IPv4 and IPv6

This patch extends the port security to support L3.
The ingress stage 'ls_in_port_sec' is renamed to 'ls_in_port_sec_l2'
and 2 new stages 'ls_in_port_sec_ip' (table 1) and 'ls_in_port_sec_nd'
(table 2) are added. 'ls_in_port_sec_ip' adds flows to restrict
the IPv4 and IPv6 traffic to valid IPv4 and IPv6 addresses of the port.
'ls_in_port_sec_nd' adds flows to restricts the ARP and IPv6 ND
packets.

For egress pipeline, 'ls_out_port_sec' is renamed to 'ls_out_port_sec_l2'
and a new stage 'ls_out_port_sec_ip' is added before 'ls_out_port_sec_l2'
to restrict the IPv4 and IPv6 traffic for valid IPs.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Co-authored-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoNEWS: Update (--color option for ovs-ofctl).
Quentin Monnet [Wed, 2 Mar 2016 14:56:22 +0000 (15:56 +0100)]
NEWS: Update (--color option for ovs-ofctl).

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-ofctl: Update manpage for --color option.
Quentin Monnet [Wed, 2 Mar 2016 14:56:21 +0000 (15:56 +0100)]
ovs-ofctl: Update manpage for --color option.

Document the `--color` option for ovs-ofctl in its manpage. The option
documentation has been added into a new file (included into the
manpage) so that it can easily be added to other manpages as well when
support for colorized output is extended to other utilities.

The use of the environment variable OVS_COLORS (used for user-defined
colors) has been documented as well.

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoofp-actions: Color output of flow actions for ovs-ofctl dump-flows.
Quentin Monnet [Wed, 2 Mar 2016 14:56:20 +0000 (15:56 +0100)]
ofp-actions: Color output of flow actions for ovs-ofctl dump-flows.

Add color output for flow actions for ovs-ofctl dump-flows command
utility, by inserting color markers in the functions responsible for
printing those actions.

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agomatch: Color output of match conditions for ovs-ofctl dump-flows.
Quentin Monnet [Wed, 2 Mar 2016 14:56:19 +0000 (15:56 +0100)]
match: Color output of match conditions for ovs-ofctl dump-flows.

Add color output for flow match conditions for ovs-ofctl dump-flows
command utility, by inserting color markers in the functions responsible
for printing those match condictions.

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-ofctl: Add output colors for flow attributes.
Quentin Monnet [Wed, 2 Mar 2016 14:56:18 +0000 (15:56 +0100)]
ovs-ofctl: Add output colors for flow attributes.

This commit adds colors to the “left part” of printed flows (to flow
properties that are always present: `cookie`, `table`, timeouts, etc.).

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-ofctl: Declare / set up colors for command output.
Quentin Monnet [Wed, 2 Mar 2016 14:56:17 +0000 (15:56 +0100)]
ovs-ofctl: Declare / set up colors for command output.

OVS_COLORS environment variable is parsed to extract user-defined
preferences regarding colors (this is used to set up a color theme, not
to replace the `--color` option for activating color output).

The string should be of a format similar to LS_COLORS or GREP_COLORS,
with available colors being as follows:

* ac: action field
* dr: drop keyword
* le: learn keyword
* pm: parameters receiving attributes
* pr: keyword having parenthesis
* sp: some special keywords
* vl: lone values with no parameter name

For color whose idendifier does not appear in the string, the default
hardcoded value is used instead.

As an example, setting OVS_COLORS to the following string is equivalent
to using the default values:

    OVS_COLORS="ac:01;31:dr=34:le=31:pm=36:pr=35:sp=33:vl=32"

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-ofctl: Add option for color output to dump-flows command.
Quentin Monnet [Wed, 2 Mar 2016 14:56:16 +0000 (15:56 +0100)]
ovs-ofctl: Add option for color output to dump-flows command.

Add an option to ovs-ofctl utility so as to obtain colorized output in
tty, for easier reading. Currently, only the dump-flows command supports
colors.

A new `--color` option has been added to ovs-ofctl so as to indicate
whether color markers should be used or not. It can be set to `always`
(force colors), `never` (no colors) or `auto` (use colors only if output
is a tty). If provided without any value, it is the same as `auto`. If
the option is not provided at all, colors are disabled by default.

Examples:
This first call will output colorized flows:

    ovs-ofctl dump-flows br0 --color=always

These two calls will produce colorized output on a tty, but they will
not use color markers if the output is redirected to a file or piped
into another command:

    ovs-ofctl dump-flows br0 --color=auto
    ovs-ofctl dump-flows br0 --color

These two calls will not use color markers:

    ovs-ofctl dump-flows br0 --color=never
    ovs-ofctl dump-flows br0

The result of this option is stored into a variable which is to be
forwarded (in next commits) as a function argument until it reaches the
functions that print the elements of the flows.

Signed-off-by: Quentin Monnet <quentin.monnet@6wind.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agovtep: Introduce other_config column in some vtep schema tables.
Saurabh Shrivastava [Thu, 17 Mar 2016 16:00:50 +0000 (09:00 -0700)]
vtep: Introduce other_config column in some vtep schema tables.

Having an other_config column is a simple way to pass more information than the
schema allows.

Signed-off-by: Saurabh Shrivastava <saurabh.shrivastava@nuagenetworks.net>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agorhel: Don't package ovs-testcontroller with ovn.
Russell Bryant [Thu, 17 Mar 2016 02:16:07 +0000 (19:16 -0700)]
rhel: Don't package ovs-testcontroller with ovn.

This was a mistake.  ovs-testcontroller was duplicated in the ovn
package.  It's already in the main openvswitch package, where it
belongs.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-vtep: Delete flows with untagged vlan carefully.
Gurucharan Shetty [Tue, 1 Mar 2016 23:14:14 +0000 (15:14 -0800)]
ovs-vtep: Delete flows with untagged vlan carefully.

A (physical port + vlan) or (physical port + no tag) can be bound to a
logical switch. When one unbinds (physical port + no tag) from a logical
switch, the emulator inadvertantly deletes flows for (physical port + vlan)
too. This commit fixes it.

VMware-BZ: #1609938
Reported-by: Mike Qing <mqing@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
8 years agoovs-ctl: Remove code for upgrading from Open vSwitch 1.6 and earlier.
Ben Pfaff [Wed, 16 Mar 2016 23:45:29 +0000 (16:45 -0700)]
ovs-ctl: Remove code for upgrading from Open vSwitch 1.6 and earlier.

OVS 1.7 was released in July 2012, so by the time current OVS is released,
it will be almost four years old.  I think that this is long enough to
remove special upgrade code.

It's almost impossible to do this upgrade in any case since there is
no overlap in the base kernel versions supported by the out of tree
modules in the two versions (the only possibility is running the new
version of OVS on the upstream module from Linux 3.3).

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agoovs-ctl: Remove code for upgrading from Open vSwitch 1.9 and earlier.
Ben Pfaff [Thu, 17 Mar 2016 03:10:40 +0000 (20:10 -0700)]
ovs-ctl: Remove code for upgrading from Open vSwitch 1.9 and earlier.

OVS 1.10 was released in May 2013, so by the time current OVS is released,
it will be about three years old.  I think that this is long enough to
remove special upgrade code from the startup scripts.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agoINSTALL.md: Suggest jemalloc memory allocator.
Rodriguez Betancourt, Esteban [Tue, 15 Mar 2016 23:29:57 +0000 (23:29 +0000)]
INSTALL.md: Suggest jemalloc memory allocator.

Change installing documentation to suggest to use
jemalloc memory allocator.

This memory allocator showed great performance gains
when used at ovsdb-server and other components.

Signed-off-by: Esteban Rodriguez Betancourt <estebarb@hpe.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>