]> git.proxmox.com Git - mirror_ovs.git/log
mirror_ovs.git
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>
7 years agodoc: Add port tunneling cookbook from website
Stephen Finucane [Sat, 17 Dec 2016 22:24:07 +0000 (22:24 +0000)]
doc: Add port tunneling cookbook from website

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add sFlow cookbook from website
Stephen Finucane [Sat, 17 Dec 2016 22:24:06 +0000 (22:24 +0000)]
doc: Add sFlow cookbook from website

This is mostly copied verbatim.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add QoS cookbook from website
Stephen Finucane [Sat, 17 Dec 2016 22:24:05 +0000 (22:24 +0000)]
doc: Add QoS cookbook from website

This is mostly copied verbatim.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add vlan cookbook from website
Stephen Finucane [Sat, 17 Dec 2016 22:24:04 +0000 (22:24 +0000)]
doc: Add vlan cookbook from website

This is mostly copied verbatim.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Misc fixes to 'documentation-style'
Stephen Finucane [Sat, 17 Dec 2016 22:23:38 +0000 (22:23 +0000)]
doc: Misc fixes to 'documentation-style'

The table headers are unnecessary and make the doc harder to read, while
the headers guide was not displaying very well.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add some useful tools for doc editing
Stephen Finucane [Sat, 17 Dec 2016 22:23:37 +0000 (22:23 +0000)]
doc: Add some useful tools for doc editing

This has come up on the mailing list. Let's document it!

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Prefer use of 'code-block' directive
Stephen Finucane [Wed, 21 Dec 2016 20:39:54 +0000 (20:39 +0000)]
doc: Prefer use of 'code-block' directive

The '::' element previously preferred is shorter, but does not allow for
non-Python syntax highlighting. New documentation should make use of
syntax highlighting wherever possible.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Misc Windows doc formatting fixes
Stephen Finucane [Wed, 21 Dec 2016 20:39:53 +0000 (20:39 +0000)]
doc: Misc Windows doc formatting fixes

There are a couple of minor issues with this document:

- Some commands intended to be run in the MinGW shell are prefixed with
  '>', suggesting they are in fact PowerShell commands
- PowerShell syntax highlighting is not enabled
- Indentation is off for a couple of blocks

Resolve all of these through use of the 'code-block' element and a lot
of random fixes.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Resolve issues with Windows guide
Stephen Finucane [Wed, 21 Dec 2016 20:39:52 +0000 (20:39 +0000)]
doc: Resolve issues with Windows guide

The formatting of this file was broken in a recent commit. Resolve this
issue.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: a0c03adff6c2 ("Windows: document multiple NIC support setup")
Cc: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Fix duplicated flow add attempts in table 32.
Han Zhou [Wed, 21 Dec 2016 20:32:16 +0000 (12:32 -0800)]
ovn-controller: Fix duplicated flow add attempts in table 32.

In commit 475f0a2c it introduced a priority 150 flow for filtering
the sending of traffic received from vxlan tunnels back out tunnels.
However, it added the flow for every remote port processing, which
results in continuous logs about duplicated flows. We only need to
install this flow once per physical_run() loop iteration.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Darrell Ball <dball@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofproto: Update access rules for 'flow_cookie'.
Ben Pfaff [Tue, 6 Dec 2016 21:48:50 +0000 (13:48 -0800)]
ofproto: Update access rules for 'flow_cookie'.

The 'flow_cookie' member of struct rule is read during flow translation
without holding a mutex, breaking the documented OVS_GUARDED access rule.
However, the flow_cookie member is actually never modified after a rule is
initialized, so this commit changes the access rules to reflect that.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
7 years agoovs-vsctl: Print error when add-port fails.
Daniele Di Proietto [Wed, 21 Dec 2016 01:50:06 +0000 (17:50 -0800)]
ovs-vsctl: Print error when add-port fails.

When the add-port command fails, vsctl reports the failure and just
suggests to check the logs for more details.

ovs-vswitchd fills the error column in the Interface table with a
description of the error, so it might be helpful to print that.

This is useful especially for dpdk devices, because the port naming
change could use a better error reporting.

I'm planning another patch to make sure that ovs-vswitch writes
appropriates information in the error column, after the dpdk port naming
changes are merged.

CC: Ben Pfaff <blp@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agohash: Update murmurhash repo link in comments
Cian Ferriter [Wed, 21 Dec 2016 16:39:16 +0000 (16:39 +0000)]
hash: Update murmurhash repo link in comments

The MurmurHash code repo has moved from code.google to github. Update
the link to reflect this.

Signed-off-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Log chassis claiming lport only when changes occur.
Mickey Spiegel [Tue, 20 Dec 2016 21:23:46 +0000 (13:23 -0800)]
ovn-controller: Log chassis claiming lport only when changes occur.

With recent OVN commits, the logic for a chassis to claim
or release a logical port was consolidated.  This is a
good thing.  However, there was a logic change that
resulted in VLOG_INFO being generated every time on the
ovn-controller.  This patch changes the logic so that
VLOG_INFO is only generated when there is a change, for
example when the chassis claims an lport the first time.

Signed-off-by: Mickey Spiegel <mickeys.dev@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovsdb-idlc: Initialize nonnull string columns for inserted rows.
Ben Pfaff [Wed, 21 Dec 2016 00:17:31 +0000 (16:17 -0800)]
ovsdb-idlc: Initialize nonnull string columns for inserted rows.

When a schema column has type "exactly one string", the corresponding
struct member has type "char *" and the documented and expected behavior
is that the string should always be nonnull.  (The code generator even
adds a comment /* Always nonnull. */ in the struct definition.)  In the
case where a value is not available, the string is supposed to be
initialized to "" instead of to NULL.

However, the IDL code for inserting a new row did not properly initialize
the column to "", instead leaving it NULL.  This could cause null pointer
dereferences in corner cases.

This commit fixes the problem.

Reported-by: Lance Richardson <lrichard@redhat.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2016-December/326500.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Tested-by: Lance Richardson <lrichard@redhat.com>
7 years agotests: Regenerate atlocal when running tests.
Ben Pfaff [Tue, 20 Dec 2016 21:15:51 +0000 (13:15 -0800)]
tests: Regenerate atlocal when running tests.

A previous patch fixed double rebuilds when running tests in some cases.
That patch removed dependencies from targets in tests/automake.mk that
were redundant because the "all" target already depended on them.  A
dependency on tests/atlocal was also removed in the belief that "all"
depended on tests/atlocal.  This belief was incorrect, which meant that
tests/atlocal would not get regenerated if it was removed or out of date.
This commit fixes the problem.

Reported-by: Joe Stringer <joe@ovn.org>
Fixes: a8cb456227b0 ("tests: Fix double-rebuild of testsuite for "check-valgrind" and similar.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
7 years agoWindows: document multiple NIC support setup
Alin Serdean [Tue, 20 Dec 2016 19:42:36 +0000 (19:42 +0000)]
Windows: document multiple NIC support setup

This patch updates the documentation on how to set up OVS with multiple
NICs.

Also update the documentation to show users how new internal ports are
created

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Add multiple switch internal ports
Alin Serdean [Tue, 20 Dec 2016 19:42:19 +0000 (19:42 +0000)]
datapath-windows: Add multiple switch internal ports

This patch adds multiple internal ports support to the windows datapath.
All tunnels types have been updated to accommodate this new functionality.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Co-authored-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoWindows: Add internal switch port per OVS bridge
Alin Serdean [Tue, 20 Dec 2016 19:41:22 +0000 (19:41 +0000)]
Windows: Add internal switch port per OVS bridge

This patch updates the following commands in the vswitch:
 ovs-vsctl add-br br-test
 ovs-vsctl del-br br-test

ovs-vsctl add-br br-test:
    This command will now create an internal port on the MSFT virtual switch
  using the WMI interface from Msvm_VirtualEthernetSwitchManagementService
  leveraging the method AddResourceSettings.
    Before creating the actual port, the switch will be queried to see if there
  is not a port already created (good for restarts when restarting the
  vswitch daemon). If there is a port defined it will return success and log
  a message.
    After checking if the port already exists the command will also verify
  if the forwarding extension (windows datapath) is enabled and on a single
  switch. If it is not activated or if it is activated on multiple switches
  it will return an error and a message will be logged.
    After the port was created on the switch, we will disable the adapter on
  the host and rename to the corresponding OVS bridge name for consistency.
    The user will enable and set the values he wants after creation.

ovs-vsctl del-br br-test
    This command will remove an internal port on the MSFT virtual switch
  using the Msvm_VirtualEthernetSwitchManagementService class and executing
  the method RemoveResourceSettings.

Both commands will be blocking until the WMI job is finished, this allows us
to guarantee that the ports are created and their name are set before issuing
a netlink message to the windows datapath.

This patch also includes helpers for normal WMI retrievals and initializations.
Appveyor and documentation has been modified to include the libraries needed
for COM objects.

This patch was tested individually using IMallocSpy and CRT heap checks
to ensure no new memory leaks are introduced.

Tested on the following OS's:
Windows 2012, Windows 2012r2, Windows 2016

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Paul Boca <pboca@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodocs: Document nc dependency for kernel tests.
Joe Stringer [Fri, 16 Dec 2016 19:10:12 +0000 (11:10 -0800)]
docs: Document nc dependency for kernel tests.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
7 years agodatapath-windows: Conntrack - Enable FTP support
Sairam Venugopal [Fri, 16 Dec 2016 22:28:12 +0000 (14:28 -0800)]
datapath-windows: Conntrack - Enable FTP support

Enable the support for tracking FTP connections in the Connection tracker.
This checks an incoming ftp control connection to extract the related data
connection. When a matching data connection arrives, it would then update
the connection entry to point to the original control connection.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Conntrack - Introduce support for tracking related connections
Sairam Venugopal [Fri, 16 Dec 2016 22:28:11 +0000 (14:28 -0800)]
datapath-windows: Conntrack - Introduce support for tracking related connections

Introduce a new table to track related connections. This table will be
used to track FTP data connections based on the control connection. There
is a new Conntrack-ftp.c to parse incoming FTP messages to determine the
related data ports. It creates a new entry in the related connections
tracker table. If there is a matching FTP data connection, then the state
for that connection is marked as RELATED.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Cleanup Conntrack definitions and introduce related entries
Sairam Venugopal [Fri, 16 Dec 2016 22:28:10 +0000 (14:28 -0800)]
datapath-windows: Cleanup Conntrack definitions and introduce related entries

Consolidate the reusable structs and includes. Introduce the new
OVS_CT_REL_ENTRY to track related connections.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Conntrack - Fix OvsGetTcpPayloadLength()
Sairam Venugopal [Fri, 16 Dec 2016 22:28:09 +0000 (14:28 -0800)]
datapath-windows: Conntrack - Fix OvsGetTcpPayloadLength()

Move the OvsGetTcpPayloadLength() to common header. Update the code to
check for null references and the correct size of the TCP header.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agowindows: Incorrect check while fetching adapter addresses
Alin Serdean [Tue, 13 Dec 2016 18:52:35 +0000 (18:52 +0000)]
windows: Incorrect check while fetching adapter addresses

Checking for ERROR_INSUFFICIENT_BUFFER is incorrect per
MSFT documentation:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx

Also, the initial call to GetAdaptersAddresses was wrong. In the case
of a successful return 'all_addr' was not allocated leading to a crash.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-by: Lior Baram <lior.baram@hpe.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-controller: Fix conntrack zone in gateway routers.
Guru Shetty [Mon, 19 Dec 2016 12:12:17 +0000 (04:12 -0800)]
ovn-controller: Fix conntrack zone in gateway routers.

The gateway router was using the ct_next action to
reassemble packets.  But ct_next action by default would
use the zone allocated for a logical port and in case of
gateway routers that value was zero.  This would make
the flow use the default zone of zero.  This had some
unintended consequences as the zone used to track packets
and the zone used to eventually commit it (DNAT zone)
was different.  As a result, a packet would never have ct.est set.

With this commit, when ct_next action is used in a gateway
router, we use the DNAT zone.  This is similar to the
strategy used in commit c2e954a117a8 (ovn-controller: Datapath
based conntrack zone for load-balancing.)

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agoovn-controller: Monitor only necessary southbound rows.
Ben Pfaff [Tue, 20 Dec 2016 03:25:59 +0000 (19:25 -0800)]
ovn-controller: Monitor only necessary southbound rows.

Until now, ovn-controller has replicated all of the southbound database
(through the IDL).  This is inefficient, especially in a large OVN setup
where many logical networks are not present on an individual hypervisor.
This commit improves on the situation somewhat, by making ovn-controller
replicate (almost) only the port bindings, logical flows, and multicast
groups that are actually relevant to the particular hypervisor on which
ovn-controller is running.  This is easily possible by replicating the
patch ports from the Port_Binding table and using these relationships to
determine connections between datapaths.

This patch is strongly influenced by earlier work from the CCed developers.
I am grateful for their assistance.

CC: Darrell Ball <dlu998@gmail.com>
CC: Liran Schour <LIRANS@il.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Liran Schour <lirans@il.ibm.com>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovsdb-idl: Change interface to conditional monitoring.
Ben Pfaff [Tue, 20 Dec 2016 04:55:35 +0000 (20:55 -0800)]
ovsdb-idl: Change interface to conditional monitoring.

Most users of OVSDB react to whatever is currently in their view of the
database, as opposed to keeping track of changes and reacting to those
changes individually.  The interface to conditional monitoring was
different, in that it expected the client to say what to add or remove from
monitoring instead of what to monitor.  This seemed reasonable at the time,
but in practice it turns out that the usual approach actually works better,
because the condition is generally a function of the data visible in the
database.  This commit changes the approach.

This commit also changes the meaning of an empty condition for a table.
Previously, an empty condition meant to replicate every row.  Now, an empty
condition means to replicate no rows.  This is more convenient for code
that gradually constructs conditions, because it does not need special
cases for replicating nothing.

This commit also changes the internal implementation of conditions from
linked lists to arrays.  I just couldn't see an advantage to using linked
lists.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Liran Schour <lirans@il.ibm.com>
7 years agoovn-controller: Rename all_lports to local_lports.
Ben Pfaff [Sat, 17 Dec 2016 18:51:49 +0000 (10:51 -0800)]
ovn-controller: Rename all_lports to local_lports.

This sset has always just contained the names of logical ports that are
local to the current hypervisor, but the name 'all_lports' implied that it
contained the name of every logical port.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovn-controller: Drop most uses of OVS patch ports.
Ben Pfaff [Mon, 19 Dec 2016 22:53:18 +0000 (14:53 -0800)]
ovn-controller: Drop most uses of OVS patch ports.

Until now, ovn-controller has implemented OVN logical patch ports and
l3gateway ports in terms of OVS patch ports.  It is a hassle to create and
destroy ports, and it is also wasteful compared to what the patch ports
actually buy us: the ability to "save and restore" a packet around a
recursive trip through the flow table.  The "clone" action can do that too,
without the need to create a port.  This commit takes advantage of the
clone action for that purpose, getting rid of most of the patch ports
previously created by ovn-controller.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovn-controller: Avoid code duplication getting chassis record.
Ben Pfaff [Thu, 15 Dec 2016 23:20:06 +0000 (15:20 -0800)]
ovn-controller: Avoid code duplication getting chassis record.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agopnysical: Factor code out of consider_port_binding().
Ben Pfaff [Mon, 5 Dec 2016 07:07:49 +0000 (23:07 -0800)]
pnysical: Factor code out of consider_port_binding().

These functions will have an additional user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovn-controller: Handle only relevant ports and flows.
Ben Pfaff [Mon, 19 Dec 2016 21:20:07 +0000 (13:20 -0800)]
ovn-controller: Handle only relevant ports and flows.

On a particular hypervisor, ovn-controller only needs to handle ports
and datapaths that have some relationship with it, that is, the
ports that actually reside on the hypervisor, plus all the other ports on
those ports' datapaths, plus all of the ports and datapaths that are
reachable from those via logical patch ports.  Until now, ovn-controller
has done a poor job of limiting what it deals with to this set.  This
commit improves the situation.

This commit gets rid of the concept of a "patched_datapath" which until now
was used to represent any datapath that contained a logical patch port.
Previously, the concept of a "local_datapath" meant a datapath with a VIF
that resides on the local hypervisor.  This commit extends that concept to
include any other datapath that can be reached from a VIF on the local
hypervisor, which is a simplification that makes the code easier to
understand in a few places.

CC: Gurucharan Shetty <guru@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agolport: Add index for logical datapaths.
Ben Pfaff [Tue, 6 Dec 2016 17:19:41 +0000 (09:19 -0800)]
lport: Add index for logical datapaths.

This will have its first real user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agolport: Tolerate null pointers in destroy functions.
Ben Pfaff [Fri, 2 Dec 2016 07:25:40 +0000 (23:25 -0800)]
lport: Tolerate null pointers in destroy functions.

The coding style says to do this.

The actual caller doesn't pass a null pointer.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agolport: Be a little more careful building lport index.
Ben Pfaff [Fri, 2 Dec 2016 07:24:41 +0000 (23:24 -0800)]
lport: Be a little more careful building lport index.

It seems like a good idea to check for and warn about all kinds of
duplicates, and to avoid segfaulting if a datapath column is empty.
(However, the database schema should prevent both issues.)

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovn-controller: Make indexes more broadly available.
Ben Pfaff [Fri, 2 Dec 2016 07:30:00 +0000 (23:30 -0800)]
ovn-controller: Make indexes more broadly available.

This will allow binding_run() to use them in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoofp-actions: Add clone action.
William Tu [Sun, 18 Dec 2016 08:13:02 +0000 (00:13 -0800)]
ofp-actions: Add clone action.

This patch adds OpenFlow clone action with syntax as below:
"clone([action][,action...])".  The clone() action makes a copy of the
current packet and executes the list of actions against the packet,
without affecting the packet after the "clone(...)" action.  In other
word, the packet before the clone() and after the clone() is the same,
no matter what actions executed inside the clone().

Use case 1:
Set different fields and output to different ports without unset
actions=
  clone(mod_dl_src:<mac1>, output:1), clone(mod_dl_dst:<mac2>, output:2), output:3
Since each clone() has independent packet, output:1 has only dl_src modified,
output:2 has only dl_dst modified, output:3 has original packet.

Similar to case1
actions=
  push_vlan(...), output:2, pop_vlan, push_vlan(...), output:3
can be changed to
actions=
  clone(push_vlan(...), output:2),clone(push_vlan(...), output:3)
without having to add pop_vlan.

case 2: resubmit to another table without worrying packet being modified
  actions=clone(resubmit(1,2)), ...

Signed-off-by: William Tu <u9012063@gmail.com>
[blp@ovn.org revised this to omit the "sample" action]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-actions: Move function for struct ofpact_nest near struct definition.
Ben Pfaff [Thu, 15 Dec 2016 17:25:04 +0000 (09:25 -0800)]
ofp-actions: Move function for struct ofpact_nest near struct definition.

This seems like a logical place for it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoofp-actions: Use struct ext_action_header for appropriate actions.
Ben Pfaff [Thu, 15 Dec 2016 17:24:24 +0000 (09:24 -0800)]
ofp-actions: Use struct ext_action_header for appropriate actions.

A few Open vSwitch extension actions have no fixed arguments but do have
variable-length options that follow the header, and an upcoming commit will
add another such action.  There is little value in having individual
structures for these actions, since they all have the same form, so this
commit makes all of them use the existing struct ext_action_header.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovsdb-idl: Drop write-only member from struct ovsdb_idl_condition.
Ben Pfaff [Sat, 17 Dec 2016 00:15:40 +0000 (16:15 -0800)]
ovsdb-idl: Drop write-only member from struct ovsdb_idl_condition.

The 'tc' member of struct ovsdb_idl_condition was written but never read,
so remove it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
7 years agoovn-controller: Don't enable IDL tracking.
Ben Pfaff [Tue, 20 Dec 2016 03:34:02 +0000 (19:34 -0800)]
ovn-controller: Don't enable IDL tracking.

IDL tracking has a cost and nothing in ovn-controller was getting any value
for that cost, so disable it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agodatapath-windows: Fix issues related to packet completion
Shashank Ram [Thu, 8 Dec 2016 21:31:49 +0000 (13:31 -0800)]
datapath-windows: Fix issues related to packet completion

In OvsTunnelPortTx() function, for packets coming from the
VIF port, the srcVportNo, srcPortId and srcNicIndex were
getting modified for the original NBL prior to creation
of newNbl. This is not correct since modifying the original
packet's forwarding detail can cause completion issues.
Instead, we should keep the forwarding detail of the original
packet as is, and only update the forwarding detail for the
newNbl.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agosystem-traffic: Skip test cases if firewalld is on.
Yi-Hung Wei [Fri, 9 Dec 2016 02:34:07 +0000 (18:34 -0800)]
system-traffic: Skip test cases if firewalld is on.

On RHEL 7.3, test cases that use vxlan, gre, and geneve tunnels fail because
traffic is blocked by default firewall configuration. This commit detects the
status of firewalld, and skips the tests if firewalld is on.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agosystem-traffic: Skip test cases if netcat is not installed.
Yi-Hung Wei [Fri, 9 Dec 2016 02:34:06 +0000 (18:34 -0800)]
system-traffic: Skip test cases if netcat is not installed.

Test cases that use netcat will fail if netcat is not installed. This patch
detects if netcat is present, and skips those test cases if netcat is not there.

Singed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agodatapath: compat: Fix build on RHEL 7.3
Yi-Hung Wei [Fri, 9 Dec 2016 02:34:05 +0000 (18:34 -0800)]
datapath: compat: Fix build on RHEL 7.3

RHEL 7.3 provides upstream tunnel but it does not support name_assign_type
attribute in net-device. This patch fixes the build problem by backporting
functions with name_assign_type, and using proper flags in acinclude.m4 to
invoke backport functions.

Tested on RHEL 7.3 with kernel 3.10.0-514.el7.x86_64

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agotravis: Update build matrix for latest kernels.
Joe Stringer [Wed, 14 Dec 2016 00:00:00 +0000 (16:00 -0800)]
travis: Update build matrix for latest kernels.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
7 years agodist-docs: Make "make dist-docs" work again.
Ben Pfaff [Tue, 13 Dec 2016 20:50:10 +0000 (12:50 -0800)]
dist-docs: Make "make dist-docs" work again.

CC: Stephen Finucane <stephen@that.guru>
Fixes: c431227e3350 ("doc: Remove documentation from distdoc target")
Reported-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Lance Richardson <lrichard@redhat.com>
7 years agodoc: Use higher resolution logo
Stephen Finucane [Tue, 13 Dec 2016 17:40:38 +0000 (17:40 +0000)]
doc: Use higher resolution logo

Rework the logo to remove much of the white background and increase
resolution.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Add link to manpages guide
Stephen Finucane [Tue, 13 Dec 2016 18:38:42 +0000 (18:38 +0000)]
doc: Add link to manpages guide

This was included only in the contents page.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reported-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Fix a couple of broken links
Stephen Finucane [Tue, 13 Dec 2016 18:38:41 +0000 (18:38 +0000)]
doc: Fix a couple of broken links

I missed these while moving things around.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath-windows: Conntrack move null checks to functions
Alin Serdean [Thu, 8 Dec 2016 18:44:50 +0000 (18:44 +0000)]
datapath-windows: Conntrack move null checks to functions

Add null checks inside OvsConntrackValidateIcmpPacket,
OvsConntrackValidateTcpPacket to make the functions self-contained.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Suggested-by: Yin Lin <linyi@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agodatapath-windows: Fix the redefinition of variables
Sairam Venugopal [Sat, 3 Dec 2016 00:06:02 +0000 (16:06 -0800)]
datapath-windows: Fix the redefinition of variables

Some of the variables were getting re-defined in the function. This causes
compiler warning in Windows SDK 10.

Signed-off-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-northd: Sort options in put_dhcp(v6)_opts.
Daniele Di Proietto [Fri, 9 Dec 2016 01:43:31 +0000 (17:43 -0800)]
ovn-northd: Sort options in put_dhcp(v6)_opts.

The order of the options in the packet generated by ovs-controller
depends on the hash function.  I believe that murmur hash (our default)
produces different outputs depending on the endianness of the system.
Also, if SSE4.2 is enabled at build time, we use CRC32 for hashing which
gives different results even on x86.

This causes one unit test to fail on big endian or with SSE4.2:

ovn -- dhcpv4 : 1 HV, 2 LS, 2 LSPs/LS

This commit fixes the problem in ovn-northd by always sorting dhcp
options inside the logical flow put_dhcp(v6)_opts action.

Reported-at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840770
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@ovn.org>
7 years agovswitch.xml: Document reasonable range for MTU.
nickcooper-zhangtonghao [Mon, 12 Dec 2016 04:48:57 +0000 (20:48 -0800)]
vswitch.xml: Document reasonable range for MTU.

According to RFC 791, every internet module must be
able to forward a datagram of 68 octets without further
fragmentation.  This is because an internet header may
be up to 60 octets, and the minimum fragment is 8 octets.
The maximum size of IP packets is 65535 bytes. The range
of MTU values allowes for the MTU configuration parameter
is 68 to 65535.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
[blp@ovn.org changed this to just a documentation patch]
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodatapath: Checks the MTU for netdev-dummy ports.
nickcooper-zhangtonghao [Mon, 12 Dec 2016 04:48:56 +0000 (20:48 -0800)]
datapath: Checks the MTU for netdev-dummy ports.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agoovs-sandbox: add '--vswitchd-unforced-dummy' option.
nickcooper-zhangtonghao [Wed, 7 Dec 2016 18:04:03 +0000 (10:04 -0800)]
ovs-sandbox: add '--vswitchd-unforced-dummy' option.

The ovs-sandbox runs in the "dummy mode" by default.
In this mode of testing, no packets travel across
physical or virtual networks. But sometimes, we may
create veth network devices and add them to ovs bridge
for developing and testing. It's necessary to add an option.

Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Update comment to mention SSL support.
Guoshuai Li [Fri, 9 Dec 2016 04:39:41 +0000 (12:39 +0800)]
python: Update comment to mention SSL support.

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agopython: Reconnect SSL connections when ovsdb-server restarts.
Guoshuai Li [Wed, 7 Dec 2016 06:38:22 +0000 (14:38 +0800)]
python: Reconnect SSL connections when ovsdb-server restarts.

The do_handshake() function throws the exception OpenSSL.SSL.SysCallError
when the peer's SSL connection is closed, And the recv() function also
throws the exception OpenSSL.SSL.SysCallError when the peer's SSL
connection is abnormally closed, This commit catches the exception and
return error's errno.

Similarly, the recv() function also throws the exception
OpenSSL.SSL.ZeroReturnError when the peer's SSL connection is closed.  This
exception refers to TCP connection normal closed, return (0, "")

Signed-off-by: Guoshuai Li <ligs@dtdream.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
7 years agoconfigure: Enable new warning options added in GCC 6.
Ben Pfaff [Mon, 5 Dec 2016 22:38:08 +0000 (14:38 -0800)]
configure: Enable new warning options added in GCC 6.

-Wnull-dereference is also new in GCC 6 but upon testing it produces far
too many false positives to be usable for OVS.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoconfigure: Enable new warning options added in GCC 5.
Ben Pfaff [Mon, 5 Dec 2016 22:29:24 +0000 (14:29 -0800)]
configure: Enable new warning options added in GCC 5.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoconfigure: Use -Wformat-security with -Wformat.
Ben Pfaff [Mon, 5 Dec 2016 22:28:59 +0000 (14:28 -0800)]
configure: Use -Wformat-security with -Wformat.

GCC 6.1 warns that -Wformat-security has no effect without -Wformat, so
this commit fixes the problem.

The change to _OVS_CHECK_CC_OPTION is needed so that the cache variable
name doesn't end up with a space in it, which obviously doesn't work.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoacinclude: Fix -Wstrict-prototypes and -Wold-style-definition detection.
Ben Pfaff [Mon, 5 Dec 2016 22:29:35 +0000 (14:29 -0800)]
acinclude: Fix -Wstrict-prototypes and -Wold-style-definition detection.

AC_LANG_PROGRAM(,) uses a program like this:

    int main() { return 0; }

but that triggers warnings for -Wstrict-prototypes and for
-Wold-style-definition, since this definition of main() lacks a prototype
and is therefore old-style.  This meant that -Wstrict-prototypes and
-Wold-style-definition weren't being turned on for new-enough GCC.  This
commit fixes the problem by changing the program that is test-compiled to:

    int x;

which doesn't make any compilers mad, as far as I know.

I recently upgraded to GCC 6.1 and just now noticed the issue, so I think
that GCC somewhere between version 4.9 and version 6.1 must have started
warning about main() when it's declared this way.

Also, fix a few functions that lacked prototypes.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
7 years agoovn: Encode dhcpv6 PACKET_IN userdata as big endian.
Daniele Di Proietto [Thu, 8 Dec 2016 19:11:50 +0000 (11:11 -0800)]
ovn: Encode dhcpv6 PACKET_IN userdata as big endian.

The packet in userdata generated by ovn-controller when translating the
put_dhcpv6_opt action includes 16-bit integers.

Currently these 16-bit integers are encoded with native endianness.
This is ok becase the only consumer of that userdata is ovn-controller
itself, but it means that the OpenFlow action we're generating might
not really be the same on different hosts.

I think it's better to encode the userdata as big-endian, like the rest
of OpenFlow messages.

This fixes a test failure on big-endian platforms, because the generated
OpenFlow bytes were different than expected (the expectation was
generated on a little endian machine).

Now 'struct dhcp_opt6_header' is identical to 'struct
dhcpv6_opt_header', but I chose to keep them separate, because they
have different purposes.  I also renamed the members to avoid confusion.

I haven't tested this on a real setup.

CC: Numan Siddique <nusiddiq@redhat.com>
Reported-at: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840770
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
7 years agolib/dpdk: fix double free on exit
Aaron Conole [Fri, 9 Dec 2016 16:22:27 +0000 (11:22 -0500)]
lib/dpdk: fix double free on exit

The DPDK EAL library intents that all argc/argv arguments passed on the
command line will be in the form:

    progname dpdk arguments program arguments

This means the argv array will look something like:
   argv[0] = progname
   argv[1..x] = dpdk arguments
   argv[x..y] = program arguments

When the eal initialization routine completes, it will modify the argv array
to set argv[ret] = progname, such that the arguments can then be passed to
something like getopts for further processing.

When the dpdk arguments rework was initially added, the assignment mentioned
above was not considered.  This means two errors were introduced:
1. Leak of the element at argv[ret]
2. Double-free of the element at argv[0]

Reported-by: Ilya Maximets <i.maximets@samsung.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2016-November/325442.html
Fixes: bab694097133 ("netdev-dpdk: Convert initialization from cmdline to db")
Signed-off-by: Aaron Conole <aconole@redhat.com>
7 years agodoc: Add required packages for RHEL build dependency
Yi-Hung Wei [Sat, 10 Dec 2016 00:41:22 +0000 (16:41 -0800)]
doc: Add required packages for RHEL build dependency

Two more packages are needed to build ovs package on RHEL.

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
[joe@ovn.org added fedora doc]
Signed-off-by: Joe Stringer <joe@ovn.org>
7 years agodatapath-windows: Avoid busy wait in OvsStartIpHelper
Shashank Ram [Wed, 23 Nov 2016 01:32:54 +0000 (17:32 -0800)]
datapath-windows: Avoid busy wait in OvsStartIpHelper

Previously, the IP Helper thread would wait for an event
but with a timeout of 0, which resulted in the thread
busy waiting causing high CPU usage by the kernel.
Since the IP Helper thread is only required based on
certain events, it makes sense to wait indefinitely
till we receieve such an event notification to wake up
the thread. This change aims to address this issue.

When OvsEnqueueIpHelperRequest() or OvsInternalAdapterUp()
is called, the ovsNumIpHelperRequests counter is incremented,
but upon consumption of the request, is not decremented.
Since the wakeup logic for the thread is determined by this
counter value, we need to reset the counter back correctly
once the request has been consumed by the IP Helper thread.

Signed-off-by: Shashank Ram <rams@vmware.com>
Acked-by: Yin Lin <linyi@vmware.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
7 years agoovn-trace: Implement DHCP option support.
Ben Pfaff [Mon, 12 Dec 2016 17:16:18 +0000 (09:16 -0800)]
ovn-trace: Implement DHCP option support.

The put_dhcp_opts(v6) logical action didn't really work because ovn-trace
didn't handle DHCP options.  This fixes the problem.

This also makes the put_dhcp_opts(v6) logical provide useful tracing output
showing what's happening and the assumptions.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Numan Siddique <nusiddiq@redhat.com>
7 years agodoc: Remove documentation from distdoc target
Stephen Finucane [Thu, 8 Dec 2016 12:55:30 +0000 (12:55 +0000)]
doc: Remove documentation from distdoc target

Basic Sphinx integration is now complete. Remove the documentation
aspects of the 'dist-docs' target in favor of the htmldocs target.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Ben Pfaff <blp@ovn.org>
7 years agodoc: Populate 'faq' section
Stephen Finucane [Thu, 8 Dec 2016 12:55:29 +0000 (12:55 +0000)]
doc: Populate 'faq' section

This is mostly the exact same contents, albeit broken up into multiple
files.

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