sliver-openvswitch.git
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Tue, 26 Nov 2013 15:56:56 +0000 (16:56 +0100)]
Merge branch 'mainstream'

10 years agoAvoid printf type modifiers not supported by MSVC C runtime library.
Alin Serdean [Tue, 26 Nov 2013 07:38:48 +0000 (23:38 -0800)]
Avoid printf type modifiers not supported by MSVC C runtime library.

The MSVC C library printf() implementation does not support the 'z', 't',
'j', or 'hh' format specifiers.  This commit changes the Open vSwitch code
to avoid those format specifiers, switching to standard macros from
<inttypes.h> where available and inventing new macros resembling them
where necessary.  It also updates CodingStyle to specify the macros' use
and adds a Makefile rule to report violations.

Signed-off-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agosparse: Include stddef.h to ensure NULL is defined.
Simon Horman [Mon, 25 Nov 2013 03:41:33 +0000 (12:41 +0900)]
sparse: Include stddef.h to ensure NULL is defined.

Include stddef.h in include/sparse/sys/socket.h to ensure
that NULL is defined and thus avoid the following sparse warning.

./include/sparse/sys/socket.h:74:15: error: undefined identifier 'NULL'

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Sun, 24 Nov 2013 08:34:46 +0000 (09:34 +0100)]
Merge branch 'mainstream'

10 years agoopenflow-1.2.h: Fix definition of OXM_OF_PBB_ISID.
Ben Pfaff [Fri, 22 Nov 2013 23:58:31 +0000 (15:58 -0800)]
openflow-1.2.h: Fix definition of OXM_OF_PBB_ISID.

The ONF header file shows this as a 3-byte field.

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agodatapath: gre: Fix kernel 3.11 compatibility.
Pravin B Shelar [Wed, 20 Nov 2013 17:50:14 +0000 (09:50 -0800)]
datapath: gre: Fix kernel 3.11 compatibility.

On 3.11 kernel, gre module exports IP_GRE demux API, ovs needs
to use it to register for GRE protocol handler.

Reported-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Tested-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodebian: Don't recreate bridges during manual restart.
Gurucharan Shetty [Wed, 20 Nov 2013 21:43:45 +0000 (13:43 -0800)]
debian: Don't recreate bridges during manual restart.

Open vSwitch bridges and ports can be configured through
the /etc/network/interfaces script. During system startup,
Open vSwitch startup script reads the interfaces file
and creates the bridges and ports. During system shutdown,
the bridges and ports are removed.

The same behavior also can occur with a manual 'restart' of
Open vswitch (ex: service openvswitch-switch restart).
This behavior has come across as undesirable in some cases.
ex: When some one manually creates interfaces through ovs-vsctl
and then restarts Open vSwitch, that interface is lost.

This commit changes the startup script such that, interfaces
are created and deleted through the startup script only when
RUNLEVEL environment variable is set. This behavior will be
consistent with the OVS RHEL ifcfg-* scripts too.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-msgs: Fix limits of OFPMP_TABLE_FEATURES.
Alexander Wu [Thu, 21 Nov 2013 09:04:28 +0000 (17:04 +0800)]
ofp-msgs: Fix limits of OFPMP_TABLE_FEATURES.

Signed-off-by: Alexander Wu <alexander.wu@huawei.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoipfix: allow empty targets column in table IPFIX
Romain Lenglet [Wed, 20 Nov 2013 18:57:53 +0000 (10:57 -0800)]
ipfix: allow empty targets column in table IPFIX

The "targets" column in IPFIX had a min=1 constraints, so OVSDB
implicitly adds an empty string "" into that column if no value is
given.  No connection can be opened to a target with address "", so
the whole IPFIX exporter for that row was disabled until that ""
target was removed by users.  That behavior is correct but proved to
be unintuitive to users.

This patch removes the min=1 constraint, to avoid the trouble for
users who insert IPFIX rows with no targets: it eliminates the log
messages due to failed connections to target "", and eliminates the
need to manually remove the "" target after row insertion.

This doesn't impact the behavior for any existing row, whether it has
a "" target or not.

Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoipfix: fix segfault for Flow_Sample_Collector_Set without ipfix
Romain Lenglet [Wed, 20 Nov 2013 18:57:52 +0000 (10:57 -0800)]
ipfix: fix segfault for Flow_Sample_Collector_Set without ipfix

Guard any access to an IPFIX row referenced from
Flow_Sample_Collector_Set by a test that the reference is not NULL.

Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Add new key "flap_count" to "bfd_status".
Alex Wang [Wed, 20 Nov 2013 19:38:29 +0000 (11:38 -0800)]
bfd: Add new key "flap_count" to "bfd_status".

This commit adds a new key "flap_count" to "bfd_status" to count
the number of bfd "forwarding" flag flaps.  A flap is considered
as a change of the "forwarding" flag value.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Add forwarding flag to struct bfd.
Alex Wang [Wed, 20 Nov 2013 19:15:54 +0000 (11:15 -0800)]
bfd: Add forwarding flag to struct bfd.

This commit adds a forwarding flag to "struct bfd".  This flag
is for indicating the interface's capability of packet I/O.
Also, this flag makes it possible to count the number of interface
state flapping.  bfd_forwarding__() will update this flag at
each invocation.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocoverage: Synchronize per-thread counters less aggressively
Joe Stringer [Fri, 15 Nov 2013 23:25:00 +0000 (15:25 -0800)]
coverage: Synchronize per-thread counters less aggressively

When profiling CPU usage in situations involving high numbers of ports,
coverage_clear() was highlighted as a commonly called function. It
appears that it can be quite expensive to access all of the per-thread
coverage counters when threads are constantly waking up.

This patch makes each thread only do coverage_clear() logic roughly once
per second by introducing per-thread timers. Upcall handler counters may
become less accurate, as these threads may sleep without synchronising
and not wake up for some time. When the main thread is under load at
~90% CPU, this drops to ~85%. Upcall handler threads sitting at ~2.5%
drop to ~1.5%.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoMakefile.am: Distribute BUILD.Windows.
Ben Pfaff [Wed, 20 Nov 2013 17:42:47 +0000 (09:42 -0800)]
Makefile.am: Distribute BUILD.Windows.

Fixes a build failure:
    The distribution is missing the following files:
    BUILD.Windows

CC: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoFAQ: More explicitly draw attention to explanation of different flow types.
Ben Pfaff [Wed, 20 Nov 2013 17:07:13 +0000 (09:07 -0800)]
FAQ: More explicitly draw attention to explanation of different flow types.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoFAQ: Update description of datapath flows.
Ben Pfaff [Wed, 20 Nov 2013 16:55:10 +0000 (08:55 -0800)]
FAQ: Update description of datapath flows.

They have not been exact-match only for a while.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofp-actions: Make ofpacts_check() report consistency for all protocols.
Ben Pfaff [Fri, 15 Nov 2013 22:19:57 +0000 (14:19 -0800)]
ofp-actions: Make ofpacts_check() report consistency for all protocols.

Until now ofpacts_check() has been told either to enforce consistency or
not, but that means that the caller has to know exactly what protocol is
going to be in use (because some protocols require consistency to be
enforced and others don't).  This commit changes ofpacts_check() to just
rule out protocols that require enforcement when it detects
inconsistencies.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoBUILD.Windows: Some details on the proposed build system.
Gurucharan Shetty [Sun, 17 Nov 2013 17:25:34 +0000 (09:25 -0800)]
BUILD.Windows: Some details on the proposed build system.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocccl: Provide '-' before the options instead of double slash.
Gurucharan Shetty [Sun, 17 Nov 2013 02:49:06 +0000 (18:49 -0800)]
cccl: Provide '-' before the options instead of double slash.

While compiling Open vSwitch with visual c++ in
a mingw environment, I have observed that "//" before
options does not work for all the compiler options of
MSVC. Using "-" on the other hand seems to work.

Also, echo the command line options passed to
the MSVC compiler.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocccl: A wrapper that calls visual c++ compiler.
Gurucharan Shetty [Sun, 17 Nov 2013 02:36:38 +0000 (18:36 -0800)]
cccl: A wrapper that calls visual c++ compiler.

One option to compile Open vSwitch code in windows
is to use Visual c++ compiler.

From http://cccl.sourceforge.net/ :
"cccl is a wrapper around Microsoft Visual C++'s cl.exe
and link.exe.  It converts Unix compiler parameters
into parameters understood by cl and link.  cccl's main
use is for using Unix build processes with Microsoft
compilers. Using cccl in conjunction with ports of Unix
utilities, it is possible to build many Unix packages
using MSVC, without modifying the build process."

There are couple of forks of the project in the internet.
This particular piece is copied from:
https://gitorious.org/swift/swift/source/\
cf9b391b40a9c59a620c8093d438370381949c60:autoconf/cccl

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoMerge remote-tracking branch 'ovs-dev/master'
Giuseppe Lettieri [Wed, 20 Nov 2013 13:44:38 +0000 (14:44 +0100)]
Merge remote-tracking branch 'ovs-dev/master'

10 years agoClassifier: Staged subtable matching.
Jarno Rajahalme [Wed, 20 Nov 2013 01:31:29 +0000 (17:31 -0800)]
Classifier: Staged subtable matching.

Subtable lookup is performed in ranges defined for struct flow,
starting from metadata (registers, in_port, etc.), then L2 header, L3,
and finally L4 ports.  Whenever it is found that there are no matches
in the current subtable, the rest of the subtable can be skipped.  The
rationale of this logic is that as many fields as possible can remain
wildcarded.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agodatapath: Change ovs_flow_tbl_lookup_xx() APIs
Andy Zhou [Wed, 13 Nov 2013 20:04:40 +0000 (12:04 -0800)]
datapath: Change ovs_flow_tbl_lookup_xx() APIs

API changes only for code readability. No functional chnages.

This patch removes the underscored version. Added a new API ovs_flow_tbl_lookup_stats() that
returns the n_mask_hits.

Reported by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
10 years agoofproto-dpif: add support for layer 3 ports
Lorand Jakab [Tue, 19 Nov 2013 09:06:44 +0000 (11:06 +0200)]
ofproto-dpif: add support for layer 3 ports

Add member is_layer3 to struct ofport_dpif to mark layer 3 ports.  Set
it to "true" for the only layer 3 port we support for now: lisp.

Additionally, prevent flooding to layer 3 ports.  A later patch will
also prevent MAC learning.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutilities: Regenerate ovs-lib if configuration changes.
Ben Pfaff [Tue, 19 Nov 2013 19:02:08 +0000 (11:02 -0800)]
utilities: Regenerate ovs-lib if configuration changes.

Otherwise running "configure" twice with different --prefix (etc.) will
fail to update ovs-lib, so that "make install" installs an ovs-lib with
the wrong paths.

Reported-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoutil: Rename popcount to count_1bits
Ben Pfaff [Tue, 19 Nov 2013 18:59:10 +0000 (10:59 -0800)]
util: Rename popcount to count_1bits

This avoids a conflict with NetBSD's strings.h/libc.
(http://netbsd.gw.com/cgi-bin/man-cgi?popcount++NetBSD-current)

The new name is suggested by Ben Pfaff.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@gmail.com>
10 years agodatapath: Shrink sw_flow_mask by 8 bytes (64-bit) or 4 bytes (32-bit).
Ben Pfaff [Wed, 13 Nov 2013 17:50:54 +0000 (09:50 -0800)]
datapath: Shrink sw_flow_mask by 8 bytes (64-bit) or 4 bytes (32-bit).

We won't normally have a ton of flow masks but using a size_t to store
values no bigger than sizeof(struct sw_flow_key) seems excessive.

This reduces sw_flow_key_range and sw_flow_mask by 4 bytes on 32-bit
systems.  On 64-bit systems it shrinks sw_flow_key_range by 12 bytes but
sw_flow_mask only by 8 bytes due to padding.

Compile tested only.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agodatapath: Correct comment.
Ben Pfaff [Wed, 13 Nov 2013 17:33:26 +0000 (09:33 -0800)]
datapath: Correct comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoutil: Make popcount() handle 64-bit integers, not separate popcount64().
Ben Pfaff [Mon, 18 Nov 2013 21:18:41 +0000 (13:18 -0800)]
util: Make popcount() handle 64-bit integers, not separate popcount64().

Having a single function that can do popcount() on any integer type is
easier for callers to get right.  The implementation is probably slower
if the caller actually provides a 32-bit (or shorter) integer, but the
only existing callers always provide a full 64-bit integer so this seems
unimportant for now.

This also restores use, in practice, of the optimized implementation of
population count.  (As the comment on popcount32() says, this version is
2x faster than __builtin_popcount().)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoutil: Make raw_ctz() accept 64-bit integers.
Ben Pfaff [Mon, 18 Nov 2013 19:30:38 +0000 (11:30 -0800)]
util: Make raw_ctz() accept 64-bit integers.

Having a single function that can do raw_ctz() on any integer type is
easier for callers to get right, and there is no real downside in the
implementation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoMakefile.am: Make PYTHONPATH work on Mingw.
Gurucharan Shetty [Sun, 17 Nov 2013 03:23:13 +0000 (19:23 -0800)]
Makefile.am: Make PYTHONPATH work on Mingw.

The ":" used as a seperator does not work when
the make is run. ";" is the correct separator.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure: Windows can have spaces in directories.
Gurucharan Shetty [Sun, 17 Nov 2013 02:14:51 +0000 (18:14 -0800)]
configure: Windows can have spaces in directories.

Running ./configure and testing for python through PATH
gives out a bunch of errors because of the extra arguments.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure.ac: Identify when compiling on windows.
Gurucharan Shetty [Sat, 16 Nov 2013 19:42:46 +0000 (11:42 -0800)]
configure.ac: Identify when compiling on windows.

Presence of windows.h will set the WIN32 variable.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure.ac: Make autoconf in Mingw happy.
Gurucharan Shetty [Fri, 15 Nov 2013 23:32:09 +0000 (15:32 -0800)]
configure.ac: Make autoconf in Mingw happy.

Autoconf version 2.68 in Mingw environment does not
like the new lines in AC_CONFIG_FILES macro.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agominiflow: Use 64-bit map.
Jarno Rajahalme [Mon, 18 Nov 2013 17:28:44 +0000 (09:28 -0800)]
miniflow: Use 64-bit map.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/util: Add ctz64() and popcount64().
Jarno Rajahalme [Mon, 18 Nov 2013 17:28:44 +0000 (09:28 -0800)]
lib/util: Add ctz64() and popcount64().

Add raw_ctz64(), ctz64(), and popcount64() using builtins when
available.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/util: Make raw_ctz() implementation non-static.
Jarno Rajahalme [Mon, 18 Nov 2013 17:28:44 +0000 (09:28 -0800)]
lib/util: Make raw_ctz() implementation non-static.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-linux: Fix minor typo OVS_DP_ATTR_UPCALL_PID
Thomas Graf [Mon, 18 Nov 2013 14:24:10 +0000 (15:24 +0100)]
dpif-linux: Fix minor typo OVS_DP_ATTR_UPCALL_PID

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: Fix bad constant in ovs_scan() implementation on 64-bit.
Ben Pfaff [Fri, 15 Nov 2013 18:34:34 +0000 (10:34 -0800)]
util: Fix bad constant in ovs_scan() implementation on 64-bit.

scan_chars() compares an "unsigned int" against SIZE_MAX, which will
always be false on 64-bit architectures.  The correct constant is
UINT_MAX.

Reported-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Consider L4 actions after mpls_push as inconsistent
Simon Horman [Fri, 15 Nov 2013 09:10:18 +0000 (18:10 +0900)]
ofp-actions: Consider L4 actions after mpls_push as inconsistent

After an mpls_push action the resulting packet is MPLS and
the MPLS payload is opaque. Thus nothing can be assumed
about the packets network protocol and it is inconsistent
to apply L4 actions.

With regards to actions that affect the packet at other layers
of the protocol stack:

* L3: The consistency of L3 actions should already be handled correctly
  by virtue of the dl_type of the flow being temporarily altered
  during consistency checking by both push_mpls and pop_mpls actions.

* MPLS: The consistency checking of MPLS actions appear to already be
  handled correctly.

* VLAN: At this time Open vSwitch on mpls_push an MPLS LSE is always
  added after any VLAN tags that follow the ethernet header.
  That is the tag ordering defined prior to OpenFlow1.3. As such
  VLAN actions should sill be equally valid before and after mpls_push
  and mpls_pop actions.

* L2 actions are equally valid before and after mpls_push and mpls_pop actions.

Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoSwitch from sscanf() to ovs_scan() throughout the tree.
Ben Pfaff [Sat, 9 Nov 2013 23:44:23 +0000 (15:44 -0800)]
Switch from sscanf() to ovs_scan() throughout the tree.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: New function ovs_scan().
Ben Pfaff [Fri, 15 Nov 2013 16:54:56 +0000 (08:54 -0800)]
util: New function ovs_scan().

This new function is essentially an implementation of sscanf() with
slightly different behavior (see the comment) that is more convenient for
Open vSwitch internal use.  Also, this implementation ought to work out of
the box on Windows, which has a defective sscanf() that lacks the 'hh'
modifier required to scan into a char variable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobitmap: New macro BITMAP_N_LONGS for use in constant expressions.
Ben Pfaff [Sat, 9 Nov 2013 23:21:12 +0000 (15:21 -0800)]
bitmap: New macro BITMAP_N_LONGS for use in constant expressions.

An upcoming commit will declare a bitmap on the stack, rather than heap
allocating it, which means that it is not possible to use a function call
in the declaration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Fix typo in error message.
Ben Pfaff [Sat, 9 Nov 2013 23:12:12 +0000 (15:12 -0800)]
meta-flow: Fix typo in error message.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Maintain the original key during execution.
Jarno Rajahalme [Thu, 14 Nov 2013 22:35:58 +0000 (14:35 -0800)]
dpif-netdev: Maintain the original key during execution.

Userspace action needs the original flow key.  This also
matches the kernel datapath behavior.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodpif_netdev_execute: Extract flow key from the packet.
Jarno Rajahalme [Thu, 14 Nov 2013 22:35:58 +0000 (14:35 -0800)]
dpif_netdev_execute: Extract flow key from the packet.

Extract the flow key from the packet instead of the execute->key.
This reflects how the kernel datapath behaves.

Also use ofpbuf_clone_with_headroom() instead of open coding the same.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Remove unneeded redeclaration of vlog_rate_limit rl.
Marco Diego Aurélio Mesquita [Mon, 11 Nov 2013 18:54:06 +0000 (15:54 -0300)]
ofp-actions: Remove unneeded redeclaration of vlog_rate_limit rl.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoOPENFLOW-1.1+: Update MPLS items
Simon Horman [Thu, 14 Nov 2013 02:19:07 +0000 (11:19 +0900)]
OPENFLOW-1.1+: Update MPLS items

* MPLS BoS match is supported as much as other MPLS matches.
  That is, all that is missing is the kernel datapath side
  which is part my pending patchset.

* The rework of tag order does require work but it is
  covered by my pending patchset.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoFAQ, NEWS: Notes on TCP flags matching.
Jarno Rajahalme [Wed, 13 Nov 2013 19:19:56 +0000 (11:19 -0800)]
FAQ, NEWS: Notes on TCP flags matching.

Add a FAQ categorry "Performance Problems".  So far the only entry
addresses the issue with using a new kernel module with an older
(pre-megaflows) userspace.

10 years agoovs-ofctl: Document arp_spa and arp_tpa matches
Simon Horman [Wed, 13 Nov 2013 08:53:31 +0000 (17:53 +0900)]
ovs-ofctl: Document arp_spa and arp_tpa matches

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document set_mpls_{label,tc} actions
Simon Horman [Wed, 13 Nov 2013 06:19:17 +0000 (15:19 +0900)]
ovs-ofctl: Document set_mpls_{label,tc} actions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document mpls_{label,bos,tc} matches
Simon Horman [Wed, 13 Nov 2013 06:16:18 +0000 (15:16 +0900)]
ovs-ofctl: Document mpls_{label,bos,tc} matches

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: test ARP SPA and TPA load actions
Simon Horman [Wed, 13 Nov 2013 06:15:37 +0000 (15:15 +0900)]
ofproto-dpif: test ARP SPA and TPA load actions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document masked versions of arp_sha and arp_tha matches
Simon Horman [Wed, 13 Nov 2013 06:13:42 +0000 (15:13 +0900)]
ovs-ofctl: Document masked versions of arp_sha and arp_tha matches

Document masked versions of arp_sha and arp_tha matches.
Also update documentation of unmasked versions of these
matches to include an example address as is the case with
the documentation of dl_src and dl_dst.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Introduce a classifier in userspace datapath.
Gurucharan Shetty [Mon, 4 Nov 2013 14:23:54 +0000 (06:23 -0800)]
dpif-netdev: Introduce a classifier in userspace datapath.

Instead of an exact match flow table, we introduce a classifier.
This enables mega-flows in userspace datapath.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
[blp@nicira.com tweaked flow lookup]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetlink: Do not enforce alignment of last Netlink attribute
Thomas Graf [Mon, 11 Nov 2013 11:11:36 +0000 (12:11 +0100)]
netlink: Do not enforce alignment of last Netlink attribute

There is no reason to enforce padding after the last attribute.
Dropping this enforcement will ease efforts to implement zerocopy
upcall.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodpif: Document datapath masking.
Ben Pfaff [Wed, 13 Nov 2013 01:10:16 +0000 (17:10 -0800)]
dpif: Document datapath masking.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agobond: Use active-backup mode on LACP failure.
Ravi Kondamuru [Mon, 4 Nov 2013 23:07:10 +0000 (23:07 +0000)]
bond: Use active-backup mode on LACP failure.

Commit bdebeece5 (lacp: Require successful LACP negotiations when
configured.) makes successful LACP negotiation mandatory for the
bond to come UP. This patch provides a configuration option to
bring up the bond by falling back to active-backup mode on LACP
negotiation failure.

Several of the physical switches that support LACP block all traffic
for ports that are configured to use LACP, until LACP is negotiated
with the host. When configuring a LACP bond on a OVS host
(eg: XenServer), this means that there will be an interruption of the
network connectivity between the time the ports on the physical
switch and the bond on the OVS host are configured. The interruption
may be relatively long, if different people are responsible for
managing the switches and the OVS host.

Such network connectivity failure can be avoided if LACP can be
configured on the OVS host before configuring the physical switch,
and having the OVS host fall back to a bond mode (active-backup) till
the physical switch LACP configuration is complete. An option
"lacp-fallback-ab" is introduced with this patch to provide such
behavior on openvswitch.

Signed-off-by: Ravi Kondamuru <Ravi.Kondamuru@citrix.com>
Signed-off-by: Dominic Curran <Dominic.Curran@citrix.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto: Add enum ofp_table_config
Simon Horman [Tue, 12 Nov 2013 07:45:51 +0000 (16:45 +0900)]
ofproto: Add enum ofp_table_config

Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Add enum ofp_table
Simon Horman [Tue, 12 Nov 2013 07:45:50 +0000 (16:45 +0900)]
ofproto: Add enum ofp_table

Add enum ofp_table and use it for Flow Mod.

Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodebian: Avoid logrotate error if /var/run/openvswitch does not exist.
Alfredo Finelli [Tue, 12 Nov 2013 16:03:41 +0000 (08:03 -0800)]
debian: Avoid logrotate error if /var/run/openvswitch does not exist.

Signed-off-by: Alfredo Finelli <alf@computationes.de>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dev.py: Remove duplicate name from the help string.
Saurabh Shah [Mon, 11 Nov 2013 21:19:30 +0000 (13:19 -0800)]
ovs-dev.py: Remove duplicate name from the help string.

Signed-off-by: Saurabh Shah <ssaurabh@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Fix formatting of ipfix action cookies, to fix a testsuite failure
Ben Pfaff [Mon, 11 Nov 2013 21:32:23 +0000 (13:32 -0800)]
odp-util: Fix formatting of ipfix action cookies, to fix a testsuite failure

Problem introduced by previous commit 96ed775f19 (odp-util: Fix IPFIX
breakage with old kernel modules.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Fix IPFIX breakage with old kernel modules.
Ben Pfaff [Mon, 7 Oct 2013 21:26:28 +0000 (14:26 -0700)]
odp-util: Fix IPFIX breakage with old kernel modules.

Before commit e995e3df57ea (Allow OVS_USERSPACE_ATTR_USERDATA to be
variable length.) userdata attributes in userspace actions were expected
to be exactly 64 bits long.  The kernel only actually enforced that they
were at least 64 bits long (the previously referenced commit's log message
contains misinformation on this account).

Initially this was no problem, because all of the userdata that userspace
actually used was exactly 8 bytes long.  Commit 29089a540c (Implement IPFIX
export), however, exposed a problem by reducing the length of userdata for
IPFIX support to just 4 bytes.  This meant that IPFIX no longer worked on
older datapaths, because the userdata was no longer at least 8 bytes long.

This commit fixes the problem by padding out userdata attributes less than
8 bytes long to 8 bytes.

CC: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Romain Lenglet <rlenglet at vmware.com>
10 years agonetlink: New function nl_msg_put_unspec_zero().
Ben Pfaff [Mon, 7 Oct 2013 21:11:40 +0000 (14:11 -0700)]
netlink: New function nl_msg_put_unspec_zero().

This function already had a few potential users, which this commit
converts.  An upcoming commit adds more users.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Improve manpage.
Ben Pfaff [Mon, 6 May 2013 17:20:27 +0000 (10:20 -0700)]
ovs-ofctl: Improve manpage.

Fixes misspelling of "OpenFlow".

Fixes the indentation of the paragraph beginning "Any \fIreason\fR...".

Changes "target" to "action" in the introduction of actions, which seems
like a better name.

Reorders action descriptions to group all the simple forms of output
together.

Consistently mentions that output actions don't output to the input port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Switch away from odd use of "q" in "enqueue" action format.
Ben Pfaff [Mon, 6 May 2013 17:55:06 +0000 (10:55 -0700)]
ofp-actions: Switch away from odd use of "q" in "enqueue" action format.

The formatting of the "enqueue" action uses a "q" to separate the port
number from the queue number, as in "enqueue:123q456".  This is different
from every other action.  This commit improves the situation by:

    * Switching the formatting to use a colon (e.g. "enqueue:123:456"),
      which is a little less odd-looking but still accepted by older
      versions of Open vSwitch.

    * Improving the parser to accept "enqueue(123,456)" also.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: New unixctl command ofproto/trace-packet-out.
Ben Pfaff [Mon, 11 Nov 2013 18:50:47 +0000 (10:50 -0800)]
ofproto-dpif: New unixctl command ofproto/trace-packet-out.

Feature #20543.
Requested-by: Ronghua Zhang <rzhang@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Improve help output for ofproto/trace.
Ben Pfaff [Wed, 30 Oct 2013 20:35:18 +0000 (13:35 -0700)]
ofproto-dpif: Improve help output for ofproto/trace.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Factor code out of ofproto_unixctl_trace().
Ben Pfaff [Mon, 11 Nov 2013 18:37:58 +0000 (10:37 -0800)]
ofproto-dpif: Factor code out of ofproto_unixctl_trace().

This new function will have an additional caller in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document a few Nicira extensions as standardized in OF1.1+.
Ben Pfaff [Sat, 14 Sep 2013 20:45:13 +0000 (13:45 -0700)]
ovs-ofctl: Document a few Nicira extensions as standardized in OF1.1+.

The update is incomplete, so document that also.

Reported-by: Stephen Finucane <stephen.finucane@intel.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Check ofproto_port_query_by_name() return value when adding port.
Ben Pfaff [Tue, 19 Mar 2013 20:30:33 +0000 (13:30 -0700)]
ofproto: Check ofproto_port_query_by_name() return value when adding port.

Otherwise, if the port add succeeds but the query that looks up the port
number fails, then ofproto_port_add() would return zero as the OpenFlow
port number and ignore the error.

Reported-by: Guolin Yang <gyang@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Count flaps when logging is disabled
Joe Stringer [Wed, 6 Nov 2013 18:36:17 +0000 (10:36 -0800)]
cfm: Count flaps when logging is disabled

Previously, the flap count logic for CFM was dependent on the state of
the logging facility. This patch ensures flaps are always counted when
there is a transition between non-fault and fault (and vice versa).

Found by inspection.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev: Make naming more consistent
Joe Stringer [Fri, 8 Nov 2013 17:41:19 +0000 (09:41 -0800)]
netdev: Make naming more consistent

netdev-dummy and netdev-vport use the function name netdev_poll_notify()
for the same purpose as netdev-linux/bsd's netdev_*_changed(). This patch
changes the former two to be more consistent with the linux/bsd naming
scheme.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Limit OVS-assigned port numbers to 32767 and below.
Ben Pfaff [Thu, 7 Nov 2013 00:12:34 +0000 (16:12 -0800)]
ofproto: Limit OVS-assigned port numbers to 32767 and below.

A couple of controller vendors have mentioned to me that they would like to
have some part of the OpenFlow port number space reserved for the
controller to use.  This commit reserves 32768 and up (roughly the upper
half of the OF1.0 port range) to the controller.

Bug #18753.
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Disassociate datapath max_ports with openflow port numbers.
Gurucharan Shetty [Tue, 5 Nov 2013 18:39:47 +0000 (10:39 -0800)]
ofproto-dpif: Disassociate datapath max_ports with openflow port numbers.

With single datapath, multiple userspace bridges share the same datapath.
As such it does not look beneficial that we decide a valid open flow port
number based on the number of ports in the datapath specially now that
we have the ofport_request column in OVSDB.

This commit does not remove ofproto_init_max_ports() interface as defined
in ofproto-provider.h as there may be other implementations that still use it.
But ofproto-dpif should not need it.

Bug #20163.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-bugtool: Remove reference to an undefined variable.
Gurucharan Shetty [Tue, 5 Nov 2013 21:02:07 +0000 (13:02 -0800)]
ovs-bugtool: Remove reference to an undefined variable.

commit 1d5aaa61f (ovs-controller: Rename test-controller and do not
install or package.) removed a variable definition but not its use.
Fix it.

Bug #20901.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Report OFPMMFC_BAD_FLAGS for bad band flags.
Ben Pfaff [Tue, 5 Nov 2013 06:36:28 +0000 (22:36 -0800)]
ofp-util: Report OFPMMFC_BAD_FLAGS for bad band flags.

It doesn't make sense to specify both kbps and pkt/s, because the two units
are mutually exclusive.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoofp-util: Report OFPMMFC_BAD_COMMAND for bad meter mod commands.
Ben Pfaff [Tue, 5 Nov 2013 06:34:09 +0000 (22:34 -0800)]
ofp-util: Report OFPMMFC_BAD_COMMAND for bad meter mod commands.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoofp-util: Report OFPMMFC_BAD_BAND for bad band type in meter mod decoding.
Ben Pfaff [Tue, 5 Nov 2013 06:32:58 +0000 (22:32 -0800)]
ofp-util: Report OFPMMFC_BAD_BAND for bad band type in meter mod decoding.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoofp-actions: Allow meter actions in ofpacts_verify().
Ben Pfaff [Tue, 5 Nov 2013 06:24:28 +0000 (22:24 -0800)]
ofp-actions: Allow meter actions in ofpacts_verify().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoOPENFLOW-1.1+: Update item describing status of meters.
Ben Pfaff [Tue, 5 Nov 2013 06:37:48 +0000 (22:37 -0800)]
OPENFLOW-1.1+: Update item describing status of meters.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoofpbuf: Allow whitespace other than spaces in hex data.
Ben Pfaff [Tue, 5 Nov 2013 06:37:23 +0000 (22:37 -0800)]
ofpbuf: Allow whitespace other than spaces in hex data.

It's easier to cut and paste lines of hexadecimal data into a command line
if you don't have to worry about new-lines appearing in the command.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Tue, 5 Nov 2013 08:56:15 +0000 (09:56 +0100)]
Merge branch 'mainstream'

10 years agoofproto: report the correct set of actions for group features
Ben Pfaff [Tue, 5 Nov 2013 05:14:53 +0000 (21:14 -0800)]
ofproto: report the correct set of actions for group features

do not report OF1.1 bits (set_dl_src etc) as group features is OF1.2+.

LINC seems to use 1<<31 for experimenter action type but i failed to
find it in the spec.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
[blp@nicira.com added a comment to ofp-util.h]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Add ovsdb column "cfm_flap_count".
alex wang [Tue, 22 Oct 2013 05:16:23 +0000 (05:16 +0000)]
cfm: Add ovsdb column "cfm_flap_count".

This commit adds a new ovsdb column "cfm_flap_count".  It counts the
number of cfm fault flaps since boot.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoOPENFLOW-1.1+: Groups are now supported.
Ben Pfaff [Mon, 4 Nov 2013 19:12:57 +0000 (11:12 -0800)]
OPENFLOW-1.1+: Groups are now supported.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
10 years agodpif-netdev: Change a variable name.
Gurucharan Shetty [Tue, 29 Oct 2013 09:34:15 +0000 (02:34 -0700)]
dpif-netdev: Change a variable name.

'struct dp_netdev_flow' is currently being instantiated as 'flow'.
An upcoming commit introduces a classifier to dpif-netdev
which uses 'struct flow' at a few places and that can cause
confusion while reading code.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoclassifier: Update thread safety notes.
Ben Pfaff [Wed, 25 Sep 2013 22:38:57 +0000 (15:38 -0700)]
classifier: Update thread safety notes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodaemon: Precisely document signals that cause the monitor to restart.
Ben Pfaff [Fri, 11 Oct 2013 23:52:50 +0000 (16:52 -0700)]
daemon: Precisely document signals that cause the monitor to restart.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
10 years agoovs-controller: Rename test-controller and do not install or package.
Ben Pfaff [Fri, 11 Oct 2013 23:24:41 +0000 (16:24 -0700)]
ovs-controller: Rename test-controller and do not install or package.

Too many users have incorrectly assumed that ovs-controller is a necessary
or desirable part of an Open vSwitch deployment.  This commit should fix
the problem by renaming it test-controller and removing it from the
default install and from packaging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev-linux: Skip miimon execution when disabled
Joe Stringer [Fri, 1 Nov 2013 23:34:29 +0000 (16:34 -0700)]
netdev-linux: Skip miimon execution when disabled

When dealing with a large number of ports, one of the performance
bottlenecks is that we loop through all netdevs in the main loop. Miimon
is a contributor to this, checking all devices even if it has never been
enabled.

This patch introduces a counter for the number of netdevs with miimon
configured. If this is 0, then we skip miimon_run() and miimon_wait().
In a test environment of 5000 internal ports and 50 tunnel ports with
bfd, this reduces CPU usage from about 50% to about 45%.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Support weight for select groups
Simon Horman [Wed, 30 Oct 2013 09:17:20 +0000 (18:17 +0900)]
ofproto-dpif: Support weight for select groups

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com adjusted this for highest random weight scoring and
 updated the test]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Implement translation of select groups.
Simon Horman [Wed, 30 Oct 2013 09:17:19 +0000 (18:17 +0900)]
ofproto-dpif: Implement translation of select groups.

Select bucket from those that are alive based on a hash of the destination
ethernet address of the packet.

Support for weights is proposed by a subsequent patch.

The selection is based on a hash of the destination ethernet
address of the flow. It should be possible to extend
this to cover a hash of user-specified elements of the flow.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com replaced bucket selection by "highest random weight"
 method]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Translation of fast failover groups
Simon Horman [Wed, 30 Oct 2013 09:17:18 +0000 (18:17 +0900)]
ofproto-dpif: Translation of fast failover groups

Fast failover groups use the actions in
the first bucket that is alive.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Add test for flow mod with groups.
Simon Horman [Wed, 30 Oct 2013 09:17:17 +0000 (18:17 +0900)]
ofproto: Add test for flow mod with groups.

Test that flow mod with groups succeeds only if the group exists.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Add del groups test
Simon Horman [Wed, 30 Oct 2013 09:17:16 +0000 (18:17 +0900)]
ofproto: Add del groups test

Lightly exercise del-groups

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Add group desc and stats tests
Simon Horman [Wed, 30 Oct 2013 09:17:15 +0000 (18:17 +0900)]
ofproto: Add group desc and stats tests

Lightly exercise group desc and stats

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com found that a new test segfaulted and folded in fixes]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Translation of indirect and all groups
Simon Horman [Wed, 30 Oct 2013 09:17:14 +0000 (18:17 +0900)]
ofproto-dpif: Translation of indirect and all groups

Allow translation of indirect and all groups.  Also allow insertion of
indirect and all groups by changing the maximum permitted number in the
groups table from 0 to OFPG_MAX.

Implementation note:

After translating the actions for each bucket ctx->flow is reset to its
state prior to translation of the buckets actions. This is equivalent to
cloning the bucket before applying actions. This is my interpretation of the
OpenFlow 1.3.2 specification section 5.6.1 Group Types, which includes the
following text. I believe there is room for other interpretations.

* On all groups: "The packet is effectively cloned for each bucket; one
  packet is processed for each bucket of the group."
* On indirect groups: "This group type is effectively identical to an
  all group with one bucket."

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Break out resubmit resource checking
Simon Horman [Wed, 30 Oct 2013 09:17:13 +0000 (18:17 +0900)]
ofproto: Break out resubmit resource checking

Break out resubmit resource checking into a helper function
xlate_resubmit_resource_check() and use this new function.
This is to allow the check to be re-used by a subsequent patch.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>