]> git.proxmox.com Git - ovs.git/log
ovs.git
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>
7 years agonetdev-dpdk: Enable Rx checksum offloading feature on DPDK physical ports.
Sugesh Chandran [Mon, 2 Jan 2017 22:27:48 +0000 (14:27 -0800)]
netdev-dpdk: Enable Rx checksum offloading feature on DPDK physical ports.

Add Rx checksum offloading feature support on DPDK physical ports. By default,
the Rx checksum offloading is enabled if NIC supports. However,
the checksum offloading can be turned OFF either while adding a new DPDK
physical port to OVS or at runtime.

The rx checksum offloading can be turned off by setting the parameter to
'false'. For eg: To disable the rx checksum offloading when adding a port,

     'ovs-vsctl add-port br0 dpdk0 -- \
      set Interface dpdk0 type=dpdk options:rx-checksum-offload=false'

OR (to disable at run time after port is being added to OVS)

    'ovs-vsctl set Interface dpdk0 options:rx-checksum-offload=false'

Similarly to turn ON rx checksum offloading at run time,
    'ovs-vsctl set Interface dpdk0 options:rx-checksum-offload=true'

The Tx checksum offloading support is not implemented due to the following
reasons.

1) Checksum offloading and vectorization are mutually exclusive in DPDK poll
mode driver. Vector packet processing is turned OFF when checksum offloading
is enabled which causes significant performance drop at Tx side.

2) Normally, OVS generates checksum for tunnel packets in software at the
'tunnel push' operation, where the tunnel headers are created. However
enabling Tx checksum offloading involves,

*) Mark every packets for tx checksum offloading at 'tunnel_push' and
recirculate.
*) At the time of xmit, validate the same flag and instruct the NIC to do the
checksum calculation.  In case NIC doesnt support Tx checksum offloading,
the checksum calculation has to be done in software before sending out the
packets.

No significant performance improvement noticed with Tx checksum offloading
due to the e overhead of additional validations + non vector packet processing.
In some test scenarios, it introduces performance drop too.

Rx checksum offloading still offers 8-9% of improvement on VxLAN tunneling
decapsulation even though the SSE vector Rx function is disabled in DPDK poll
mode driver.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Acked-by: Jesse Gross <jesse@kernel.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
7 years agodatapath-windows: Add Windows 10 family to solution
Alin Gabriel Serdean [Thu, 29 Dec 2016 00:04:29 +0000 (02:04 +0200)]
datapath-windows: Add Windows 10 family to solution

This patch adds two more compiling targets:
  - one for Windows 10 release
  - one for Windows 10 Debug

The new targets are flagged properly to use the new Windows 10 kernel mode
driver and its toolchain.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agoPython tests: Enable python tests on Windows
Alin Balutoiu [Tue, 3 Jan 2017 20:10:54 +0000 (20:10 +0000)]
Python tests: Enable python tests on Windows

Updated the Readme with additional library required for
the python tests.

Remove the code which disable python tests to
be run on Windows.

Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoPython tests: Set CREATE_NO_WINDOW flag for Popen
Alin Balutoiu [Tue, 3 Jan 2017 20:10:53 +0000 (20:10 +0000)]
Python tests: Set CREATE_NO_WINDOW flag for Popen

On Windows if the flag CREATE_NO_WINDOW is not
specified when using subprocess.Popen, a new
window will appear with the new process.

The window is not necessary for the tests.
This patch addresses this issue by adding
the flag CREATE_NO_WINDOW for all subprocess.Popen
calls if the machine is running Windows.

Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoPython tests: Daemon ported to Windows
Alin Balutoiu [Tue, 3 Jan 2017 20:10:52 +0000 (20:10 +0000)]
Python tests: Daemon ported to Windows

Instead of using os.fork (not supported on Windows),
subprocess.Popen is used and os.pipe was replaced
with Windows pipes.

To be able to identify the child process, an extra
parameter was added to daemon process '--pipe-handle'.
This parameter contains the parent Windows pipe handle
which is used by the child to notify the parent about
the startup.

The PID file is created directly on Windows, without
using a temporary file because the symbolic link does
not inherit the file lok set on the temporary file.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoPython tests: Ported UNIX sockets to Windows
Alin Balutoiu [Tue, 3 Jan 2017 20:10:51 +0000 (20:10 +0000)]
Python tests: Ported UNIX sockets to Windows

Unix sockets (AF_UNIX) are not supported on Windows.
The replacement of Unix sockets on Windows is implemented
using named pipes, we are trying to mimic the behaviour
of unix sockets.

Instead of using Unix sockets to communicate
between components Named Pipes are used. This
makes the python sockets compatible with the
Named Pipe used in Windows applications.

Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoPython tests: Add winutils.py module
Alin Balutoiu [Tue, 3 Jan 2017 20:10:49 +0000 (20:10 +0000)]
Python tests: Add winutils.py module

This patch adds a new python module which contains
helper functions. These will be neccessary for the
Windows implementation.

They cover the following aspects: sockets and namedpipes.

Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agotest-l7.py: Tidy up and python3-ify.
Joe Stringer [Thu, 22 Dec 2016 18:58:26 +0000 (10:58 -0800)]
test-l7.py: Tidy up and python3-ify.

Haul test-l7.py into the 202nd decade by supporting python3.

TFTPY still doesn't support python3, so work around this by handling
import syntax errors so that even if tftpy is installed in a python3
environment, test-l7.py will not throw an exception while attempting to
load it.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agolib: Add support for tftp ct helper.
Joe Stringer [Thu, 22 Dec 2016 18:58:25 +0000 (10:58 -0800)]
lib: Add support for tftp ct helper.

The kernel datapath provides support for TFTP helpers, so add support
for this ALG to the commandline and OpenFlow encoding/decoding.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodocs: Add FAQ to the main page.
Joe Stringer [Thu, 22 Dec 2016 19:24:16 +0000 (11:24 -0800)]
docs: Add FAQ to the main page.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Stephen Finucane <stephen@that.guru>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoatlocal: Fix findcommand function style.
Joe Stringer [Thu, 22 Dec 2016 18:44:53 +0000 (10:44 -0800)]
atlocal: Fix findcommand function style.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Conntrack disable type truncation warning
Alin Serdean [Thu, 29 Dec 2016 00:25:34 +0000 (00:25 +0000)]
datapath-windows: Conntrack disable type truncation warning

Compiling with the WDK 10 gave the following warning:
Warning C4311 'type cast': pointer truncation from 'POVS_CT_ENTRY' to 'UINT32'
ovsext (OVSExt\ovsext) Conntrack.c 1139

This patch disables the warning on the file Conntrack.c.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoOVN-HA: Fix data loss after OVNDB promotion
Guoshuai Li [Thu, 29 Dec 2016 15:47:58 +0000 (23:47 +0800)]
OVN-HA: Fix data loss after OVNDB promotion

When master node shuts down, both VIP and OVNDB Master are expected
to be moved over to the backup node.

However, the VIP must be started after the OVNDB has been promoted.
Otherwise, the database content can be whipped out, since the OVSDB
running in the backup state can reconnect to the VIP that just moved
over, thus removing the database content.

See also: http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html/
Pacemaker_Explained/s-resource-ordering.html

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agoovn-trace: New --ovs option to also print OpenFlow flows.
Ben Pfaff [Wed, 28 Dec 2016 17:31:42 +0000 (09:31 -0800)]
ovn-trace: New --ovs option to also print OpenFlow flows.

Sometimes seeing the OpenFlow flows that back a given logical flow can
provide additional insight.  This commit adds a new --ovs option to
ovn-trace that makes it connect to Open vSwitch over OpenFlow and retrieve
and print the OpenFlow flows behind each logical flow encountered during
a trace.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoovn-controller: Tie OpenFlow and logical flows using OpenFlow cookie.
Ben Pfaff [Wed, 28 Dec 2016 17:17:51 +0000 (09:17 -0800)]
ovn-controller: Tie OpenFlow and logical flows using OpenFlow cookie.

This makes it easy to find the logical flow that generated a particular
OpenFlow flow, by running "ovn-sbctl dump-flows <cookie>".

Later, this can be refined (and automated for "ofproto/trace"), but this
is still a significant advance.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoovs-advanced.rst: Add missing \ to a few examples.
Ben Pfaff [Wed, 21 Dec 2016 01:06:49 +0000 (17:06 -0800)]
ovs-advanced.rst: Add missing \ to a few examples.

This makes these examples easier to cut and paste into a terminal, and
makes them consistent with the other examples.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoconntrack: Do not create new connections from ICMP errors.
Daniele Di Proietto [Mon, 19 Dec 2016 22:03:58 +0000 (14:03 -0800)]
conntrack: Do not create new connections from ICMP errors.

ICMP error packets (e.g. destination unreachable messages) are
considered 'related' to another connection and are treated as part of
that.

However:

* We shouldn't create new entries in the connection table if the
  original connection is not found.  This is consistent with what the
  kernel does.
* We certainly shouldn't call valid_new() on the packet, because
  valid_new() assumes the packet l4 type (might be TCP, UDP or ICMP)
  to be consistent with the conn_key nw_proto type.

Found by inspection.

Fixes: a489b16854b5("conntrack: New userspace connection tracker.")
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Darrell Ball <dlu998@gmail.com>
7 years agodocs: Resolve broken URLs
Stephen Finucane [Fri, 23 Dec 2016 23:04:11 +0000 (23:04 +0000)]
docs: Resolve broken URLs

These were found using the 'linkcheck' builder.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Cc: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agopackets: Simplify packet_csum_pseudoheader6().
Ben Pfaff [Fri, 23 Dec 2016 17:06:39 +0000 (09:06 -0800)]
packets: Simplify packet_csum_pseudoheader6().

It's simpler to make two calls than eight.

Reported-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agodebian: Also restrict ovn-docker package to Linux.
Ben Pfaff [Fri, 23 Dec 2016 21:45:00 +0000 (13:45 -0800)]
debian: Also restrict ovn-docker package to Linux.

The Debian packages for OVS have only supported Linux so far, but the
ovn-docker package was mistakenly marked as Architecture: any instead
of linux-any, which caused build failures.  This fixes the problem.

(Perhaps OVS packaging for Debian should also support BSD, but that
would be a bigger change.)

Reported-at: https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=kfreebsd-amd64&ver=2.6.2%7Epre%2Bgit20161223-1&stamp=1482518318&file=log
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agotests: Fix race in "ovn -- vtep: 3 HVs, 1 VIFs/HV, 1 GW, 1 LS".
Ben Pfaff [Fri, 23 Dec 2016 21:33:50 +0000 (13:33 -0800)]
tests: Fix race in "ovn -- vtep: 3 HVs, 1 VIFs/HV, 1 GW, 1 LS".

The 1-second sleep to wait for the bind to occur is not long enough on
slow mips machines.  This fixes the problem.

Reported-at: https://buildd.debian.org/status/fetch.php?pkg=openvswitch&arch=mipsel&ver=2.6.2%7Epre%2Bgit20161223-1&stamp=1482523419&file=log
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agorconn: Avoid abort for ill-behaved remote.
Ben Pfaff [Fri, 23 Dec 2016 17:23:43 +0000 (09:23 -0800)]
rconn: Avoid abort for ill-behaved remote.

If an rconn peer fails to send a hello message, the version number doesn't
get set.  Later, if the peer delays long enough, the rconn attempts to send
an echo request but assert-fails instead because it doesn't know what
version to use.  This fixes the problem.

To reproduce this problem:

    make sandbox
    ovs-vsctl add-br br0
    ovs-vsctl set-controller br0 ptcp:12345
    nc 127.0.0.1 12345

and wait 10 seconds for ovs-vswitchd to die.  (Then exit the sandbox.)

Reported-by: 张东亚 <fortitude.zhang@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
7 years agoopenvswitch: FTBFS with dpkg-buildpackage.
nickcooper-zhangtonghao [Mon, 19 Dec 2016 13:16:14 +0000 (05:16 -0800)]
openvswitch: FTBFS with dpkg-buildpackage.

The debian packages are ready. This patch fixes the
bug #831924 reported at debian bug tracking system.
With this patch, openvswitch-2.6.1 will be upload to
the Debian archive.  If we build the packages with
"dpkg-buildpackage --target binary-indep", an error
state arises. debian/rules should be modified so that
the build-indep and binary-indep target generates
the architecture independent packages. If there are
things not be handled properly,let me know.

Reported-at: https://people.debian.org/~lucas/logs/2016/07/20/openvswitch_2.5.1~pre+git20160626-2_unstable_archallonly.log
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-xlate: optimize 100% sampling
Benli Ye [Fri, 23 Dec 2016 05:58:01 +0000 (21:58 -0800)]
ofproto-dpif-xlate: optimize 100% sampling

For 100% sampling, no need to use sample action. Just use
userspace action for optimizing.

Signed-off-by: Benli Ye <daniely@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-xlate: optimize 0% sampling
Benli Ye [Fri, 23 Dec 2016 05:58:00 +0000 (21:58 -0800)]
ofproto-dpif-xlate: optimize 0% sampling

When sampling field is 0, no need to generate sample or
the inner action.

Signed-off-by: Benli Ye <daniely@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Correct type of highlighting
Stephen Finucane [Fri, 23 Dec 2016 11:46:29 +0000 (11:46 +0000)]
doc: Correct type of highlighting

Some recent changes marked code as Powershell when in fact it was DOS or
bash shell. This incorrect highlighting actually breaks the local build
(where warnings are treated as errors) as pygments is unable to lex all
the code as PowerShell. Fix these types.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: b8d24cc8a ("doc: Misc Windows doc formatting fixes")
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agolacp: Select a may-enable IF as the lead IF
Ben Pfaff [Wed, 21 Dec 2016 17:15:59 +0000 (09:15 -0800)]
lacp: Select a may-enable IF as the lead IF

A reboot of one switch in an MC-LAG bond makes all bond links
to go down, causing a total connectivity loss for 3 seconds.

Packet capture shows that spurious LACP PDUs are sent to OVS with
a different MAC address (partner system id) during the final
stages of the MC-LAG switch reboot.

The current code selects a lead interface based on information
in the LACP PDU, regardless of its synchronization state. If a
non-synchronized interface is selected as the OVS lead interface
then all other interfaces are forced down as their stored partner
system id differs and the bond ends up with no working interface.
The bond recovers within three seconds after the last spurious
message.

To avoid the problem, this commit requires a lead interface
to be synchronized. In case no synchronized interface exists,
the selection of lead interface is done as in the current code.

Signed-off-by: Torgny Lindberg <torgny.lindberg@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoodp-execute: Optimize IP header modification in OVS datapath
Zoltán Balogh [Tue, 13 Dec 2016 17:27:37 +0000 (17:27 +0000)]
odp-execute: Optimize IP header modification in OVS datapath

I measured the packet processing cost of OVS DPDK datapath for different
OpenFlow actions. I configured OVS to use a single pmd thread and
measured the packet throughput in a phy-to-phy setup. I used 10G
interfaces bounded to DPDK driver and overloaded the vSwitch with 64
byte packets through one of the 10G interfaces.

The processing cost of the dec_ttl action seemed to be gratuitously high
compared with other actions.

I looked into the code and saw that dec_ttl is encoded as a masked
nested attribute in OVS_ACTION_ATTR_SET_MASKED(OVS_KEY_ATTR_IPV4).
That way, OVS datapath can modify several IP header fields (TTL, TOS,
source and destination IP addresses) by a single invocation of
packet_set_ipv4() in the odp_set_ipv4() function in the
lib/odp-execute.c file. The packet_set_ipv4() function takes the new
TOS, TTL and IP addresses as arguments, compares them with the actual
ones and updates the fields if needed. This means, that even if only TTL
needs to be updated, each of the four IP header fields is passed to the
callee and is compared to the actual field for each packet.

The odp_set_ipv4() caller function possesses information about the
fields that need to be updated in the 'mask' structure. The idea is to
spare invocation of the packet_set_ipv4() function but use its code
parts directly. So the 'mask' can be used to decide which IP header
fields need to be updated. In addition, a faster packet processing can
be achieved if the values of local variables are
calculated right before their usage.

       | T | T | I | I |
       | T | O | P | P |  Vanilla OVS  ||  + new patch
       | L | S | s | d | (nsec/packet) || (nsec/packet)
-------+---+---+---+---+---------------++---------------
output |   |   |   |   |    67.19      ||    67.19
       | X |   |   |   |    74.48      ||    68.78
       |   | X |   |   |    74.42      ||    70.07
       |   |   | X |   |    84.62      ||    78.03
       |   |   |   | X |    84.25      ||    77.94
       |   |   | X | X |    97.46      ||    91.86
       | X |   | X | X |   100.42      ||    96.00
       | X | X | X | X |   102.80      ||   100.73

The table shows the average processing cost of packets in nanoseconds
for the following actions:
output; output + dec_ttl; output + mod_nw_tos; output + mod_nw_src;
output + mod_nw_dst and some of their combinations.
I ran each test five times. The values are the mean of the readings
obtained.

I added OVS_LIKELY to the 'if' condition for the TTL field, since as far
as I know, this field will typically be decremented when any field of
the IP header is modified.

Signed-off-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agolib/ovs-thread: set prefer writer lock for ovs_rwlock_init()
zangchuanqiang [Fri, 16 Dec 2016 02:28:11 +0000 (10:28 +0800)]
lib/ovs-thread: set prefer writer lock for ovs_rwlock_init()

An alternative "writer nonrecursive" rwlock allows recursive
read-locks to succeed only if there are no threads waiting for the
write-lock. In the function ovs_rwlock_init(), there exist a problem,
the parameter of 'attr' is not used to set the attributes of ovs_rwlock 'l_',
just because use pthread_rwlock_init(&l->lock, NULL) to init l->lock.

The attr object needs to be passed to the pthread_rwlock_init()
call in order to make use of it.

Signed-off-by: zangchuanqiang <zangchuanqiang@huawei.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agotable: correct documented default format in man pages
Lance Richardson [Thu, 22 Dec 2016 19:45:50 +0000 (14:45 -0500)]
table: correct documented default format in man pages

There are currently five users of the table formatting library,
all of which default to "list" except for ovsdb-client which
defaults to "table".  The library current default is "table",
and the table.man man page fragment only considers ovs-vsctl
to use something other than "table" as a default.As a result,
the man pages for ovn-sbctl and vtep-ctl are currently incorrect
(these options aren't documented in the ovn-nbctl man page, which
will need to be addressed in a future patch).

Fix by making the library default format "list" and handling
ovsdb-client as the exception.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoOVN: Fix OCF symbolic link lost after ovn-common upgrade
Guoshuai Li [Thu, 22 Dec 2016 09:52:36 +0000 (17:52 +0800)]
OVN: Fix OCF symbolic link lost after ovn-common upgrade

The directory "/usr/lib/ocf/resource.d/ovn/" can only be removed on
uninstall. It should not be removed when upgrading.

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Andy Zhou <azhou@ovn.org>
7 years agodoc: Minor formatting fixes to documentation-style
Stephen Finucane [Thu, 22 Dec 2016 09:54:47 +0000 (09:54 +0000)]
doc: Minor formatting fixes to documentation-style

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Recommend compressed PNG images where possible
Stephen Finucane [Thu, 22 Dec 2016 09:54:46 +0000 (09:54 +0000)]
doc: Recommend compressed PNG images where possible

ASCII images take up less space but are significantly less readable than
proper images.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add a 'what-is-ovs' document
Stephen Finucane [Thu, 22 Dec 2016 09:54:45 +0000 (09:54 +0000)]
doc: Add a 'what-is-ovs' document

Add description of Open vSwitch from README, along with the overview
image from openvswitch.org.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Document various language bindings
Stephen Finucane [Thu, 22 Dec 2016 09:54:44 +0000 (09:54 +0000)]
doc: Document various language bindings

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Misc fixes to 'bash-completion'
Stephen Finucane [Thu, 22 Dec 2016 09:54:43 +0000 (09:54 +0000)]
doc: Misc fixes to 'bash-completion'

Fix some minor formatting issues with this document.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add info on building documentation
Stephen Finucane [Thu, 22 Dec 2016 09:54:42 +0000 (09:54 +0000)]
doc: Add info on building documentation

I know how to do this, but does anyone else? Let's make it obvious and
ease the cognitive load on the great folks writing docs.

Links to the various packaging guides, previously missing, are included
on the main page.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agosystem-traffic: Reorder and bannerize ct tests.
Joe Stringer [Tue, 20 Dec 2016 21:28:28 +0000 (13:28 -0800)]
system-traffic: Reorder and bannerize ct tests.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agosystem-traffic: Add banners for ct sections.
Joe Stringer [Tue, 20 Dec 2016 21:28:27 +0000 (13:28 -0800)]
system-traffic: Add banners for ct sections.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agosystem-traffic: Wait for L7 servers to start.
Joe Stringer [Thu, 11 Aug 2016 18:19:16 +0000 (11:19 -0700)]
system-traffic: Wait for L7 servers to start.

Use OVS_WAIT_UNTIL() with netstat to ensure servers are listening before
sending requests to them.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agosystem-traffic: Introduce OVS_START_L7 macro.
Joe Stringer [Tue, 20 Dec 2016 21:28:25 +0000 (13:28 -0800)]
system-traffic: Introduce OVS_START_L7 macro.

All of the commands starting L7 servers duplicate detailed specifics
which inhibits readability, and makes it difficult to ensure that the
servers are ready before the test proceeds. Add a new macro that
provides simpler semantics from the test perspective and hide the
details in the macro. A followup patch will extend this macro to ensure
that servers are ready to serve requests before the test proceeds.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoofproto-dpif-xlate: Adding IGMP/MLD checksum verification
Eelco Chaudron [Wed, 14 Dec 2016 18:08:27 +0000 (19:08 +0100)]
ofproto-dpif-xlate: Adding IGMP/MLD checksum verification

When IGMP or MLD packets arrive their content is used without the checksum
being verified. With this change the checksum is verified, and the packet
is not used for multicast snooping on failure.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoroute-table: Stop netlink log message when routes withdrawn
Tony van der Peet [Wed, 14 Dec 2016 02:31:02 +0000 (15:31 +1300)]
route-table: Stop netlink log message when routes withdrawn

When a route is withdrawn (blackholed) the netlink message doesn't include
an RTA_OIF element. This results in an "unexpected netlink message
contents" log message because this element is not optional.

Given that the netlink message will be ignored anyway, and subsequent
error checking will cope with missing RTA_OIF, the element should be
optional in order to suppress unnecessary log messages.

Signed-off-by: Tony van der Peet <tony.vanderpeet@alliedtelesis.co.nz>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agolib/dpdk: No more deferred release
Aaron Conole [Fri, 9 Dec 2016 16:22:28 +0000 (11:22 -0500)]
lib/dpdk: No more deferred release

DPDK documentation is recently updated to reflect that DPDK does not
hold any references to, nor take ownership of, the argv/argc elements.
With that understanding, let's just release the memory asap.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
7 years agoovn-trace: Fix small error condition memory leak in trace().
Justin Pettit [Mon, 19 Dec 2016 22:50:50 +0000 (14:50 -0800)]
ovn-trace: Fix small error condition memory leak in trace().

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto-dpif-upcall: Remove OVS_UNUSED from upcall_unixctl_set_flow_limit() arg.
Justin Pettit [Mon, 19 Dec 2016 22:18:25 +0000 (14:18 -0800)]
ofproto-dpif-upcall: Remove OVS_UNUSED from upcall_unixctl_set_flow_limit() arg.

The 'argv' argument is used.

Signed-off-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agosystem-traffic: Fix clone test.
William Tu [Wed, 21 Dec 2016 22:22:01 +0000 (14:22 -0800)]
system-traffic: Fix clone test.

The existing clone test fails the system testsuite.  The patch provides
fix, removes the unused at_ns2, and uses "ovs-ofctl monitor" to validate
the packet contents after actions inside a clone.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agoUpdate netbsd install doc
Hui Kang [Tue, 20 Dec 2016 18:25:07 +0000 (13:25 -0500)]
Update netbsd install doc

- test ovs on netbsd 7.0.2
- use gmake to compile and install

Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agobuild-windows: Propagate PACKAGE_VERSION to the MSI
Alin Serdean [Tue, 6 Dec 2016 02:58:30 +0000 (02:58 +0000)]
build-windows: Propagate PACKAGE_VERSION to the MSI

This patch propagates the automake variable PACKAGE_VERSION when building
the MSI via msys.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agomsi-windows: Add version variable
Alin Serdean [Tue, 6 Dec 2016 02:58:30 +0000 (02:58 +0000)]
msi-windows: Add version variable

Currently we have a predefined variable for the product version.

This patch adds a new variable called 'Version' to the MSI project and
uses it for the product version.

If the variable is not specified via the command line it will have
the default value of '1.0.0.0'.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agobuild-windows: Propagate PACKAGE_VERSION to the driver files
Alin Serdean [Tue, 6 Dec 2016 02:58:30 +0000 (02:58 +0000)]
build-windows: Propagate PACKAGE_VERSION to the driver files

This patch propagates the automake value 'PACKAGE_VERSION' to the driver
specific information files, overwriting the Visual Studio default value of
Version, when building the driver via msys.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Force driver version to depend on a variable
Alin Serdean [Tue, 6 Dec 2016 02:58:30 +0000 (02:58 +0000)]
datapath-windows: Force driver version to depend on a variable

The following components use Windows driver information:
- System (inf file); used during device installation
- Resource file (rc file); used by applications when looking over the driver
    file(sys)

Currently we have the following for the driver version number:
- (inf file) generated value from the build timestamp
- (rc file) predefined value

This patch forces both files to depend on a variable: '$(Version)'.
This is a predefined variable from Visual Studio.

To achieve the above we change the current project settings used by the
'stampinf' utility and we define a new preprocessor value named
'VersionWithCommas' (which is obtained by replacing all
'.' with ',' from $(Version) ).
Certain values from the resource file are expected to use ',' instead of '.' .

The resource file has been updated to use the new values when generating
information about the driver (sys).

The variable '$(Version' can be changed from the command line via the
'msbuild' utility.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoDocumentation: fix some typos
Lance Richardson [Wed, 14 Dec 2016 21:37:16 +0000 (16:37 -0500)]
Documentation: fix some typos

s/deamon/daemon/
s/dependant/dependent/

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-northd: fix monitor process naming
Lance Richardson [Wed, 14 Dec 2016 16:16:53 +0000 (11:16 -0500)]
ovn-northd: fix monitor process naming

Currently the ovn-northd monitor process and the ovn-northd process
have the same name, e.g. ps -ef | grep northd shows (edited for space):

    ... ovn-northd --detach --monitor --log-file=ovn-northd.log --pidfile
    ... ovn-northd --detach --monitor --log-file=ovn-northd.log --pidfile

With the call to ovs_cmdl_proctitle_init() added, we have:

    ... ovn-northd: monitoring pid 15662 (healthy)
    ... ovn-northd --detach --monitor --log-file=ovn-northd.log --pidfile

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Fix function prototypes
Alin Serdean [Mon, 5 Dec 2016 15:39:56 +0000 (15:39 +0000)]
datapath-windows: Fix function prototypes

There is a mismatch between OvsInitCompletionList and OvsAddPktCompletionList
prototypes.

Eg:
https://github.com/openvswitch/ovs/blob/master/datapath-windows/ovsext/PacketIO.h#L33
https://github.com/openvswitch/ovs/blob/master/datapath-windows/ovsext/PacketIO.c#L54

Found while compiling with Windows 10 kernel tool chain.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-sb: remote connection management in sb db
Lance Richardson [Thu, 8 Dec 2016 18:12:24 +0000 (13:12 -0500)]
ovn-sb: remote connection management in sb db

Add support for managing remote connections, including
SSL configuration, to southbound db schema, and add necessary
commands to ovn-sbctl.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-nb: remote connection management in nb db
Lance Richardson [Thu, 8 Dec 2016 18:12:23 +0000 (13:12 -0500)]
ovn-nb: remote connection management in nb db

Add support for managing remote connections, including
SSL configuration, to northbound db schema, and add necessary
commands to ovn-nbctl.

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Remove unused section from driver inf
Alin Serdean [Mon, 5 Dec 2016 15:39:56 +0000 (15:39 +0000)]
datapath-windows: Remove unused section from driver inf

The new tool chain for Windows 10 driver contains a inf file checker.
While compiling it found the following issue:
 - Common.Params.reg is missing.

This patch removes the entry since it is not used, and at the moment
we do not add any specific keys to the Windows registry.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Ignore VStudio 2015 temporary files
Alin Serdean [Mon, 5 Dec 2016 15:39:55 +0000 (15:39 +0000)]
datapath-windows: Ignore VStudio 2015 temporary files

Ignore the temporary files created by Visual Studio 2015 when opening
a solution.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Remove dead code from PacketIO
Alin Serdean [Thu, 8 Dec 2016 17:57:19 +0000 (17:57 +0000)]
datapath-windows: Remove dead code from PacketIO

Assigning value to 'nativeNbls' has no effect outside the function and
the variable is not used inside the function.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
7 years agogitignore: Ignore venv
Stephen Finucane [Wed, 14 Dec 2016 10:08:00 +0000 (10:08 +0000)]
gitignore: Ignore venv

This is the traditional name for Python virtualenv directories. I use
this when building docs to avoid installating system libraries.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Document Patchwork instance
Stephen Finucane [Wed, 14 Dec 2016 10:07:59 +0000 (10:07 +0000)]
doc: Document Patchwork instance

I know more than a little bit about this :)

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Move testing to testing section
Stephen Finucane [Wed, 14 Dec 2016 10:07:58 +0000 (10:07 +0000)]
doc: Move testing to testing section

This makes more sense here, seeing as it's not exactly installation
related.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Split dpdk, dpdk-advanced into multiple docs
Stephen Finucane [Wed, 14 Dec 2016 10:07:57 +0000 (10:07 +0000)]
doc: Split dpdk, dpdk-advanced into multiple docs

Combined, the dpdk and dpdk-advanced installation documents provide a
lot of useful information, but most of this information is unrelated to
installation. Rework these documents, completely breaking up the
dpdk-advanced document into multiple smaller documents in other sections
and moving non-install aspects of the dpdk document into these sections.
This aims to tie the DPDK docs into the documentation structure.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add DPDK to userspace tunneling guide
Stephen Finucane [Sat, 17 Dec 2016 22:24:08 +0000 (22:24 +0000)]
doc: Add DPDK to userspace tunneling guide

Instructions were provided in the userspace tunneling cookbook.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>