cascardo/ovs.git
8 years agoconfigure: Fix checking of six library for Python 3.
Ilya Maximets [Wed, 24 Feb 2016 15:04:57 +0000 (18:04 +0300)]
configure: Fix checking of six library for Python 3.

Copied from python 2 checker but not corrected.

Fixes: 8fb7d02686ed ("configure: Check for presence of Python 3.")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoflow: add miniflow_pad_from_64
Simon Horman [Wed, 20 Jan 2016 06:15:01 +0000 (15:15 +0900)]
flow: add miniflow_pad_from_64

Provide leading padding to allow pushing a value to a miniflow where
the value is not aligned to 64 bytes and no value has already been
pushed to the same word.

This will be used by a follow-up patch to allow layer 3 packet - that is
packets without an ethernet header - to be represented in flows.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoflow: add miniflow_push_uint8
Simon Horman [Wed, 20 Jan 2016 06:15:00 +0000 (15:15 +0900)]
flow: add miniflow_push_uint8

The motivation is to allow pushing single bytes in
a manner to that already used for 16, 32 and 64 bit integers.

This will be used by a follow-up patch to allow layer 3 packet -
that is packets without an ethernet header - to be represented in flows.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agonetdev-dpdk: Do not add vhost-user ports with '/' or '\' in name.
Daniele Di Proietto [Wed, 3 Feb 2016 01:24:32 +0000 (17:24 -0800)]
netdev-dpdk: Do not add vhost-user ports with '/' or '\' in name.

This check prevents an obvious way for a vhost-user socket to escape the
intended directory.

There might be other ways to escape the directory (none comes to mind at
the moment), but this is a problem that should be properly solved by
mandatory access control.

A similar check is done for a bridge name, since that name is used as
part of a socket as well.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
8 years agotests/dpdk/ring_client: extend range of supported dpdkr ports
Mauricio Vásquez [Tue, 23 Feb 2016 22:06:38 +0000 (23:06 +0100)]
tests/dpdk/ring_client: extend range of supported dpdkr ports

Current implementation of the ring_client test only supports until the
dpdkr255 port, this patch extends it to support the full range of possible
dpdkr ports.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agolib/netdev-dpdk: make device name parsing more robust
Mauricio Vásquez [Tue, 23 Feb 2016 22:06:37 +0000 (23:06 +0100)]
lib/netdev-dpdk: make device name parsing more robust

Current implementation of dpdk_dev_parse_name does not perform a robust
error handling, port names as "dpdkr" and "dpdkr1x" are considered valid.

With this patch only positive port numbers in decimal notation are considered
valid.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agovtep: Add error messages for logical router support
Dennis Sam [Tue, 23 Feb 2016 21:43:46 +0000 (13:43 -0800)]
vtep: Add error messages for logical router support

Documents error codes that a Hardware Switch Controller can publish to the NVC
to indicate errors related to the provisioning of logical routers.

Signed-off-by: Dennis Sam <dsam@arista.com>
Acked-by: Anupam Chanda <achandra@vmware.com>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
8 years agoovs-ofctl.8: Clarify conntrack documentation.
Joe Stringer [Tue, 23 Feb 2016 21:26:29 +0000 (13:26 -0800)]
ovs-ofctl.8: Clarify conntrack documentation.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agolib: Fix netbsd compilation error.
Lance Richardson [Mon, 15 Feb 2016 15:08:51 +0000 (10:08 -0500)]
lib: Fix netbsd compilation error.

NetBSD requires <netinet/in.h> to be included before <netinit/ip6.h>.
Without this fix we have:

In file included from lib/netdev-vport.c:25:0:
/usr/include/netinet/ip6.h:82:18: error: field 'ip6_src' has incomplete type
/usr/include/netinet/ip6.h:83:18: error: field 'ip6_dst' has incomplete type

Signed-off-by: Lance Richardson <lrichard@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agolib/netdev-dpdk: increase ring name length for dpdkr ports
Mauricio Vásquez [Sun, 24 Jan 2016 03:20:13 +0000 (22:20 -0500)]
lib/netdev-dpdk: increase ring name length for dpdkr ports

A ring name length of 10 characters is not enough for dpdkr ports
starting from dpdkr10, then it is increased to RTE_RING_NAMESIZE
characters.

Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agoMakefile.am: Clean flake8-check too.
Ben Pfaff [Mon, 22 Feb 2016 23:47:06 +0000 (15:47 -0800)]
Makefile.am: Clean flake8-check too.

Found by "make distcheck".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agoofproto-dpif-xlate: Fix crash when using multicast snooping.
Thadeu Lima de Souza Cascardo [Wed, 17 Feb 2016 14:43:56 +0000 (12:43 -0200)]
ofproto-dpif-xlate: Fix crash when using multicast snooping.

The revalidator thread may set may_learn and call xlate_actions with no packet
data. If the revalidated flow is IGMPv3 or MLD, vswitchd will crash when trying
to access the NULL packet.

Only process IGMP and MLD flows when there is a packet. This is a similar
behavior than what we have for other special packets.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Reported-by: Yi Ba <yby.developer@yahoo.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2016-January/020023.html
Fixes: 06994f879c9d ("mcast-snooping: Add Multicast Listener Discovery support")
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agorhel: Add missing ovn bugtool files
Flavio Leitner [Tue, 23 Feb 2016 03:26:39 +0000 (00:26 -0300)]
rhel: Add missing ovn bugtool files

Fixes: 981cbd52c942 ("ovs-bugtool: Create OVN plugin and add output.")
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodpif-netdev: Move rxq management into functions.
Ilya Maximets [Mon, 8 Feb 2016 15:30:30 +0000 (18:30 +0300)]
dpif-netdev: Move rxq management into functions.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agodpif-netdev: Reload each thread only once in do_add_port.
Ilya Maximets [Mon, 8 Feb 2016 15:30:29 +0000 (18:30 +0300)]
dpif-netdev: Reload each thread only once in do_add_port.

While adding of pmd interface with multiple queues several queues
may be assigned to one thread and this thread will be reloaded
one time for each added queue.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agodpif-netdev: Add dpif-netdev/pmd-rxq-show appctl command.
Ilya Maximets [Mon, 8 Feb 2016 07:38:47 +0000 (10:38 +0300)]
dpif-netdev: Add dpif-netdev/pmd-rxq-show appctl command.

This command can be used to check the port/rxq assignment to
pmd threads. For each pmd thread of the datapath shows list
of queue-ids with port names.

Additionally log message from pmd_thread_main() extended with
queue-id, and type of this message changed from INFO to DBG.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agobuild-windows: Enable parallel jobs for msbuild
Alin Serdean [Thu, 11 Feb 2016 03:09:32 +0000 (03:09 +0000)]
build-windows: Enable parallel jobs for msbuild

This patch enables parallel build from the command line.

If vstudio_config is defined change from:
make ovsext_make to make ovsext and also update the dependecy for it,
since the project requires OvsDpInterface.h to be built.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovs-bugtool: Create OVN plugin and add output.
William Tu [Sat, 6 Feb 2016 04:04:14 +0000 (20:04 -0800)]
ovs-bugtool: Create OVN plugin and add output.

Create a new ovn/utilities/bugtool directory, add ovn.xml to bugtool
plugins, and add ovn-nbctl show, ovn-sbctl show, and ovn-sbctl
lflow-list.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoNEWS: Claim support for Python 3.
Russell Bryant [Fri, 18 Dec 2015 19:53:32 +0000 (14:53 -0500)]
NEWS: Claim support for Python 3.

Also update the Python ovs package info to note that both Python 2 and 3
are supported.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovlog.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 19:14:22 +0000 (14:14 -0500)]
vlog.at: Run tests for Python 2 and 3.

Update these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agounixctl-py.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 19:00:25 +0000 (14:00 -0500)]
unixctl-py.at: Run tests for Python 2 and 3.

Update these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodaemon-py.at: Run tests with Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 18:24:57 +0000 (13:24 -0500)]
daemon-py.at: Run tests with Python 2 and 3.

Update these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoreconnect.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:56:28 +0000 (10:56 -0500)]
reconnect.at: Run tests for Python 2 and 3.

Update the reconnect tests to use both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agojsonrpc-py.at: Run tests with Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:52:31 +0000 (10:52 -0500)]
jsonrpc-py.at: Run tests with Python 2 and 3.

Convert these Python tests to run with both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agolibrary.at: Run tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:38:53 +0000 (10:38 -0500)]
library.at: Run tests for Python 2 and 3.

Update Python tests to run for both Python 2 and 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-idl.at: Run tests with both Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 15:29:32 +0000 (10:29 -0500)]
ovsdb-idl.at: Run tests with both Python 2 and 3.

Update Python tests to run for both Python 2 and Python 3.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb.at: Run Python tests for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 13:33:30 +0000 (08:33 -0500)]
ovsdb.at: Run Python tests for Python 2 and 3.

ovsdb.at includes some macros for running some identical test cases for
both C and Python.  Update these macros to run the test case for both
Python 2 and 3.  Retain the existing behavior for the direct use of the
_PY versions of these macros to only run against Python 2 without any
changes needed.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agojson.at: Run for Python 2 and 3.
Russell Bryant [Fri, 18 Dec 2015 01:55:18 +0000 (20:55 -0500)]
json.at: Run for Python 2 and 3.

Run json.at tests for both Python 2 and 3 if available.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agoconfigure: Check for presence of Python 3.
Russell Bryant [Fri, 18 Dec 2015 00:58:33 +0000 (19:58 -0500)]
configure: Check for presence of Python 3.

The configure script already checked for Python 2 (>=2.7).  Add another
check for Python 3 (>=3.4).  This will be used later for automatically
running tests with Python 3 as well if available.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Deal with Python output differences.
Russell Bryant [Thu, 17 Dec 2015 17:22:31 +0000 (12:22 -0500)]
tests: Deal with Python output differences.

This test checks the output based on Python's string representation of
an array of two unicode strings.  These strings have a "u" prefix in
Python 2, but not Python 3.  In Python 3, all strings are unicode.

Use sed on the output to strip the "u" from Python 2 output when
checking for the expected result.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agogcc: Fix compile errors due to anonymous union initilization.
William Tu [Thu, 18 Feb 2016 02:00:22 +0000 (18:00 -0800)]
gcc: Fix compile errors due to anonymous union initilization.

gcc 4.4.7 lets you initialize named fields, and assign to anonymous union members,
but cannot statically initialize a named member of an anonymous union. This causes
errors when doing make:
fproto/fail-open.c: In function ‘send_bogus_packet_ins’:
ofproto/fail-open.c:130: error: unknown field ‘pin’ specified in initializer
ofproto/fail-open.c:131: error: unknown field ‘up’ specified in initializer
ofproto/fail-open.c:132: error: unknown field ‘packet’ specified in initializer
ofproto/fail-open.c:132: warning: missing braces around initializer
ofproto/fail-open.c:132: warning: (near initialization for ‘am.<anonymous>.pin.up’)
ofproto/fail-open.c:134: error: extra brace group at end of initializer

Examaple: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42875
We can either assign a name to the union or, in this patch, remove the unnecessary union.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoINSTALL.md: Fix shell command line formatting.
Jarno Rajahalme [Fri, 29 Jan 2016 23:18:14 +0000 (15:18 -0800)]
INSTALL.md: Fix shell command line formatting.

Some shell command lines were quoted inconsistently from others.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Better tolerate file system restriction on file name length.
Ben Pfaff [Tue, 16 Feb 2016 19:13:35 +0000 (11:13 -0800)]
tests: Better tolerate file system restriction on file name length.

ecryptfs on Linux restricts file names to 143 bytes, but these two tests
used a 150-byte name.  This commit fixes the specific problem on ecryptfs
by reducing the name it test to 143 bytes.  It also fixes the more general
problem of name length restrictions by skipping the test, rather than
failing it, if a directory with the 143-byte name cannot be created, since
the most likely problem is that the name is too long for the file system.

Reported-by: Zoltán Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agohmap: Add extra build-time iteration checks for types derived from hmap.
Ben Pfaff [Tue, 9 Feb 2016 00:52:45 +0000 (16:52 -0800)]
hmap: Add extra build-time iteration checks for types derived from hmap.

Some of our data structures derived from hmap use the same member names.
This means it's possible to confuse them in iteration, e.g. to iterate a
shash with SIMAP_FOR_EACH.  Of course this will crash at runtime, but it
seems even better to catch it at compile time.

An alternative would be to use unique member names, e.g. shash_map and
simap_map instead of just map.  I like short names, though.

It's kind of nasty that we need support from the hmap code to do this.
An alternative would be to insert the build assertions as statements before
the for loop.  But that would cause nasty surprises if someone forgets the
{} around a block of statements; even though the OVS coding style requires
them in all cases, I suspect that programmers doing debugging, etc. tend
to omit them sometimes.

It's not actually necessary to have multiple variants of these macros,
e.g. one can write a C99-compliant HMAP_FOR_EACH that accepts 3 or 4 or
more arguments.  But such a macro is harder to read, so I don't know
whether this is a good tradeoff.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
8 years agoofp-actions: Introduce macro for padding struct members.
Ben Pfaff [Thu, 18 Feb 2016 18:12:04 +0000 (10:12 -0800)]
ofp-actions: Introduce macro for padding struct members.

An upcoming commit will add another case where it's desirable to ensure
that a variable-length array is aligned on an 8-byte boundary.  This macro
makes that a little easier.

Signed-off-by: Ben Pfaff <blp@ovn.org>
CC: Joe Stringer <joe@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agopinctrl: Fix header guard.
Ben Pfaff [Thu, 18 Feb 2016 16:10:42 +0000 (08:10 -0800)]
pinctrl: Fix header guard.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoImplement serializing the state of packet traversal in "continuations".
Ben Pfaff [Sat, 20 Feb 2016 00:10:06 +0000 (16:10 -0800)]
Implement serializing the state of packet traversal in "continuations".

One purpose of OpenFlow packet-in messages is to allow a controller to
interpose on the path of a packet through the flow tables.  If, for
example, the controller needs to modify a packet in some way that the
switch doesn't directly support, the controller should be able to
program the switch to send it the packet, then modify the packet and
send it back to the switch to continue through the flow table.

That's the theory.  In practice, this doesn't work with any but the
simplest flow tables.  Packet-in messages simply don't include enough
context to allow the flow table traversal to continue.  For example:

    * Via "resubmit" actions, an Open vSwitch packet can have an
      effective "call stack", but a packet-in can't describe it, and
      so it would be lost.

    * A packet-in can't preserve the stack used by NXAST_PUSH and
      NXAST_POP actions.

    * A packet-in can't preserve the OpenFlow 1.1+ action set.

    * A packet-in can't preserve the state of Open vSwitch mirroring
      or connection tracking.

This commit introduces a solution called "continuations".  A continuation
is the state of a packet's traversal through OpenFlow flow tables.  A
"controller" action with the "pause" flag, which is newly implemented in
this commit, generates a continuation and sends it to the OpenFlow
controller in a packet-in asynchronous message (only NXT_PACKET_IN2
supports continuations, so the controller must configure them with
NXT_SET_PACKET_IN_FORMAT).  The controller processes the packet-in,
possibly modifying some of its data, and sends it back to the switch with
an NXT_RESUME request, which causes flow table traversal to continue.  In
principle, a single packet can be paused and resumed multiple times.

Another way to look at it is:

    - "pause" is an extension of the existing OFPAT_CONTROLLER
      action.  It sends the packet to the controller, with full
      pipeline context (some of which is switch implementation
      dependent, and may thus vary from switch to switch).

    - A continuation is an extension of OFPT_PACKET_IN, allowing for
      implementation dependent metadata.

    - NXT_RESUME is an extension of OFPT_PACKET_OUT, with the
      semantics that the pipeline processing is continued with the
      original translation context from where it was left at the time
      it was paused.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-prop: Add support for putting and parsing nested properties.
Ben Pfaff [Fri, 19 Feb 2016 23:56:52 +0000 (15:56 -0800)]
ofp-prop: Add support for putting and parsing nested properties.

It hadn't occurred to me before that any special support was actually
necessary or useful for nested properties, but the functions introduced in
this commit are nice wrappers to deal with the extra 4-byte padding that
ensures that the nested properties begin on 8-byte boundaries just like
the outer properties.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoSupport userdata in NXT_PACKET_IN2.
Ben Pfaff [Fri, 19 Feb 2016 23:53:26 +0000 (15:53 -0800)]
Support userdata in NXT_PACKET_IN2.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-util: Rename struct ofputil_packet_in member 'len' to 'packet_len'.
Ben Pfaff [Wed, 17 Feb 2016 08:31:11 +0000 (00:31 -0800)]
ofp-util: Rename struct ofputil_packet_in member 'len' to 'packet_len'.

An upcoming commit will introduce another member that has a length, and
it seems weird that bare 'len' would be one or the other.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoImplement new packet-in format NXT_PACKET_IN2.
Ben Pfaff [Fri, 19 Feb 2016 23:31:37 +0000 (15:31 -0800)]
Implement new packet-in format NXT_PACKET_IN2.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member.
Ben Pfaff [Wed, 17 Feb 2016 21:14:26 +0000 (13:14 -0800)]
ofp-util: Remove 'const' from struct ofputil_packet_in's 'packet' member.

It's not const in all cases so it doesn't entirely make sense to mark
it const here.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofpbuf: New function ofpbuf_const_initializer().
Ben Pfaff [Thu, 18 Feb 2016 23:13:09 +0000 (15:13 -0800)]
ofpbuf: New function ofpbuf_const_initializer().

A number of times I've looked at code and thought that it would be easier
to understand if I could write an initializer instead of
ofpbuf_use_const().  This commit adds a function for that purpose and
adapts a lot of code to use it, in the places where I thought it made
the code better.

In theory this could improve code generation since the new function can
be inlined whereas ofpbuf_use_const() isn't.  But I guess that's probably
insignificant; the intent of this change is code readability.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoINSTALL.DPDK.md: Correct mergeable buffers parameter.
Ian Stokes [Wed, 10 Feb 2016 10:50:54 +0000 (10:50 +0000)]
INSTALL.DPDK.md: Correct mergeable buffers parameter.

Update the mergeable buffers paramaters in performance tuning
to the correct parameter mrg_rxbuf.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agoINSTALL.DPDK: Update details of XL710 restrictions for DPDK 2.2.
Ian Stokes [Tue, 9 Feb 2016 14:48:47 +0000 (14:48 +0000)]
INSTALL.DPDK: Update details of XL710 restrictions for DPDK 2.2.

DPDK 2.2 removes restrictions related to maximum number of TX
queues for XL710 devices. Update documentation to reflect these
changes.

Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
8 years agotypes: Fix defined but not used warning.
William Tu [Fri, 19 Feb 2016 21:35:55 +0000 (13:35 -0800)]
types: Fix defined but not used warning.

warning: ‘OVS_BE128_MAX’ defined but not used [-Wunused-const-variable]
Found using CentOS 6.6 with gcc 6.0.0.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotests: Add mirror-related keywords to all the mirroring tests.
Ben Pfaff [Fri, 5 Feb 2016 23:30:26 +0000 (15:30 -0800)]
tests: Add mirror-related keywords to all the mirroring tests.

Autotest isn't too smart, so if you try to use "mirroring" as a keyword
before this commit it doesn't select most of the tests due to the comma in
the test names.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: Don't consider mirrors used when excluded by VLAN.
Ben Pfaff [Sat, 6 Feb 2016 03:16:01 +0000 (19:16 -0800)]
ofproto-dpif-xlate: Don't consider mirrors used when excluded by VLAN.

Mirrors can be configured to select packets for mirroring on the basis
of multiple criteria: input ports, output ports, and VLANs.  A packet P
is to be mirrored if there exists a mirror M such that either:

    - P ingresses on an input port selected by M, or

    - P egresses on an output port selected by M

AND P is in a VLAN selected by M.

In addition, every mirror has a destination, which can be an output port
or an output VLAN.  Either way, if a packet is mirrored to a particular
destination, it is done only once, even if different mirrors both select
a packet and have the same destination.

Since commit efbc3b7c4006c (ofproto-dpif-xlate: Rewrite mirroring to better
fit flow translation.), these requirements have been implemented
incorrectly: if a packet satisfies one of the bulleted requirements
above for mirror M1, but not the VLAN selection requirement for M1,
then it was not sent to M's destination, but it was still considered
as having been sent to M1's destination for the purpose of avoid output
duplication.  Thus, if P satisfied *all* of the requirements for a
second mirror M2, if M1 and M2 had the same destination, the packet was
still not mirrored.  This commit fixes that problem.

(The issue only occurred if M1 happened to have a smaller index than
M2 in OVS's internal data structures.  That's just a matter of luck.)

Reported-by: Huanle Han <hanxueluo@gmail.com>
Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064531.html
Fixes: 7efbc3b7c4006c (ofproto-dpif-xlate: Rewrite mirroring to better fit flow translation.)
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-msgs: Move most OpenFlow header definitions here.
Ben Pfaff [Wed, 27 Jan 2016 23:50:00 +0000 (15:50 -0800)]
ofp-msgs: Move most OpenFlow header definitions here.

This code was the only user for OpenFlow header definitions other than
struct ofp_header itself.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofp-msgs: Add support for ONF extension messages.
Ben Pfaff [Wed, 27 Jan 2016 23:46:41 +0000 (15:46 -0800)]
ofp-msgs: Add support for ONF extension messages.

ONF introduced a number of "standard extensions" that use its own
vendor (experimenter) ID.  This commit adds support for such extensions to
ofp-msgs.

These extensions were already half-supported, so there's barely any change
to build-aux/extract-ofp-msgs.

This isn't fully tested, since nothing adds support for such a message yet.

Requested-by: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agodatapath: lisp: Relax MTU constraints.
Joe Stringer [Sat, 13 Feb 2016 12:47:13 +0000 (04:47 -0800)]
datapath: lisp: Relax MTU constraints.

Currently, even if the entire path supports jumbo frames, the LISP netdev
limits the path MTU to 1500 bytes, and cannot be configured otherwise.
Relax the constraints on modifying the device MTU, and set it to the
maximum by default.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: stt: Relax MTU constraints.
Joe Stringer [Sat, 13 Feb 2016 12:32:36 +0000 (04:32 -0800)]
datapath: stt: Relax MTU constraints.

Currently, even if the entire path supports jumbo frames, the STT netdev
limits the path MTU to 1500 bytes, and cannot be configured otherwise.
Relax the constraints on modifying the device MTU, and set it to the
maximum by default.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: geneve: Refine MTU limit.
David Wragg [Thu, 18 Feb 2016 17:43:29 +0000 (17:43 +0000)]
datapath: geneve: Refine MTU limit.

Upstream commit:
    Calculate the maximum MTU taking into account the size of headers
    involved in GENEVE encapsulation, as for other tunnel types.

    Changes in v3:
    - Correct comment style
    Changes in v2:
    - Conform more closely to ip_tunnel_change_mtu
    - Exclude GENEVE options from max MTU calculation

Signed-off-by: David Wragg <david@weave.works>
Acked-by: Jesse Gross <jesse@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: aeee0e66c6b4 ("geneve: Refine MTU limit")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: Set a large MTU on tunnel devices.
David Wragg [Wed, 10 Feb 2016 00:05:58 +0000 (00:05 +0000)]
datapath: Set a large MTU on tunnel devices.

Upstream commit:
    Prior to 4.3, openvswitch tunnel vports (vxlan, gre and geneve) could
    transmit vxlan packets of any size, constrained only by the ability to
    send out the resulting packets.  4.3 introduced netdevs corresponding
    to tunnel vports.  These netdevs have an MTU, which limits the size of
    a packet that can be successfully encapsulated.  The default MTU
    values are low (1500 or less), which is awkwardly small in the context
    of physical networks supporting jumbo frames, and leads to a
    conspicuous change in behaviour for userspace.

    Instead, set the MTU on openvswitch-created netdevs to be the relevant
    maximum (i.e. the maximum IP packet size minus any relevant overhead),
    effectively restoring the behaviour prior to 4.3.

Signed-off-by: David Wragg <david@weave.works>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 7e059158d57b ("vxlan, gre, geneve: Set a large MTU on ovs-created
tunnel devices")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: geneve: Relax MTU constraints.
David Wragg [Wed, 10 Feb 2016 00:05:57 +0000 (00:05 +0000)]
datapath: geneve: Relax MTU constraints.

Upstream commit:
    Allow the MTU of geneve devices to be set to large values, in order to
    exploit underlying networks with larger frame sizes.

    GENEVE does not have a fixed encapsulation overhead (an openvswitch
    rule can add variable length options), so there is no relevant maximum
    MTU to enforce.  A maximum of IP_MAX_MTU is used instead.
    Encapsulated packets that are too big for the underlying network will
    get dropped on the floor.

Signed-off-by: David Wragg <david@weave.works>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 55e5bfb53cff ("geneve: Relax MTU constraints")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agodatapath: vxlan: Relax MTU constraints.
David Wragg [Wed, 10 Feb 2016 00:05:55 +0000 (00:05 +0000)]
datapath: vxlan: Relax MTU constraints.

Upstream commit:
    Allow the MTU of vxlan devices without an underlying device to be set
    to larger values (up to a maximum based on IP packet limits and vxlan
    overhead).

    Previously, their MTUs could not be set to higher than the
    conventional ethernet value of 1500.  This is a very arbitrary value
    in the context of vxlan, and prevented vxlan devices from being able
    to take advantage of jumbo frames etc.

    The default MTU remains 1500, for compatibility.

Signed-off-by: David Wragg <david@weave.works>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 72564b59ffc4 ("vxlan: Relax MTU constraints")
Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agoovn: Reorganize action parsing test.
Ben Pfaff [Fri, 4 Dec 2015 22:26:47 +0000 (14:26 -0800)]
ovn: Reorganize action parsing test.

It seems easier to understand if all of the tests for a given action
are grouped together.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoexpr: Generalize wording of error message in expand_symbol().
Ben Pfaff [Fri, 4 Dec 2015 22:12:05 +0000 (14:12 -0800)]
expr: Generalize wording of error message in expand_symbol().

The existing wording was very specific to the actual operation being
performed.  While this is nice for users, it becomes difficult to maintain
as more and more operations are added.  This commit makes the wording less
specific, because a third operation will start using this function in an
upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
8 years agoofproto-dpif-xlate: Distinguish "freezing" from "recirculation".
Ben Pfaff [Tue, 16 Feb 2016 18:51:58 +0000 (10:51 -0800)]
ofproto-dpif-xlate: Distinguish "freezing" from "recirculation".

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: Break recirculation actions out from action_set.
Ben Pfaff [Fri, 29 Jan 2016 01:11:19 +0000 (17:11 -0800)]
ofproto-dpif-xlate: Break recirculation actions out from action_set.

In my opinion, this is less confusing in multiple ways.  I now understand
the code better myself.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: New helper function ctx_cancel_recirculation().
Ben Pfaff [Fri, 29 Jan 2016 00:35:11 +0000 (16:35 -0800)]
ofproto-dpif-xlate: New helper function ctx_cancel_recirculation().

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofproto-dpif-xlate: Improve recirc_unroll_actions() interface.
Ben Pfaff [Fri, 29 Jan 2016 00:27:32 +0000 (16:27 -0800)]
ofproto-dpif-xlate: Improve recirc_unroll_actions() interface.

This interface is still straightforward and easier for the client.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agoofpbuf: Make ofpbuf_put_hex() accept period between hex bytes also.
Ben Pfaff [Wed, 10 Feb 2016 23:54:43 +0000 (15:54 -0800)]
ofpbuf: Make ofpbuf_put_hex() accept period between hex bytes also.

This makes it accept the same syntax as parse_NOTE(), so that that function
can be simplified.  In an upcoming commit a second action will also be
able to take advantage of the same feature.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agodynamic-string: Make ds_chomp() return true if it removed a character.
Ben Pfaff [Wed, 10 Feb 2016 04:54:03 +0000 (20:54 -0800)]
dynamic-string: Make ds_chomp() return true if it removed a character.

This will be used in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
8 years agotunneling: Disable IPv6 tunnel
Pravin B Shelar [Thu, 11 Feb 2016 09:05:16 +0000 (01:05 -0800)]
tunneling: Disable IPv6 tunnel

There are multiple issues in IPv6 userspace tunnel
implementation. Even the kernel module that ships with
2.5 does not support IPv6 tunneling. There is not
enough time to get all fixes in branch-2.5. So it make
sense to disable the support on 2.5.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Jesse Gross <jesse@kernel.org>
8 years agoopenflow-common: Describe length and padding rules for OpenFlow properties.
Ben Pfaff [Tue, 16 Feb 2016 23:33:42 +0000 (15:33 -0800)]
openflow-common: Describe length and padding rules for OpenFlow properties.

I keep having to rediscover these from the code.  This is easier.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
8 years agodatapath-windows: Enable multiprocessor compilation on solution
Alin Serdean [Thu, 11 Feb 2016 02:30:32 +0000 (02:30 +0000)]
datapath-windows: Enable multiprocessor compilation on solution

Visual Studio defines by default the maximum number of concurrent jobs.

This patch allows the parallel built of the solution.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-traffic: Add IPv6-over-vxlan-over-IPv4 tests.
Joe Stringer [Fri, 29 Jan 2016 19:37:54 +0000 (11:37 -0800)]
system-traffic: Add IPv6-over-vxlan-over-IPv4 tests.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-traffic: Add IP fragmentation expiry tests.
Joe Stringer [Fri, 29 Jan 2016 19:37:53 +0000 (11:37 -0800)]
system-traffic: Add IP fragmentation expiry tests.

These tests indirectly trigger the kernel IP fragment expiry code by
ensuring that not all fragments are assembled.

This reproduces the bug that was fixed in the following commit:
bf1f0d35ceb9 datapath: Fix IPv6 fragment expiry crash.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-traffic: Make vxlan frag test more reliable.
Joe Stringer [Fri, 29 Jan 2016 19:37:52 +0000 (11:37 -0800)]
system-traffic: Make vxlan frag test more reliable.

Depending on the kernel version in use, the nf_conntrack module may
register hooks for each namespace and execute conntrack prior to passing
packets to OVS (or not). In cases where this happens, the previous flow
table in this test would trust the local stack's connection tracking and
use it rather than sending packets through conntrack itself (and
therefore handling IP defragmentation/fragmentation).

This patch revealed two fatal datapath bugs, fixed by these commits:
86c2eb45fd82 datapath: Fix panic sending IP frags over tunnels.
792e5ed750ce datapath: inet: frag: Always orphan skbs inside ip_defrag().

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosystem-traffic: Fix typo in IPv6 tests.
Joe Stringer [Fri, 29 Jan 2016 19:37:51 +0000 (11:37 -0800)]
system-traffic: Fix typo in IPv6 tests.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agonetdev-linux: Fix warning message.
Thadeu Lima de Souza Cascardo [Mon, 15 Feb 2016 17:14:21 +0000 (15:14 -0200)]
netdev-linux: Fix warning message.

Instead of reading

"error receiving Ethernet packet on Permission denied: ens3",

it should read

"error receiving Ethernet packet on ens3: Permission denied".

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agonetlink-socket: return correct error code when connect fails
Thadeu Lima de Souza Cascardo [Mon, 15 Feb 2016 17:13:30 +0000 (15:13 -0200)]
netlink-socket: return correct error code when connect fails

When connect and other calls fail after get_socket_rcvbuf, the return code would
be the rcvbuf size, not errno from the last call.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
8 years agolib: Remove unused function prototypes
Andy Zhou [Fri, 12 Feb 2016 18:36:51 +0000 (10:36 -0800)]
lib: Remove unused function prototypes

Found by inspection.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agobuild windows: Update OpenSSL download link
Alin Serdean [Thu, 11 Feb 2016 01:12:46 +0000 (01:12 +0000)]
build windows: Update OpenSSL download link

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

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
8 years agoexpr: Fix memory leak reported by valgrind.
William Tu [Thu, 11 Feb 2016 17:45:08 +0000 (09:45 -0800)]
expr: Fix memory leak reported by valgrind.

Testcase 1728: ovn -- 5-term mixed expression normalization.
    expr_clone_cmp (expr.c:1259)
    expr_clone (expr.c:1284)
    expr_clone_andor (expr.c:1271)
    expr_clone (expr.c:1288)
    expr_normalize_and (expr.c:2137)
    test_tree_shape_exhaustively (test-ovn.c:926)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agoexpr: Fix memory leak reported by valgrind.
William Tu [Thu, 11 Feb 2016 17:45:07 +0000 (09:45 -0800)]
expr: Fix memory leak reported by valgrind.

Testcase 1728: ovn -- 5-term mixed expression normalization
Call stack:
    sset_add__ (sset.c:53)
    crush_and_string (expr.c:1725)
    crush_cmps (expr.c:1998)
    expr_sort (expr.c:2050)
    expr_normalize_and (expr.c:2085)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
8 years agodatapath-windows: Refactor sofware offloads and mss
Alin Serdean [Thu, 11 Feb 2016 01:38:54 +0000 (01:38 +0000)]
datapath-windows: Refactor sofware offloads and mss

The purpose of this patch is to refactor the software offloads found in
the VXLAN and GRE code and also to refactor how the maximmum segment
size for a given NBL is obtained.

This patch introduces two functions OvsApplySWChecksumOnNB and OVSGetTcpMSS.

OVSGetTcpMSS - will return the mss found in a given NBL.

OvsApplySWChecksumOnNB - will compute and set software offloads for a given
                         NBL.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sorin Vinturis <svinturis at cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agocompiler: Don't require constructor names to be globally unique in MSVC.
Ben Pfaff [Wed, 10 Feb 2016 23:43:22 +0000 (15:43 -0800)]
compiler: Don't require constructor names to be globally unique in MSVC.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agocompiler: Document OVS_CONSTRUCTOR.
Ben Pfaff [Wed, 10 Feb 2016 23:43:21 +0000 (15:43 -0800)]
compiler: Document OVS_CONSTRUCTOR.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agodatapath-windows: Fix small bug in MPLS
Alin Serdean [Thu, 11 Feb 2016 00:14:32 +0000 (00:14 +0000)]
datapath-windows: Fix small bug in MPLS

The keylen is not properly updated in the case of MPLS, directly causing the
hash to be calculated improperly.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-server: Eliminating max session limit
andy zhou [Wed, 10 Feb 2016 22:33:45 +0000 (14:33 -0800)]
ovsdb-server: Eliminating max session limit

This patch removes limits on number of concurrent sessions
allowed by ovsdb-server. Historically, it was not an design
goal for OVSDB server to support very high number of sessions.
The imposed limit reflects those design choices.

Work is now underway to improve OVSDB scalability since supporting
large of number of sessions is important for OVN, Removing
this limit makes scalability testing possible.

Signed-off-by: Andy Zhou <azhou@ovn.org>
Acked-by: Han Zhou <zhouhan@gmail.com>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agovlog: Fix windows build.
Russell Bryant [Wed, 10 Feb 2016 22:03:32 +0000 (17:03 -0500)]
vlog: Fix windows build.

A recent change changed this constructor to "init_this_module".  This
breaks the build on windows according to AppVeyor.  Include the module
name in the constructor name to work around the issue.

Fixes: 922fed065e65 ("vlog: Make the most common module reference more direct.")
Signed-off-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agovlog: Use log_file_mutex to more consistently protect vlog_modules.
Ben Pfaff [Wed, 3 Feb 2016 21:47:25 +0000 (13:47 -0800)]
vlog: Use log_file_mutex to more consistently protect vlog_modules.

This could be beneficial if we ever insert a new module at runtime
(currently we only insert them at startup) and it should have negligible
cost.

Suggested-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agovlog: Add vlog/close command.
Ben Pfaff [Wed, 3 Feb 2016 21:41:34 +0000 (13:41 -0800)]
vlog: Add vlog/close command.

Requested-by: P R Dinesh
Requested-at: https://github.com/openvswitch/ovs/pull/94
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agovlog: Make the most common module reference more direct.
Ben Pfaff [Wed, 3 Feb 2016 21:21:10 +0000 (13:21 -0800)]
vlog: Make the most common module reference more direct.

Most vlog calls are for the log module owned by the translation unit being
compiled, but this module was referenced indirectly through a pointer
variable.  That seems silly, so this commit changes the code so that the
local vlog module is referred to directly, as &this_module.

We could get rid of the global variables for vlog modules entirely, but
I like getting linker errors when there's a duplicate module name.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agopinctrl: Fix byte order of numeric constant.
Ben Pfaff [Wed, 10 Feb 2016 21:16:47 +0000 (13:16 -0800)]
pinctrl: Fix byte order of numeric constant.

Found by sparse.

Fixes: commit 660f5a61286 ("ovn-controller: Use ofputil_encode_set_config to set the switch config")
Reported-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agoovn-controller: Use ofputil_encode_set_config to set the switch config
Numan Siddique [Wed, 10 Feb 2016 20:18:58 +0000 (12:18 -0800)]
ovn-controller: Use ofputil_encode_set_config to set the switch config

This is cleaner.

Signed-off-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agopinctrl: Fix decoding of OFPT_GET_CONFIG_REPLY messages.
Ben Pfaff [Wed, 10 Feb 2016 20:18:46 +0000 (12:18 -0800)]
pinctrl: Fix decoding of OFPT_GET_CONFIG_REPLY messages.

Fixes: ad99e2ed49 (Better abstract OFPT_SET_CONFIG and OFPT_GET_CONFIG_REPLY, make stricter.)
Reported-by: Numan Siddique <nusiddiq@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovsdb-client: Fix memory leak reported by valgind.
William Tu [Tue, 9 Feb 2016 22:31:16 +0000 (14:31 -0800)]
ovsdb-client: Fix memory leak reported by valgind.

Testcase 1429: ovsdb-server/add-db and remove-db.
    xmemdup0 (util.c:142)
    main (ovsdb-client.c:133)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agotest-ovsdb: Fix memory leak reported by valgrind.
William Tu [Tue, 9 Feb 2016 22:15:13 +0000 (14:15 -0800)]
test-ovsdb: Fix memory leak reported by valgrind.

Testcase 1314: UUID-distinct queries on scalars.
Call stacks:
    allocate_row (row.c:37)
    ovsdb_row_clone (row.c:67)
    do_query_distinct (test-ovsdb.c:1232)
    ovs_cmdl_run_command (command-line.c:121)
    main (test-ovsdb.c:72)

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agoovn: Support ingress policing settings for VIFs.
Ben Pfaff [Wed, 10 Feb 2016 19:09:12 +0000 (11:09 -0800)]
ovn: Support ingress policing settings for VIFs.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Co-authored-by: Babu Shanmugam <bschanmu@redhat.com>
Signed-off-by: Babu Shanmugam <bschanmu@redhat.com>
8 years agotest-ovn: Add help output for parse-actions command.
Ben Pfaff [Wed, 10 Feb 2016 05:08:13 +0000 (21:08 -0800)]
test-ovn: Add help output for parse-actions command.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agodist-docs: Convert tabs to spaces.
Russell Bryant [Tue, 9 Feb 2016 17:53:42 +0000 (12:53 -0500)]
dist-docs: Convert tabs to spaces.

This file used mixed indentation.  Convert the tabs to spaces for
consistency.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodist-docs: Fix relative links.
Russell Bryant [Tue, 9 Feb 2016 17:46:46 +0000 (12:46 -0500)]
dist-docs: Fix relative links.

There are some relative links designed to work on github.  These links
are broken within dist-docs.  Adding a symbolic link from the original
filename to the plain text version makes these links work within
dist-docs.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agodist-docs: Install plaintext files properly.
Ben Pfaff [Tue, 9 Feb 2016 04:18:35 +0000 (20:18 -0800)]
dist-docs: Install plaintext files properly.

We shouldn't try to treat every file as Markdown.

Signed-off-by: Ben Pfaff <blp@ovn.org>
8 years agodist-docs: Make GNU make aware of sub-make.
Ben Pfaff [Tue, 9 Feb 2016 04:18:34 +0000 (20:18 -0800)]
dist-docs: Make GNU make aware of sub-make.

When GNU make sees that a command to be executed contains the string
$(MAKE), it makes the jobserver that limits parallelism available to
the command.  Otherwise, any sub-make that executes sees that
parallelism is enabled but does not have access to the jobserver, so
it prints a warning and turns off parallel job execution.

This also makes the dist-docs process run the same "make" that is
executed at the top level, in case that's different from the default
"make" found in $PATH.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agodist-docs: Include Documentation/ in dist-docs.
Russell Bryant [Mon, 8 Feb 2016 17:12:41 +0000 (12:12 -0500)]
dist-docs: Include Documentation/ in dist-docs.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
8 years agosset: Make sset iteration check the type of the nodes it's iterating.
Ben Pfaff [Tue, 9 Feb 2016 00:52:44 +0000 (16:52 -0800)]
sset: Make sset iteration check the type of the nodes it's iterating.

Without this additional check, SSET_FOR_EACH is happy to iterate over any
type that has a struct hmap member named 'map'.  We have a number of these:
hmapx, shash, simap, and smap, in addition to sset.

I guess another approach would be give each of these a unique member name,
but the short name 'map' is nice too.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
8 years agoutil: New macro BUILD_ASSERT_TYPE.
Ben Pfaff [Tue, 9 Feb 2016 00:52:43 +0000 (16:52 -0800)]
util: New macro BUILD_ASSERT_TYPE.

I intend to make further use of this in upcoming commits.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>