]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
7 years agolibX: add new release / version info tags
Aaron Conole [Mon, 16 Jan 2017 19:06:27 +0000 (14:06 -0500)]
libX: add new release / version info tags

This commit uses the $PACKAGE_VERSION automake variable to construct a
release and version info combination which sets the library name to be:

   libfoo-$(OVS_MAJOR_VERSION).so.$(OVS_MINOR_VERSION).0.$(OVS_MICRO_VERSION)

where formerly, it was always:

   libfoo.so.1.0.0

This allows releases of Open vSwitch libraries to reflect which specific
versions they came with, and sets up a psuedo ABI-versioning scheme.  In
this fashion, future releases of Open vSwitch could be installed
alongside older releases, allowing 3rd party utilities linked against
previous versions to continue to function.

ex:

$ ldd /path/to/utility
linux-vdso.so.1 (0x00007ffe92cf6000)
libopenvswitch-2.so.6 => /lib64/libopenvswitch-2.so.6 (0x00007f733b7a3000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007f733b530000)
...

Note the library name and version information.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: document logical routers and logical patch ports in ovn-architecture
Mickey Spiegel [Tue, 17 Jan 2017 09:45:02 +0000 (01:45 -0800)]
ovn: document logical routers and logical patch ports in ovn-architecture

This patch adds a description of logical routers and logical patch ports,
including gateway routers, to ovn/ovn-architecture.7.xml.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agovlan.rst: Strip leftover HTML.
Russell Bryant [Mon, 16 Jan 2017 21:46:16 +0000 (16:46 -0500)]
vlan.rst: Strip leftover HTML.

Strip a couple of closing HTML tags that were left over from when this doc
was converted from the web site to RST.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodpif-netdev: Avoids repeated addition of DP_STAT_LOST.
nickcooper-zhangtonghao [Mon, 16 Jan 2017 12:56:39 +0000 (04:56 -0800)]
dpif-netdev: Avoids repeated addition of DP_STAT_LOST.

CC: Daniele Di Proietto <diproiettod@vmware.com>
Fixes: 8aaa125dab66 ("dpif-netdev: Share emc and fast path output batches.")
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovs-numa: Remove unused functions.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
ovs-numa: Remove unused functions.

ovs-numa doesn't need to keep the state of the pmd threads, it is an
implementation detail of dpif-netdev.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Centralized threads and queues handling code.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Centralized threads and queues handling code.

Currently we have three different code paths that deal with pmd threads
and queues, in response to different input

1. When a port is added
2. When a port is deleted
3. When the cpumask changes or a port must be reconfigured.

1. and 2. are carefully written to minimize disruption to the running
datapath, while 3. brings down all the threads reconfigure all the ports
and restarts everything.

This commit removes the three separate code paths by introducing the
reconfigure_datapath() function, that takes care of adapting the pmd
threads and queues to the current datapath configuration, no matter how
we got there.

This aims at simplifying maintenance and introduces a long overdue
improvement: port reconfiguration (can happen quite frequently for
dpdkvhost ports) is now done without shutting down the whole datapath,
but just by temporarily removing the port that needs to be reconfigured
(while the rest of the datapath is running).

We now also recompute the rxq scheduling from scratch every time a port
is added of deleted.  This means that the queues will be more balanced,
especially when dealing with explicit rxq-affinity from the user
(without shutting down the threads and restarting them), but it also
means that adding or deleting a port might cause existing queues to be
moved between pmd threads.  This negative effect can be avoided by
taking into account the existing distribution when computing the new
scheduling, but I considered code clarity and fast reconfiguration more
important than optimizing port addition or removal (a port is added and
removed only once, but can be reconfigured many times)

Lastly, this commit moves the pmd threads state away from ovs-numa.  Now
the pmd threads state is kept only in dpif-netdev.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Co-authored-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Use hmap for poll_list in pmd threads.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Use hmap for poll_list in pmd threads.

A future commit will use this to determine if a queue is already
contained in a pmd thread.

To keep the behavior unaltered we now have to sort queues before
printing them in pmd_info_show_rxq().

Also this commit introduces 'struct polled_queue' that will be used
exclusively in the fast path, uses 'struct dp_netdev_rxq' from 'struct
rxq_poll' and uses 'rx' for 'netdev_rxq' and 'rxq' for 'dp_netdev_rxq'.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agoovs-numa: Add per numa and global counts in dump.
Daniele Di Proietto [Wed, 30 Nov 2016 02:10:41 +0000 (18:10 -0800)]
ovs-numa: Add per numa and global counts in dump.

They will be used by a future commit.

Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agoovs-numa: Don't use hmap_first_with_hash().
Daniele Di Proietto [Tue, 29 Nov 2016 22:51:03 +0000 (14:51 -0800)]
ovs-numa: Don't use hmap_first_with_hash().

I think it's better to iterate the hmap than to use
hmap_first_with_hash(), because it handles hash collisions.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agoovs-numa: Add new dump types.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
ovs-numa: Add new dump types.

They will be used by a future commit.

This patch introduces some code duplication which will be removed in a
future commit.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agoovs-numa: New ovs_numa_dump_contains_core() function.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
ovs-numa: New ovs_numa_dump_contains_core() function.

It will be used by a future commit.  struct ovs_numa_dump now uses an
hmap instead of a list to make ovs_numa_dump_contains_core() more
efficient.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpctl: Avoid making assumptions on pmd threads.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpctl: Avoid making assumptions on pmd threads.

Currently dpctl depends on ovs-numa module to delete and create flows on
different pmd threads for pmd devices.

The next commits will move away the pmd threads state from ovs-numa to
dpif-netdev, so the ovs-numa interface will not be supported.

Also, the assignment between ports and thread is an implementation
detail of dpif-netdev, dpctl shouldn't know anything about it.

This commit changes the dpif_flow_put() and dpif_flow_del() calls to
iterate over all the pmd threads, if pmd_id is PMD_ID_NULL.

A simple test is added.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Make 'static_tx_qid' const.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Make 'static_tx_qid' const.

Since previous commit, 'static_tx_qid' doesn't need to be atomic and is
actually never touched (except for initialization), so it can be made
const.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Create pmd threads for every numa node.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Create pmd threads for every numa node.

A lot of the complexity in the code that handles pmd threads and ports
in dpif-netdev is due to the fact that we postpone the creation of pmd
threads on a numa node until we have a port that needs to be polled on
that particular node.

Since the previous commit, a pmd thread with no ports will not consume
any CPU, so it seems easier to create all the threads at once.

This will also make future commits easier.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Block pmd threads if there are no ports.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Block pmd threads if there are no ports.

There's no reason for a pmd thread to perform its main loop if there are
no queues in its poll_list.

This commit introduces a seq object on which the pmd thread can be
blocked, if there are no queues.

When the main thread wants to reload a pmd threads it must now change
the seq object (in case it's blocked) and set 'reload' to true.

This is useful to avoid wasting CPU cycles and is also necessary for a
future commit.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Use a boolean instead of pmd->port_seq.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Use a boolean instead of pmd->port_seq.

There's no need for a sequence number, since the main thread has to wait
for the pmd thread, so there's no chance that an update will be
undetected.

A seq object will be introduced for another purpose in the next commit,
and changing this to boolean makes the code more readable.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agonetdev-dpdk: Refactor construct and destruct.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
netdev-dpdk: Refactor construct and destruct.

Some refactoring for _construct() and _destruct() methods:
* Rename netdev_dpdk_init() to common_construct(). init() has a
  different meaning in the netdev context.
* Remove DPDK_DEV_ETH and DPDK_DEV_VHOST checks in common_construct()
  and move them to different functions
* Introduce common_destruct().
* Avoid taking 'dev->mutex' in construct and destruct: we're guaranteed
  to be the only thread with access to the object.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agonetdev-dpdk: Start also dpdkr devices only once on port-add.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
netdev-dpdk: Start also dpdkr devices only once on port-add.

Since commit 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming"),
we don't call rte_eth_start() from netdev_open() anymore, we only call
it from netdev_reconfigure().  This commit does that also for 'dpdkr'
devices, and remove some useless code.

Calling rte_eth_start() also from netdev_open() was unnecessary and
wasteful. Not doing it reduces code duplication and makes adding a port
faster (~900ms before the patch, ~400ms after).

Another reason why this is useful is that some DPDK driver might have
problems with reconfiguration. For example, until DPDK commit
8618d19b52b1("net/vmxnet3: reallocate shared memzone on re-config"),
vmxnet3 didn't support being restarted with a different number of
queues.

Technically, the netdev interface changed because before opening rxqs or
calling netdev_send() the user must check if reconfiguration is
required.  This patch also documents that, even though no change to the
userspace datapath (the only user) is required.

Lastly, this patch makes sure the errors returned by ofproto_port_add
(which includes the first port reconfiguration) are reported back to the
database.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agonetdev-dpdk: Don't call rte_dev_stop() in update_flags().
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
netdev-dpdk: Don't call rte_dev_stop() in update_flags().

Calling rte_eth_dev_stop() while the device is running causes a crash.

We could use rte_eth_dev_set_link_down(), but not every PMD implements
that, and I found one NIC where that has no effect.

Instead, this commit checks if the device has the NETDEV_UP flag when
transmitting or receiving (similarly to what we do for vhostuser). I
didn't notice any performance difference with this check in case the
device is up.

An alternative would be to remove the device queues from the pmd threads
tx and receive cache, but that requires reconfiguration and I'd prefer
to avoid it, because the change can come from OpenFlow.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Don't try to output on a device without txqs.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Don't try to output on a device without txqs.

Tunnel devices have 0 txqs and don't support netdev_send().  While
netdev_send() simply returns EOPNOTSUPP, the XPS logic is still executed
on output, and that might be confused by devices with no txqs.

It seems better to have different structures in the fast path for ports
that support netdev_{push,pop}_header (tunnel devices), and ports that
support netdev_send.  With this we can also remove a branch in
netdev_send().

This is also necessary for a future commit, which starts DPDK devices
without txqs.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Take non_pmd_mutex to access tx cached ports.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Take non_pmd_mutex to access tx cached ports.

As documented in dp_netdev_pmd_thread, we must take non_pmd_mutex to
access the tx port caches for the non pmd thread.

Found by inspection.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
7 years agodpif-netdev: Fix memory leak.
Daniele Di Proietto [Tue, 15 Nov 2016 23:40:49 +0000 (15:40 -0800)]
dpif-netdev: Fix memory leak.

We keep all the per-port classifiers around, since they can be reused,
but when a pmd thread is destroyed we should free them.

Found using valgrind.

Fixes: 3453b4d62a98("dpif-netdev: dpcls per in_port with sorted
subtables")

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Catch exception "SSL.SysCallError" for send by SSL.
Guoshuai Li [Sat, 7 Jan 2017 06:28:35 +0000 (14:28 +0800)]
python: Catch exception "SSL.SysCallError" for send by SSL.

When OVSDB server is aborted,
the SSL send function will throw SSL.SysCallError exception,
which we need to catch and return it's -errno.

While SSL.WantWriteError exception needs to return -EAGAIN
based on its parent class, not EAGAIN

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoUse PRIu32 format for ofp_port_t
Shu Shen [Sat, 14 Jan 2017 01:51:00 +0000 (17:51 -0800)]
Use PRIu32 format for ofp_port_t

Although ofp_port_t uses a 16-bit range, it is defined as a 32-bit type.
The format strings throughout the code base were using PRIu16 for
ofp_port_t which leads to the compiler to throw Wformat message on
platforms that don't promote 16-bit to 32-bit integers, e.g., on macOS.

Signed-off-by: Shu Shen <shu.shen@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn: specify addresses of type "router" lsps as "router"
Mickey Spiegel [Fri, 6 Jan 2017 20:00:28 +0000 (12:00 -0800)]
ovn: specify addresses of type "router" lsps as "router"

Currently in OVN, when a logical switch port of type "router" is
created, the MAC and optionally IP addresses of the peer logical
router port must be specified again as the addresses of the logical
switch port.

This patch allows the logical switch port's addresses to be
specified as the string "router", rather than explicitly copying the
logical router port's MAC and optionally IP addresses.  The router
addresses are used to populate the logical switch's destination
lookup, and to populate op->lsp_addrs in ovn-northd.c, which in turn
is used to generate logical switch ARP and ND replies.  Since ipam
already looks at logical router ports, the only ipam modification
necessary is to skip logical switch ports with addresses "router".

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodb-ctl-base: Always support all tables in schema.
Ben Pfaff [Wed, 4 Jan 2017 22:29:21 +0000 (14:29 -0800)]
db-ctl-base: Always support all tables in schema.

When one adds a new table to a database schema, it's easy to forget to
add the table to the list of tables in the *ctl.c program.  When this
happens, the database commands for that program don't work on that table
at all, even for commands like "list" and "create" that don't need any
special help.  This patch fixes that problem, by making sure that
db-ctl-base always has the complete list of tables.

Previously, each ctl_table_class pointed directly to the corresponding
ovsdb_idl_table_class.  With this patch, there are instead two parallel
arrays, one of ovsdb_idl_table_classes and the other of ctl_table_classes.
This change accounts for the bulk of the change to the db-ctl-base code.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
7 years agotravis: Update build list email address.
Ben Pfaff [Thu, 12 Jan 2017 17:16:52 +0000 (09:16 -0800)]
travis: Update build list email address.

The lists these days prefer an ovs- prefix.  Currently all of the build
emails are being dropped because it is missing.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agodpif: Simplify dpif_execute_helper_cb()
Andy Zhou [Wed, 11 Jan 2017 23:26:27 +0000 (15:26 -0800)]
dpif: Simplify dpif_execute_helper_cb()

The may_steal flag is now used, Remove OVS_UNUSED.

Since dp_packet_delete() handles the NULL pointer properly, we can
drop a few tracking variables, and make the code easier to follow.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agonetdev-vport: Do not log empty warnings on success.
Daniele Di Proietto [Thu, 12 Jan 2017 07:59:57 +0000 (23:59 -0800)]
netdev-vport: Do not log empty warnings on success.

set_tunnel_config() always logs a warning, even on success. This
shouldn't happen.

Without this, some unit tests fail.

Fixes: 9fff138ec3a6("netdev: Add 'errp' to set_config().")
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif: Make ofproto/trace output easier to read.
Ben Pfaff [Thu, 12 Jan 2017 16:15:02 +0000 (08:15 -0800)]
ofproto-dpif: Make ofproto/trace output easier to read.

"ovs-appctl ofproto/trace" is invaluable for debugging, but as the users of
Open vSwitch have evolved it has failed to keep up with the times.  It's
pretty easy to design OpenFlow tables and pipelines that resubmit dozens of
times.  Each resubmit causes an additional tab of indentation, so the
output wraps around, sometimes again and again, and makes the output close
to unreadable.

ovn-trace pioneered better formatting for tracing in OVN logical datapaths,
mostly by not increasing indentation for tail recursion, which in practice
gets rid of almost all indentation.

This commit experiments with redoing ofproto/trace the same way.  Try
looking at, for example, the testsuite output for test 2282 "ovn -- 3 HVs,
3 LRs connected via LS, source IP based routes".  Without this commit, it
indents 61 levels (488 spaces!).  With this commit, it indents 1 level
(4 spaces) and it's possible to actually understand what's going on almost
at a glance.

To see this for yourself, try the following command either with or without
this commit (but be sure to keep the change to ovn.at that adds an
ofproto/trace to the test):
make check TESTSUITEFLAGS='-d 2282' && less tests/testsuite.dir/2282/testsuite.log

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agonetdev: Add 'errp' to set_config().
Daniele Di Proietto [Wed, 21 Dec 2016 01:58:14 +0000 (17:58 -0800)]
netdev: Add 'errp' to set_config().

Since 55e075e65ef9("netdev-dpdk: Arbitrary 'dpdk' port naming"),
set_config() is used to identify a DPDK device, so it's better to report
its detailed error message to the user.  Tunnel devices and patch ports
rely a lot on set_config() as well.

This commit adds a param to set_config() that can be used to return
an error message and makes use of that in netdev-dpdk and netdev-vport.

Before this patch:

$ ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk
ovs-vsctl: Error detected while setting up 'dpdk0': dpdk0: could not set
    configuration (Invalid argument).  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch/".

$ ovs-vsctl add-port br0 p+ -- set Interface p+ type=patch
ovs-vsctl: Error detected while setting up 'p+': p+: could not set
    configuration (Invalid argument).  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch/".

$ ovs-vsctl add-port br0 gnv0 -- set Interface gnv0 type=geneve
ovs-vsctl: Error detected while setting up 'gnv0': gnv0: could not set
    configuration (Invalid argument).  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch/".

After this patch:

$ ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk
ovs-vsctl: Error detected while setting up 'dpdk0': 'dpdk0' is missing
    'options:dpdk-devargs'. The old 'dpdk<port_id>' names are not
    supported.  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch/".

$ ovs-vsctl add-port br0 p+ -- set Interface p+ type=patch
ovs-vsctl: Error detected while setting up 'p+': p+: patch type requires
    valid 'peer' argument.  See ovs-vswitchd log for details.
ovs-vsctl: The default log directory is "/var/log/openvswitch/".

$ ovs-vsctl add-port br0 gnv0 -- set Interface gnv0 type=geneve
ovs-vsctl: Error detected while setting up 'gnv0': gnv0: geneve type
    requires valid 'remote_ip' argument.  See ovs-vswitchd log for
    details.
ovs-vsctl: The default log directory is "/var/log/openvswitch/".

CC: Ciara Loftus <ciara.loftus@intel.com>
CC: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
7 years agonetdev-dpdk: Assign socket id according to device's numa id
xu.binbin1@zte.com.cn [Thu, 12 Jan 2017 14:18:13 +0000 (22:18 +0800)]
netdev-dpdk: Assign socket id according to device's numa id

We can hotplug attach DPDK ports specified via the 'dpdk-devargs'
option now.

But the socket id of DPDK ports can't be assigned correctly,
it is always 0. The socket id of DPDK ports should be assigned
according to the numa id of the device.

Fixes: 55e075e65ef9e ("netdev-dpdk: Arbitrary 'dpdk' port naming")
Signed-off-by: Binbin Xu <xu.binbin1@zte.com.cn>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agorevalidator: Complain for more ukey transitions.
Joe Stringer [Tue, 10 Jan 2017 23:54:03 +0000 (15:54 -0800)]
revalidator: Complain for more ukey transitions.

For most ukey transition states, only one thread should be responsible
for transitioning the ukey into the new state. If another thread
attempts to transition the ukey into the same state (for instance,
evicting the datapath flow or deleting the ukey), then it is likely
performing additional work which should only happen once. Log all cases
of ukey transition into the current state, except for UKEY_OPERATIONAL
-> UKEY_OPERATIONAL which regularly occurs when revalidating ukeys.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agorevalidator: Prevent double-delete of ukey.
Joe Stringer [Tue, 10 Jan 2017 23:54:02 +0000 (15:54 -0800)]
revalidator: Prevent double-delete of ukey.

revalidator_sweep__() splits checking for whether to delete a ukey from
the actual deletion to prevent taking the umap lock for too long.
However it uses information gathered from the first critical section to
decide to call ukey_delete() - ie, the second critical section.

Since 67f08985d769 ("upcall: Replace ukeys for deleted flows."), it is
possible for a handler thread to receive an upcall for the same flow and
to replace the ukey which is being deleted with a new one, in between
these critical sections. This will remove the ukey from the cmap,
rcu-defer its deletion, and update the ukey state.

If this occurs in between the critical sections of revalidator cleanup
of the flow, then the revalidator will subsequently call ukey_delete()
to delete the original ukey, which was already deleted by the handler
thread. This leads to a segfault in cmap_replace__().

Guard against this by checking the ukey state in ukey_delete() while
holding the ukey lock.

Backtrace:
    Program terminated with signal 11, Segmentation fault.
    #0  0x00007fe969b13da3 in cmap_replace__ ()
    #1  0x00007fe969b14491 in cmap_replace ()
    #2  0x00007fe969aee9ff in ukey_delete ()
    #3  0x00007fe969aefd42 in revalidator_sweep__ ()
    #4  0x00007fe969af1bad in udpif_revalidator ()
    #5  0x00007fe969b8b2a6 in ovsthread_wrapper ()
    #6  0x00007fe968e07dc5 in start_thread () from /lib64/libpthread.so.0
    #7  0x00007fe96862c73d in clone () from /lib64/libc.so.6

Fixes: 54ebeff4c03d ("upcall: Track ukey states.")
Fixes: 67f08985d769 ("upcall: Replace ukeys for deleted flows.")
Reported-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agonetdev-dummy: Limits the number of tx/rx queues.
nickcooper-zhangtonghao [Tue, 10 Jan 2017 05:56:14 +0000 (21:56 -0800)]
netdev-dummy: Limits the number of tx/rx queues.

This patch avoids the ovs_rcu to report WARN, caused by blocked
for a long time, when ovs-vswitchd processes a port with many
rx/tx queues. The number of tx/rx queues per port may be appropriate,
because the dpdk uses it as an default max value.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodpdk: Late initialization.
Daniele Di Proietto [Wed, 5 Oct 2016 00:58:05 +0000 (17:58 -0700)]
dpdk: Late initialization.

With this commit, we allow the user to set other_config:dpdk-init=true
after the process is started.  This makes it easier to start Open
vSwitch with DPDK using standard init scripts without restarting the
service.

This is still far from ideal, because initializing DPDK might still
abort the process (e.g. if there not enough memory), so the user must
check the status of the process after setting dpdk-init to true.

Nonetheless, I think this is an improvement, because it doesn't require
restarting the whole unit.

CC: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Aaron Conole <aconole@redhat.com>
7 years agodpcls: Avoid one 8-byte chunk in subtable mask.
Jarno Rajahalme [Thu, 5 Jan 2017 23:33:13 +0000 (15:33 -0800)]
dpcls: Avoid one 8-byte chunk in subtable mask.

This patch allows to skip the 8-byte chunk comprising of dp_hash and
in_port in the subtable mask when dp_hash is wildcarded.  This will
slightly speed up the hash computation as one expensive function call
to hash_add64() can be skipped.

For each new netdev flow we wildcard in_port in the mask, so in the
typical case where dp_hash is also wildcarded, the resulting 8-byte
chunk will not be part of the subtable mask.

This manipulation of the mask is possible as the datapath classifier
is explicitly selected based on the in_port value, so that all the
datapath flows in the selected classifier have an exact match on that
in_port value.  Given this, it is safe to ignore the in_port value
when doing a lookup in the chosen classifier.

Signed-off-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Co-authored-by: Bhanuprakash Bodireddy <bhanuprakash.bodireddy@intel.com>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Co-authored-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoAUTHORS: Add Dong Jun.
Ben Pfaff [Tue, 10 Jan 2017 18:43:54 +0000 (10:43 -0800)]
AUTHORS: Add Dong Jun.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Clear conntrack state inside clone action.
Ben Pfaff [Fri, 6 Jan 2017 04:36:52 +0000 (20:36 -0800)]
ovn-controller: Clear conntrack state inside clone action.

ovn-controller implements traversal from one OVN logical network to another
using the Open vSwitch "clone" action.  The "clone" action preserves
connection tracking state, which is confusing for passing from one logical
datapath to another because this state is only relevant for a single
logical datapath and does not make sense in the new one.  This commit
fixes a problem sometimes seen by ensuring that the connection tracking
state is cleared when these traversals happen.

Reported-by: Numan Siddique <nusiddiq@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326948.html
Fixes: f1a8bd06d58f ("ovn-controller: Drop most uses of OVS patch ports.")
Tested-by: Dong Jun <dongj@dtdream.com>
7 years agoNew action "ct_clear".
Ben Pfaff [Fri, 6 Jan 2017 16:19:53 +0000 (08:19 -0800)]
New action "ct_clear".

This is being introduced specifically to allow a user of the "clone" action
to clear the connection tracking state, but it's implemented as a separate
action as a matter of clean design and in case another use case arises
later.

Reported-by: Mickey Spiegel <mickeys.dev@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html
Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
Tested-by: Dong Jun <dongj@dtdream.com>
7 years agoofproto-dpif-xlate: Make clone save "was_mpls".
Ben Pfaff [Fri, 6 Jan 2017 00:11:15 +0000 (16:11 -0800)]
ofproto-dpif-xlate: Make clone save "was_mpls".

This seems like it's an optimization rather than a correctness issue, but
in general it's best to make "clone" like patch ports where there is no
reason to depart from its design, since we know that patch ports work well.

Reported-by: Mickey Spiegel <mickeys.dev@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html
Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
Tested-by: Dong Jun <dongj@dtdream.com>
7 years agoofproto-dpif-xlate: Make "clone" save action set and stack.
Ben Pfaff [Fri, 6 Jan 2017 04:37:15 +0000 (20:37 -0800)]
ofproto-dpif-xlate: Make "clone" save action set and stack.

This is a design decision but it seems conceptually cleaner than having
them leak through into the clone.

Reported-by: Mickey Spiegel <mickeys.dev@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html
Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
Tested-by: Dong Jun <dongj@dtdream.com>
7 years agoovsdb-idl: Enhance conditional monitoring API
Andy Zhou [Tue, 20 Dec 2016 07:55:01 +0000 (23:55 -0800)]
ovsdb-idl: Enhance conditional monitoring API

To allow client to know when the conditional monitoring changes
has been accepted by the OVSDB server and the 'idl' contents has
been updated to match the new conditions.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-idl: Properly handle conditional monitor update error
andy zhou [Sat, 17 Dec 2016 00:55:09 +0000 (16:55 -0800)]
ovsdb-idl: Properly handle conditional monitor update error

When generating conditional monitoring update request, current code
failed to update idl's 'request-id'.  This bug causes the reply
message of the update request, regardless an ACK or a NACK, be
logged as an unexpected message at the debug level and ignored by
the core idl logic.

In addition, the idl should not generate another conditional
monitoring update request when there is an outstanding request.
So that the requests and their reply are properly serialized.

When the conditional monitoring is nacked by the server, drop idl
into a client visible error state.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodpif-netdev: Uses the OVS_CORE_UNSPEC instead of magic numbers.
nickcooper-zhangtonghao [Mon, 9 Jan 2017 01:30:22 +0000 (17:30 -0800)]
dpif-netdev: Uses the OVS_CORE_UNSPEC instead of magic numbers.

This patch uses OVS_CORE_UNSPEC for the queue unpinned instead
of "-1". More important, the "-1" casted to unsigned int is
equal to NON_PMD_CORE_ID. We make the distinction between them.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dummy: Uses the NR_QUEUE instead of magic numbers.
nickcooper-zhangtonghao [Mon, 9 Jan 2017 01:30:21 +0000 (17:30 -0800)]
netdev-dummy: Uses the NR_QUEUE instead of magic numbers.

The NR_QUEUE is defined in "lib/dpif-netdev.h", netdev-dpdk
uses it instead of magic number. netdev-dummy should be
in the same case.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: Fix formatting typo.
nickcooper-zhangtonghao [Mon, 9 Jan 2017 01:30:19 +0000 (17:30 -0800)]
netdev-dpdk: Fix formatting typo.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonx-match: Only store significant bytes to stack.
Jarno Rajahalme [Fri, 6 Jan 2017 01:30:27 +0000 (17:30 -0800)]
nx-match: Only store significant bytes to stack.

Always storing the maximum mf_value size wastes about 120 bytes for
each stack entry.  This patch changes the stack from an mf_value array
to a string of value-length pairs.

The length is stored after the value so that the stack pop may first
read the length and then the appropriate number of bytes.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-util: Do not assert fail if decoding malformed property.
Jarno Rajahalme [Sat, 7 Jan 2017 02:14:48 +0000 (18:14 -0800)]
ofp-util: Do not assert fail if decoding malformed property.

OVS should not crash if the controller sends a malformed OpenFlow
message.  Return the error code instead.

Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath: Ensure correct L4 checksum with NAT helpers.
John Hurley [Sat, 7 Jan 2017 01:55:11 +0000 (17:55 -0800)]
datapath: Ensure correct L4 checksum with NAT helpers.

Setting the CHECKSUM_PARTIAL flag before sending to helper mods was
missing the checksum update call ('csum_*_magic()'), which caused
checksum failures with kernels <4.6.  This can mean that the L4
checksum is incorrect when the packet egresses the system.

Rather than adding the missing (IP version dependent) calls, give the
packet a temp skb_dst with RTCF_LOCAL flag not set, which ensures the
skb is properly changed to CHECKSUM_PARTIAL if required and the
modified packet will get the correct checksum when fully processed.

This has tested with FTP NAT helpers on kernel version 3.13.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agodpif: Return ENODEV from dpif_port_query_by_*() if there's no port.
Daniele Di Proietto [Fri, 6 Jan 2017 04:21:23 +0000 (20:21 -0800)]
dpif: Return ENODEV from dpif_port_query_by_*() if there's no port.

bridge_delete_or_reconfigure() deletes every interface that's not dumped
by OFPROTO_PORT_FOR_EACH().  ofproto_dpif.c:port_dump_next(), used by
OFPROTO_PORT_FOR_EACH, checks if the ofport is in the datapath by
calling port_query_by_name().  If port_query_by_name() returns an error,
the dump is interrupted.  If port_query_by_name() returns ENODEV, the
device doesn't exist and the dump can continue.

port_query_by_name() for the userspace datapath returns ENOENT instead
of ENODEV.  This is expected by dpif_port_query_by_name(), but it's not
handled correctly by port_dump_next().

dpif-netdev handles reconfiguration errors for an interface by deleting
it from the datapath, so it's possible that a device is missing. When this
happens we must make sure that port_dump_next() continues to dump other
devices, otherwise they will be deleted and the two layers will have an
inconsistent view.

This commit fixes the problem by returning ENODEV from the userspace
datapath if the port doesn't exist, and by documenting this clearly in
the dpif interfaces.

The problem was found while developing new code.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-idl: Avoid sending redundant conditional monitoring updates
Andy Zhou [Tue, 20 Dec 2016 06:39:53 +0000 (22:39 -0800)]
ovsdb-idl: Avoid sending redundant conditional monitoring updates

In case connection is reset when there are buffered but unsent
conditions, these conditions will be sent as the new "monitor_cond"
message that will be sent after the idl reconnects.

Without this patch, those conditions will be unnecessarily sent again
with following monitoring condition update message.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Fix typo in OvsUpdateIPv4Header
Alin Serdean [Fri, 6 Jan 2017 19:33:44 +0000 (19:33 +0000)]
datapath-windows: Fix typo in OvsUpdateIPv4Header

Found by inspection.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Fix nroff indentation for <dl> after <hN>.
Joe Stringer [Fri, 6 Jan 2017 02:09:35 +0000 (18:09 -0800)]
python: Fix nroff indentation for <dl> after <hN>.

When XML is used for writing manpages, in the case that there is a
header tag followed by <dl>, the nroff python utility indents the <dl>
tag (and children) an extra level which is unnecessary and makes the
formatting inconsistent between manpages written directly in nroff vs
manpages written in XML and converted to nroff. Fix the indentation by
removing the extraneous .RS / .RE tags added to generated nroff in this
case.

This fixes the formatting of ovn/utilities/ovn-nbctl.8 man page.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoxml2nroff: Port to python3.
Joe Stringer [Fri, 6 Jan 2017 02:01:08 +0000 (18:01 -0800)]
xml2nroff: Port to python3.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-xlate: After thawing, retrieve tunnel table from thawed xbridge
Mickey Spiegel [Sun, 1 Jan 2017 01:05:21 +0000 (17:05 -0800)]
ofproto-dpif-xlate: After thawing, retrieve tunnel table from thawed xbridge

In xlate_actions in ofproto-dpif-xlate.c, after thawing from frozen state,
it currently retrieves the tunnel metadata table from the original xbridge.
It should retrieve the tunnel metadata table from the thawed xbridge.

In OVN, this manifested as missing geneve option fields when receiving a
packet from localnet to br-int, then freezing (e.g. for NAT on a gateway
router or for distributed NAT), then attempting to send out a tunnel.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: Fix documentation for "ovn-nbctl acl-add".
zhaojingjing [Fri, 6 Jan 2017 07:55:40 +0000 (15:55 +0800)]
ovn-nbctl: Fix documentation for "ovn-nbctl acl-add".

The range of "PRIORITY" for "ovn-nbctl acl-add " command is 1 to 65534 in
ovn-nbctl.8.xml",When configuring this command, it indicates that "
priority must in range 0...32767".The range of priority is inconsistent
in "ovn-nbctl.8.xml" and "ovn-nbctl.c".

Signed-off-by: zhaojingjing <zhao.jingjing1@zte.com.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nbctl: Specify the range of the tag for "ovn-nbctl lsp-add" command.
zhaojingjing [Fri, 6 Jan 2017 07:53:31 +0000 (15:53 +0800)]
ovn-nbctl: Specify the range of the tag for "ovn-nbctl lsp-add" command.

When configuring the wrong tag for "ovn-nbctl lsp-add" command,
it shows "invalid tag". The range of the tag is not known.

Signed-off-by: zhaojingjing <zhao.jingjing1@zte.com.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agomanpages.mk: Update.
Ben Pfaff [Fri, 6 Jan 2017 04:48:35 +0000 (20:48 -0800)]
manpages.mk: Update.

This file is, annoying, both auto-generated and checked in.  This is an
update to the latest auto-generated version.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-xlate: Make clone save whether conntracking has occurred.
Ben Pfaff [Thu, 5 Jan 2017 23:58:21 +0000 (15:58 -0800)]
ofproto-dpif-xlate: Make clone save whether conntracking has occurred.

The rest of the conntrack state (in the flow) is saved and restored, so
this should be also.

Reported-by: Mickey Spiegel <mickeys.dev@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2017-January/326981.html
Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoofctrl: Fix warning from sparse.
Ben Pfaff [Fri, 6 Jan 2017 01:03:06 +0000 (17:03 -0800)]
ofctrl: Fix warning from sparse.

We've used sparse "bitwise" annotations to make ofp_ports into a different
type, so this is required to avoid a sparse warning.

Fixes: 714651c7db6a ("ovn-controller: Introduce "inject-pkt" ovs-appctl command.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoofctrl: Fix version check in ofctrl_inject_packet().
Ben Pfaff [Fri, 6 Jan 2017 01:03:05 +0000 (17:03 -0800)]
ofctrl: Fix version check in ofctrl_inject_packet().

"enum ofp_version" is unsigned in the System V ABI used by Linux, so
it will never be less than 0, so an rconn with an unnegotiated version will
never be found properly.  This fixes the problem.

Fixes: 714651c7db6a ("ovn-controller: Introduce "inject-pkt" ovs-appctl command.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoovs-ofctl: Document the "clone" action.
Ben Pfaff [Thu, 5 Jan 2017 23:50:06 +0000 (15:50 -0800)]
ovs-ofctl: Document the "clone" action.

This was overlooked when "clone" was introduced.

Fixes: 7ae62a676d3a ("ofp-actions: Add clone action.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agonetdev-dpdk: Add support for virtual DPDK PMDs (vdevs)
Ciara Loftus [Thu, 5 Jan 2017 10:42:10 +0000 (10:42 +0000)]
netdev-dpdk: Add support for virtual DPDK PMDs (vdevs)

Prior to this commit, the 'dpdk' port type could only be used for
physical DPDK devices. Now, virtual devices (or 'vdevs') are supported.
'vdev' devices are those which use virtual DPDK Poll Mode Drivers eg.
null, pcap. To add a DPDK vdev, a valid 'dpdk-devargs' must be set for
the given dpdk port. The format expected is 'eth_<driver_name><x>' where
'x' is a number between 0 and RTE_MAX_ETHPORTS -1.

For example to add a port that uses the 'null' DPDK PMD driver:

ovs-vsctl set Interface null0 options:dpdk-devargs=eth_null0

Not all DPDK vdevs have been verified to work at this point in time.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru> # docs only
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: Arbitrary 'dpdk' port naming
Ciara Loftus [Thu, 5 Jan 2017 10:42:09 +0000 (10:42 +0000)]
netdev-dpdk: Arbitrary 'dpdk' port naming

'dpdk' ports no longer have naming restrictions. Now, instead of
specifying the dpdk port ID as part of the name, the PCI address of the
device must be specified via the 'dpdk-devargs' option. eg.

ovs-vsctl add-port br0 my-port
ovs-vsctl set Interface my-port type=dpdk
  options:dpdk-devargs=0000:06:00.3

The user must no longer hotplug attach DPDK ports by issuing the
specific ovs-appctl netdev-dpdk/attach command. The hotplug is now
automatically invoked when a valid PCI address is set in the
dpdk-devargs. The format for ovs-appctl netdev-dpdk/detach command
has changed in that the user now must specify the relevant PCI address
as input instead of the port name.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Co-authored-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Stephen Finucane <stephen@that.guru> # docs only
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agonetdev-dpdk: add hotplug support
Mauricio Vásquez [Thu, 5 Jan 2017 10:42:08 +0000 (10:42 +0000)]
netdev-dpdk: add hotplug support

In order to use dpdk ports in ovs they have to be bound to a DPDK
compatible driver before ovs is started.

This patch adds the possibility to hotplug (or hot-unplug) a device
after ovs has been started. The implementation adds two appctl commands:
netdev-dpdk/attach and netdev-dpdk/detach

After the user attaches a new device, it has to be added to a bridge
using the add-port command, similarly, before detaching a device,
it has to be removed using the del-port command.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Co-authored-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Stephen Finucane <stephen@that.guru> # docs only
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodocs: Fix formatting of patch comments line.
Joe Stringer [Wed, 4 Jan 2017 21:58:00 +0000 (13:58 -0800)]
docs: Fix formatting of patch comments line.

Sphinx was formatting the `---` as an extended dash, not verbatim as
three hyphens (which is what is necessary for git to determine that it's
a comment, and ignore it when applying the patch).

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
7 years agoovs-ofctl.8: Document automatic helper assignment.
Joe Stringer [Tue, 3 Jan 2017 18:16:05 +0000 (10:16 -0800)]
ovs-ofctl.8: Document automatic helper assignment.

Due to upstream Linux feature "automatic helper assignment", up until
recently when using ct() action with FTP traffic, it has not been
necessary to specify the ALG parameter. However, automatic helper
assignment was disabled in Linux 4.7 or later, in upstream commit
3bb398d925ec ("netfilter: nf_ct_helper: disable automatic helper
assignment"). Document the need for this.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
7 years agoofproto-dpif: Break trace functionality into a separate source file.
Ben Pfaff [Tue, 6 Dec 2016 22:11:15 +0000 (14:11 -0800)]
ofproto-dpif: Break trace functionality into a separate source file.

An upcoming commit will rewrite much of the ofproto/trace functionality.
As the mechanism behind this grows and evolves, it makes sense to move it
into its own file, especially since ofproto-dpif.c is too big anyway.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoofproto-dpif: Unhide structure contents.
Ben Pfaff [Tue, 6 Dec 2016 22:08:42 +0000 (14:08 -0800)]
ofproto-dpif: Unhide structure contents.

Until now, ofproto-dpif.c has hidden the definitions of several structures,
such as struct ofproto_dpif and struct rule_dpif.  This kind of information
hiding is often beneficial, because it forces code outside the file with
the definition to use the documented interfaces.  However, in this case it
was starting to burden ofproto-dpif with an increasing number of trivial
helpers that were not improving or maintaining a useful abstraction and
that were making code harder to maintain and read.

Information hiding also made it hard to move blocks of code outside
ofproto-dpif.c itself, since any code moved out often needed new helpers if
it used anything that wasn't previously exposed.  In the present instance,
upcoming patches will move code for tracing outside ofproto-dpif, and this
would require adding several helpers that would just obscure the function
of the code otherwise needlessly.

In balance, it seems that there is more harm than good in the information
hiding here, so this commit moves the definitions of several structures
from ofproto-dpif.c into ofproto-dpif.h.  It also removes all of the
trivial helpers that had accumulated, instead changing their users to
directly access the members that they needed.  It also reorganizes
ofproto-dpif.h, grouping structure definitions and function prototypes in a
sensible way.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoovn.at: Rewrite a test using ovn-controller 'inject-pkt' command.
Justin Pettit [Thu, 5 Jan 2017 01:50:39 +0000 (17:50 -0800)]
ovn.at: Rewrite a test using ovn-controller 'inject-pkt' command.

Provide an example of using ovn-controller 'inject-pkt' and ovn-test
'expr-to-packets' commands to generate and verify proper handling of
packets.  Tests written in this way should be easier to understand than
raw packets written in hexadecimal.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-test: Add 'expr-to-packets' command.
Justin Pettit [Thu, 5 Jan 2017 01:50:26 +0000 (17:50 -0800)]
ovn-test: Add 'expr-to-packets' command.

Parses OVN expressions from stdin and prints out matching packets in
hexadecimal on stdout.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Introduce "inject-pkt" ovs-appctl command.
Justin Pettit [Sat, 24 Dec 2016 00:34:48 +0000 (16:34 -0800)]
ovn-controller: Introduce "inject-pkt" ovs-appctl command.

Add the ability to inject a packet into the connected Open vSwitch
instance.  This is primarily useful for testing when a test requires
side-effects from an actual packet, so ovn-trace won't do.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-macros: Quote "$@".
Justin Pettit [Tue, 27 Dec 2016 09:32:17 +0000 (01:32 -0800)]
ofproto-macros: Quote "$@".

Quote "$@" so that arguments aren't split when being called.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-sim: Quote "$@".
Justin Pettit [Wed, 4 Jan 2017 23:36:29 +0000 (15:36 -0800)]
ovs-sim: Quote "$@".

Quote "$@" so that arguments aren't split when being called.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoflow: Fix small typo in comment describing flow_compose().
Justin Pettit [Tue, 27 Dec 2016 00:08:25 +0000 (16:08 -0800)]
flow: Fix small typo in comment describing flow_compose().

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Remove "_p" from pointer arguments in lflow.c.
Justin Pettit [Sat, 24 Dec 2016 07:15:01 +0000 (23:15 -0800)]
ovn-controller: Remove "_p" from pointer arguments in lflow.c.

This more closely follows our coding standards.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Expose address sets to the main loop.
Justin Pettit [Thu, 22 Dec 2016 02:19:48 +0000 (18:19 -0800)]
ovn-controller: Expose address sets to the main loop.

Other functions in the main loop will need access to address sets in a
future commit.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoexpr: Rename "macros" to "addr_sets".
Justin Pettit [Wed, 21 Dec 2016 23:40:20 +0000 (15:40 -0800)]
expr: Rename "macros" to "addr_sets".

Macro is a very generic term, but the arguments are only ever address
sets, so rename for clarity.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-data: Add support for integer ranges in database commands
Lukasz Rzasik [Thu, 29 Dec 2016 22:55:46 +0000 (15:55 -0700)]
ovsdb-data: Add support for integer ranges in database commands

Adding / removing a range of integers to a column accepting a set of
integers requires enumarating all of the integers. This patch simplifies
it by introducing 'range' concept to the database commands. Two integers
separated by a hyphen represent an inclusive range.

The patch adds positive and negative tests for the new syntax.
The patch was tested by 'make check'. Covarage was tested by
'make check-lcov'.

Signed-off-by: Lukasz Rzasik <lukasz.rzasik@gmail.com>
Suggested-by: <my_ovs_discuss@yahoo.com>
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-ctl: add support for SSL nb/sb db connections
Lance Richardson [Tue, 3 Jan 2017 18:29:10 +0000 (13:29 -0500)]
ovn-ctl: add support for SSL nb/sb db connections

Add support for SSL connections to OVN northbound and/or
southbound databases.

To improve security, the NB and SB ovsdb daemons no longer
have open ptcp connections by default.  This is a change in
behavior from previous versions, users wishing to use TCP
connections to the NB/SB daemons can either request that
a passive TCP connection be used via ovn-ctl command-line
options (e.g. via OVN_CTL_OPTS/OVN_NORTHD_OPTS in startup
scripts):

    --db-sb-create-insecure-remote=yes
    --db-nb-create-insecure-remote=yes

Or configure a connection after the NB/SB daemons have been
started, e.g.:

    ovn-sbctl set-connection ptcp:6642
    ovn-nbctl set-connection ptcp:6641

Users desiring SSL database connections will need to generate certificates
and private key as described in INSTALL.SSL.rst and perform the following
one-time configuration steps:

   ovn-sbctl set-ssl <private-key> <certificate> <ca-cert>
   ovn-sbctl set-connection pssl:6642
   ovn-nbctl set-ssl <private-key> <certificate> <ca-cert>
   ovn-nbctl set-connection pssl:6641

On the ovn-controller and ovn-controller-vtep side, SSL configuration
must be provided on the command-line when the daemons are started, this
should be provided via the following command-line options (e.g. via
OVN_CTL_OPTS/OVN_CONTROLLER_OPTS in startup scripts):

   --ovn-controller-ssl-key=<private-key>
   --ovn-controller-ssl-cert=<certificate>
   --ovn-controller-ssl-ca-cert=<ca-cert>

The SB database connection should also be configured to use SSL, e.g.:

    ovs-vsctl set Open_vSwitch . \
              external-ids:ovn-remote=ssl:w.x.y.z:6642

Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoutil: Remove obsolete comment.
Ben Pfaff [Wed, 4 Jan 2017 17:23:54 +0000 (09:23 -0800)]
util: Remove obsolete comment.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Simon Horman <simon.horman@netronome.com>
7 years agoofproto: Fix crash on flow monitor request with tun_metadata.
Daniele Di Proietto [Wed, 28 Dec 2016 03:02:23 +0000 (19:02 -0800)]
ofproto: Fix crash on flow monitor request with tun_metadata.

nx_put_match() needs a non-NULL tunnel metadata table, otherwise it will
crash if a flow matches on tunnel metadata.

This wasn't handled in ofputil_append_flow_update(), causing a crash
when the controller sent a flow monitor request.

To fix the problem, this commit changes ofputil_append_flow_update() to
behave like ofputil_append_flow_stats_reply().
Since ofputil_append_flow_update() now needs to temporarily modify the
match, this commits also embeds 'struct match' into 'struct
ofputil_flow_update', to be safer.  This is more similar to
'struct ofputil_flow_stats'.

A regression test is added and a comment is updated in ovs-ofctl.c

 #0  0x000055699bd82fa0 in memcpy_from_metadata (dst=0x7ffc770930d0, src=0x7ffc77093698, loc=0x18) at ../lib/tun-metadata.c:451
 #1  0x000055699bd83c2e in metadata_loc_from_match_read (map=0x0, match=0x7ffc77093410, idx=0, mask=0x7ffc77093658, is_masked=0x7ffc77093287) at ../lib/tun-metadata.c:848
 #2  0x000055699bd83d9b in tun_metadata_to_nx_match (b=0x55699d3f0300, oxm=0, match=0x7ffc77093410) at ../lib/tun-metadata.c:871
 #3  0x000055699bce523d in nx_put_raw (b=0x55699d3f0300, oxm=0, match=0x7ffc77093410, cookie=0, cookie_mask=0) at ../lib/nx-match.c:1052
 #4  0x000055699bce5580 in nx_put_match (b=0x55699d3f0300, match=0x7ffc77093410, cookie=0, cookie_mask=0) at ../lib/nx-match.c:1116
 #5  0x000055699bd3926f in ofputil_append_flow_update (update=0x7ffc770940b0, replies=0x7ffc77094e00) at ../lib/ofp-util.c:6805
 #6  0x000055699bc4b5a9 in ofproto_compose_flow_refresh_update (rule=0x55699d405b40, flags=(NXFMF_INITIAL | NXFMF_ACTIONS), msgs=0x7ffc77094e00) at ../ofproto/ofproto.c:5915
 #7  0x000055699bc4b5f6 in ofmonitor_compose_refresh_updates (rules=0x7ffc77094e10, msgs=0x7ffc77094e00) at ../ofproto/ofproto.c:5929
 #8  0x000055699bc4bafc in handle_flow_monitor_request (ofconn=0x55699d404090, oh=0x55699d404220) at ../ofproto/ofproto.c:6082
 #9  0x000055699bc4f46d in handle_openflow__ (ofconn=0x55699d404090, msg=0x55699d404910) at ../ofproto/ofproto.c:7912
 #10 0x000055699bc4f5df in handle_openflow (ofconn=0x55699d404090, ofp_msg=0x55699d404910) at ../ofproto/ofproto.c:8002
 #11 0x000055699bc88154 in ofconn_run (ofconn=0x55699d404090, handle_openflow=0x55699bc4f5bc <handle_openflow>) at ../ofproto/connmgr.c:1427
 #12 0x000055699bc85934 in connmgr_run (mgr=0x55699d3adb90, handle_openflow=0x55699bc4f5bc <handle_openflow>) at ../ofproto/connmgr.c:363
 #13 0x000055699bc422c9 in ofproto_run (p=0x55699d3c85e0) at ../ofproto/ofproto.c:1798
 #14 0x000055699bc31ec6 in bridge_run__ () at ../vswitchd/bridge.c:2881
 #15 0x000055699bc320a6 in bridge_run () at ../vswitchd/bridge.c:2938
 #16 0x000055699bc3784e in main (argc=10, argv=0x7ffc770952c8) at ../vswitchd/ovs-vswitchd.c:111

Fixes: 8d8ab6c2d574 ("tun-metadata: Manage tunnel TLV mapping table on a
per-bridge basis.")

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agonetdev-dpdk: Rename ivshmem structures.
Kevin Traynor [Tue, 3 Jan 2017 18:21:29 +0000 (18:21 +0000)]
netdev-dpdk: Rename ivshmem structures.

Rename some structures that call themselves ivshmem,
as they are just a collection of dpdk rings and other
information.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agodoc: Remove ivshmem instructions.
Kevin Traynor [Tue, 3 Jan 2017 18:21:28 +0000 (18:21 +0000)]
doc: Remove ivshmem instructions.

ivshmem is a path to the guest using DPDK rings that was
introduced before userspace vhost was available in the OVS-DPDK
datapath. ivshmem is external to OVS but the scheme of using it
with DPDK rings is documented.

Remove ivshmem instruction documentation because:

- The ivshmem library has been removed in DPDK since DPDK 16.11.
- The instructions/scheme provided will not work with current
  supported and future DPDK versions.
- The linked patch needed to enable support in QEMU has never
  been upstreamed and does not apply to the last 4 QEMU releases.
- Userspace vhost has become the defacto OVS-DPDK path to the guest.

Fixes: 04de404e1bfa ("netdev-dpdk: Add support for DPDK 16.11")
Cc: Ciara Loftus <ciara.loftus@intel.com>
Cc: Stephen Finucane <stephen@that.guru>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Stephen Finucane <stephen@that.guru>
Acked-by: Mauricio Vasquez B <mauricio.vasquez@polito.it>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoodp: Use struct in6_addr for IPv6 addresses.
Jarno Rajahalme [Thu, 5 Jan 2017 00:10:56 +0000 (16:10 -0800)]
odp: Use struct in6_addr for IPv6 addresses.

Code is simplified when the ODP keys use the same type as the struct
flow for the IPv6 addresses.  As the change is facilitated by
extract-odp-netlink-h, this change only affects the userspace.  We
already do the same for the ethernet addresses.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-parse: Allow match field names in actions and brackets in matches.
Jarno Rajahalme [Thu, 5 Jan 2017 00:10:56 +0000 (16:10 -0800)]
ofp-parse: Allow match field names in actions and brackets in matches.

Allow using match field names in addition to the canonical register
names in actions (including 'load', 'move', 'push', 'pop', 'output',
'multipath', 'bundle_load', and 'learn').  Allow also leaving out the
trailing '[]' to indicate full field.  These changes allow simpler
syntax similar to 'set_field' to be used also elsewhere.

Correspondingly, allow the '[start..end]' syntax to be used in matches
in addition to the more explicit 'value/mask' notation.  For example,
to match on the value 2 of the bits 14..15 of NXM_NX_REG0, the match
could include:

... reg0[14..15]=2 ...

instead of

... reg0=0x8000/0xc000 ...

Note that only contiguous masks can be specified with the bracket
notation.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Add TCP/SSL probes for OVSDB python lib
Guoshuai Li [Sun, 1 Jan 2017 11:04:55 +0000 (19:04 +0800)]
python: Add TCP/SSL probes for OVSDB python lib

stream_or_pstream_needs_probes always return 0. This causes TCP/SSL
connection not be probed, and no reconnect when the connection
is aborted

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: WDK 10 Iphelper rename local variables
Alin Serdean [Thu, 29 Dec 2016 00:35:29 +0000 (00:35 +0000)]
datapath-windows: WDK 10 Iphelper rename local variables

Compiling under WDK 10 triggers some warnings in IpHelper, which lead
to a failing build.

The root cause is that local variables `ipAddr` and `link` hide the previous
local declaration.

This patch just renames the variables.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-sbctl: enable listing dhcp options tables
Lance Richardson [Tue, 3 Jan 2017 21:47:48 +0000 (16:47 -0500)]
ovn-sbctl: enable listing dhcp options tables

Enable operations (including "list") on DHCP_Options and DHCPv6_Options
tables via ovn-sbctl. These are currently the only OVN_Southbound
tables that ovn-sbctl does not support.

Example:
    $ ovn-sbctl -f table list DHCPv6_Options
    _uuid                                code name          type
    ------------------------------------ ---- ------------- ------
    8646bb15-5e88-4432-a21a-4e22a2976482 23   dns_server    "ipv6"
    564e98e9-ee23-447b-a7c5-c36ca05059fa 24   domain_search str
    8c6cb059-5bb5-4ef8-960b-f002c769589e 2    server_id     mac
    525e8fc6-7921-48eb-8bd3-fe5cb5dd0142 5    ia_addr       "ipv6"

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Don't limit ourselves to flake8 2.x
Stephen Finucane [Wed, 4 Jan 2017 16:53:54 +0000 (16:53 +0000)]
doc: Don't limit ourselves to flake8 2.x

There was a bug when using hacking with flake8 3.x. This bug has since
been resolved [1], meaning we no longer need to call out the need to use
the older version of flake8.

[1] https://review.openstack.org/#/c/335965/

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-thread: Avoid pthread_rwlockattr_t on Windows.
Alin Serdean [Wed, 28 Dec 2016 22:27:17 +0000 (22:27 +0000)]
ovs-thread: Avoid pthread_rwlockattr_t on Windows.

A recent commit fixed ovs_rwlock_init() to pass the pthread_rwlockattr_t
that it initialized to pthread_rwlock_init().  According to POSIX
documentation this is correct, but on Windows the current implementation of
pthreads does not support a pre-initialized attribute.  Please see a fork
of the implementation
https://github.com/GerHobbelt/pthread-win32/blob/19fd5054b29af1b4e3b3278bfffbb6274c6c89f5/pthread_rwlock_init.c#L59-L63
This is the same implementation as the official version found under:
ftp://sourceware.org/pub/pthreads-win32/)

A short debug output from `vswitch` to confirm the above:

>k
 Index  Function
--------------------------------------------------------------------------------
*1      ovs-vswitchd.exe!ovs_rwlock_init(const ovs_rwlock * l_=0x000001721c7da250)
 2      ovs-vswitchd.exe!open_dpif_backer(const char * type=0x000001721c7d8d60, dpif_backer * * backerp=0x000001721c7d89c0)
 3      ovs-vswitchd.exe!construct(ofproto * ofproto_=0x000001721c7d87d0)
 4      ovs-vswitchd.exe!ofproto_create(const char * datapath_name=0x000001721c7d86e0, const char * datapath_type=0x000001721c7d8750, ofproto * * ofprotop=0x000001721c7d80b8)
 5      ovs-vswitchd.exe!bridge_reconfigure(const ovsrec_open_vswitch * ovs_cfg=0x000001721c7e05b0)
 6      ovs-vswitchd.exe!bridge_run()
 7      ovs-vswitchd.exe!main(int argc=6, char * * argv=0x000001721c729e10)
 8      [External Code]

>? error
22
https://github.com/openvswitch/ovs/blob/master/lib/ovs-thread.c#L243

This patch is critical because the majority (over 800) of the unit tests
are failing.

Fixes: 1a15f390afd6 ("lib/ovs-thread: set prefer writer lock for ovs_rwlock_init()")
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Shashank Ram <rams@vmware.com>
[blp@ovn.org changed the details of the approach]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotravis: Install python-sphinx
Stephen Finucane [Wed, 4 Jan 2017 16:46:40 +0000 (16:46 +0000)]
travis: Install python-sphinx

This will ensure the recently added 'check-docs' target will get run as
part of Travis.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agomake: Standardize indentation
Stephen Finucane [Mon, 2 Jan 2017 11:47:42 +0000 (11:47 +0000)]
make: Standardize indentation

If we're going to mix tabs and spaces, let's do it consistently.

Signed-off-by: Stephen Finucane <stephen@that.guru>
[blp@ovn.org reformatted the flake8-check commands]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agomake: Check for Sphinx before checking docs
Stephen Finucane [Mon, 2 Jan 2017 11:47:40 +0000 (11:47 +0000)]
make: Check for Sphinx before checking docs

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agomake: Add distinct clean-docs target
Stephen Finucane [Mon, 2 Jan 2017 11:47:39 +0000 (11:47 +0000)]
make: Add distinct clean-docs target

Speed things up by not rebuilding documents every time.

Signed-off-by: Stephen Finucane <stephen@that.guru>
[blp@ovn.org eliminated "rm -rf $(var)/*" syntax]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agomake: Validate documents on build
Stephen Finucane [Mon, 2 Jan 2017 11:47:38 +0000 (11:47 +0000)]
make: Validate documents on build

Build documentation as part of every build. This ensures any syntax
errors are caught early.

In addition, a 'check-docs' target is added to validates all external
links.

The nitpick ('-n') flag is added to ensure all possible warnings are
raised.

Signed-off-by: Stephen Finucane <stephen@that.guru>
[blp@ovn.org folded in changes for --enable-silent-rules]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add missing ':'
Stephen Finucane [Tue, 3 Jan 2017 21:32:51 +0000 (21:32 +0000)]
doc: Add missing ':'

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Use ovs theme
Stephen Finucane [Tue, 3 Jan 2017 21:33:05 +0000 (21:33 +0000)]
doc: Use ovs theme

The recently published 'ovs' theme [1] copies the styling of the Open
vSwitch website. Start using this, with fallbacks for users who do not
have the package installed.

This extends support for building docs to users of Sphinx 1.2 as the
previous theme - bizstyle - was only available in 1.3+.

[1] https://pypi.python.org/pypi/ovs-sphinx-theme

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoappveyor.yml: Install python "pypiwin32" module.
Alin Serdean [Wed, 4 Jan 2017 09:56:23 +0000 (09:56 +0000)]
appveyor.yml: Install python "pypiwin32" module.

pypiwin32 is now required for the build.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>