openvswitch
12 years agonetdev-vport: Fix warning due to new GRE type.
Ethan Jackson [Tue, 6 Nov 2012 02:26:52 +0000 (18:26 -0800)]
netdev-vport: Fix warning due to new GRE type.

This patch fixes the following warning caused by a switch case
which was not handled.

lib/netdev-vport.c:144:5: error: enumeration value
‘OVS_VPORT_TYPE_FT_GRE’ not handled in switch

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agodatapath: improve ipv6_find_hdr() function for IPv6 'set' action
Ansis Atteka [Tue, 6 Nov 2012 15:12:38 +0000 (17:12 +0200)]
datapath: improve ipv6_find_hdr() function for IPv6 'set' action

This patch prepares ipv6_find_hdr() function so that it could be
able to skip routing headers, where segements_left is 0. This is
required for us to handle multiple routing header case correctly.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
12 years agodatapath: Add ipv6_find_hdr() compatibility function.
Ansis Atteka [Tue, 6 Nov 2012 11:39:58 +0000 (13:39 +0200)]
datapath: Add ipv6_find_hdr() compatibility function.

Implementation of the IPv6 'set' action depends on ipv6_find_exthdr()
function to find routing header. By looking at the routing headers,
it is possible to tell, whether L4 checksums will need to be
recalculated, whenever the destination address is changed in
the main IPv6 header.

This function will need to be customized so that it would skip all
routing headers, where segements_left is equal to 0.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
12 years agodatapath: Remove flow refcount functionality.
Jesse Gross [Tue, 30 Oct 2012 23:34:50 +0000 (16:34 -0700)]
datapath: Remove flow refcount functionality.

Header caching previously required the ability to maintain the lifetime
of flows across RCU boundaries.  However, now that header caching is
gone we can simplfy the code and make it match the upstream version.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
12 years agodatapath: Add missing bug.h file
Pravin B Shelar [Mon, 5 Nov 2012 23:12:59 +0000 (15:12 -0800)]
datapath: Add missing bug.h file

Commit 51f4701be1 (datapath: Fix sparse warning for symbol
'BUILD_BUG_ON_NOT_POWER_OF_2') missed file bug.h. Commiting it now.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
12 years agodatapath: Add support for 3.6 kernel.
Pravin B Shelar [Mon, 5 Nov 2012 21:44:23 +0000 (13:44 -0800)]
datapath: Add support for 3.6 kernel.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Remove tunnel header caching.
Pravin B Shelar [Mon, 5 Nov 2012 21:44:00 +0000 (13:44 -0800)]
datapath: Remove tunnel header caching.

Tunnel caching was added to reduce CPU utilization on TX path
by caching packet header, So performance gain is directly proportional
to number of skbs transferred.  But with help of offloads skb are getting
larger. So there are less number of skbs.  Therefore header caching does
not shows similar gains we seen in past.  And now kernel 3.6 has removed
dst caching from networking which makes header caching even more tricky.
So this commit removes header caching from OVS tunnelling.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Fix sparse warning for symbol 'BUILD_BUG_ON_NOT_POWER_OF_2'
Pravin B Shelar [Mon, 5 Nov 2012 21:41:02 +0000 (13:41 -0800)]
datapath: Fix sparse warning for symbol 'BUILD_BUG_ON_NOT_POWER_OF_2'

BUILD_BUG_ON_NOT_POWER_OF_2 symbol is moved from kernel.h to
bug.h in 3.4.  Therefore sparse is giving warning:

include/linux/bug.h:15:9: warning: preprocessor token
BUILD_BUG_ON_NOT_POWER_OF_2 redefined
ovs/datapath/linux/compat/include/linux/kernel.h:44:9:
this was the original definition

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agonetdev: Deprecate CAPWAP support.
Pravin B Shelar [Mon, 5 Nov 2012 21:40:17 +0000 (13:40 -0800)]
netdev: Deprecate CAPWAP support.

The CAPWAP implementation is just the encapsulation format and
therefore really not the full protocol.  While there were some
uses of it (primarily hardware support and UDP transport).  But
these are most likely better provided by VXLAN.  As a result,
CAPWAP will be removed no earlier than February 2013.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
12 years agodatapath: enable encap for capwap.
Pravin B Shelar [Mon, 5 Nov 2012 21:39:00 +0000 (13:39 -0800)]
datapath: enable encap for capwap.

kernel 3.5 added a switch to turn on UDP encap, capwap needs
to enable it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Add Upstream id for GRE type.
Pravin B Shelar [Mon, 5 Nov 2012 21:38:34 +0000 (13:38 -0800)]
datapath: Add Upstream id for GRE type.

Once GRE is upstream it will have new type to have continuous sequence
of ids for vport type.  Following patch adds this ID to have
compatibility with it.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoCorrect the warning for format specifier.
Mehak Mahajan [Mon, 5 Nov 2012 19:14:36 +0000 (11:14 -0800)]
Correct the warning for format specifier.

ofputil_format_version uses type 'size_t' to print version whereas
expected type is 'unsigned int'.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
12 years agoUpdate master to reflect updates on branch-1.9
Mehak Mahajan [Mon, 5 Nov 2012 19:05:18 +0000 (11:05 -0800)]
Update master to reflect updates on branch-1.9

This commit updates NEWS and debian/changelog to reflect that
commit 8087f5ff (Process RARP packets with ethertype 0x8035
similar to ARP packets.) is going to be backported intto 1.9.0, so
that they should no longer be listed as post-1.9 features.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
12 years agoconnmgr: Parameterize ofservice_create() over allowed OpenFlow versions
Simon Horman [Fri, 26 Oct 2012 02:35:52 +0000 (11:35 +0900)]
connmgr: Parameterize ofservice_create() over allowed OpenFlow versions

This is in preparation for allowing configuration of the
allowed OpenFlow versions.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Add version bitmap support to hello messages.
Simon Horman [Mon, 5 Nov 2012 06:04:55 +0000 (22:04 -0800)]
ofp-util: Add version bitmap support to hello messages.

Allow encoding and decoding of version bitmap in hello messages
as specified in Open Flow 1.3.1.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified and generalized decode/encode functions]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agovconn: Replace minimum version with bitmap of allowed versions.
Simon Horman [Mon, 5 Nov 2012 05:41:02 +0000 (21:41 -0800)]
vconn: Replace minimum version with bitmap of allowed versions.

This is in preparation for allowing the range of allowed OpenFlow versions
to be configured.

As part of this change pvconn_open() is now paramatised over the allowed
versions.  this is to avoid avoids needing to provide version information
as a parameter to pvconn_accept().  This will in turn avoid the need to
pass version information to connmgr_run().

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified slightly and generalize log messages]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Add functions to support version number bitmaps.
Simon Horman [Mon, 5 Nov 2012 05:40:54 +0000 (21:40 -0800)]
ofp-util: Add functions to support version number bitmaps.

The bitmap is simple a uint32_t, allowing for versions up until
wire-protocol number 31.

Bit offsets correspond to ofp_version numbers which in turn
correspond to wire-protocol numbers for Open Flow versions..
E.g. (1 << OFP10_VERSION) is the mask for Open Flow 1.1.
If the bit for a version is set then it is allowed, otherwise it is
disallowed.

This is in preparation for allowing the range of allowed OpenFlow
versions to be configured.

Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com simplified some functions to constants, and rewrote
 a few functions in terms of utility bitwise functions]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoutil: New functions for the index of the leftmost or rightmost 1-bit.
Ben Pfaff [Thu, 1 Nov 2012 00:13:27 +0000 (17:13 -0700)]
util: New functions for the index of the leftmost or rightmost 1-bit.

These will acquire a user in an upcoming commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoutil: Group functions for bitwise tests.
Ben Pfaff [Thu, 1 Nov 2012 00:12:38 +0000 (17:12 -0700)]
util: Group functions for bitwise tests.

This only moves code around for more logical grouping.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Report 0 Mbps when speed not available instead of 100 Mbps.
Ben Pfaff [Sun, 4 Nov 2012 01:00:39 +0000 (18:00 -0700)]
ofproto: Report 0 Mbps when speed not available instead of 100 Mbps.

When a link is down, or when a link has no speed because it is not a
physical interface, Open vSwitch previously reported that its rate is 100
Mbps as a default.  This is counterintuitive, however, so this commit
changes Open vSwitch behavior to report 0 Mbps when a link is down or its
speed is otherwise unavailable.

Bug #13388.
Reported-by: Hiroshi Tanaka <htanaka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoProcess RARP packets with ethertype 0x8035 similar to ARP packets.
Mehak Mahajan [Fri, 2 Nov 2012 18:43:46 +0000 (11:43 -0700)]
Process RARP packets with ethertype 0x8035 similar to ARP packets.

With this commit, OVS will match the data in the RARP packets having
ethertype 0x8035, in the same way as the data in the ARP packets.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
12 years agoofproto: Better hide hidden tables.
Ben Pfaff [Fri, 2 Nov 2012 17:37:59 +0000 (10:37 -0700)]
ofproto: Better hide hidden tables.

ofproto has a concept of "hidden" OpenFlow tables.  Currently these are
used internally only for ofproto-dpif for a couple of unimportant
purposes.  However, hidden tables were not hidden well enough, because
OFTest was able to spot ofproto-dpif's hidden table and, seeing that it
had a couple of flows in it even after OFTest had tried to delete all
flows, failed at least one test.

This commit hides the tables better:

    - The number of tables reported in a feature reply no longer counts
      hidden tables.

    - Table stats replies omit hidden tables.

This commit introduces the requirement that hidden tables, if any, be the
highest-numbered tables.  This is because it's not clear to me that
OpenFlow intends to allow tables to be numbered noncontiguously.

We could take this further, by not exposing hidden tables in any way, but
I have this pet theory that being able to get the statistics for these
tables will come in handy for debugging someday.

Found by openflow_protocol_messages.ModifyStateDelete in OFTest.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoFAQ: Explain the difference between a switch and a bridge.
Ben Pfaff [Fri, 2 Nov 2012 17:21:08 +0000 (10:21 -0700)]
FAQ: Explain the difference between a switch and a bridge.

(There isn't any difference.)

Based on a conversation in #openvswitch.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
12 years agoofproto-dpif: Use a single underlying datapath across multiple bridges.
Justin Pettit [Wed, 31 Oct 2012 00:41:22 +0000 (17:41 -0700)]
ofproto-dpif: Use a single underlying datapath across multiple bridges.

This commit switches to using a single backing datapath (called
"ovs-datapath") for all bridges of that datapath's type.  Previously,
resources couldn't be shared across bridges, since each was in its own
datapath.  This change will allow sharing of tunnels and cheaper patch
ports to be added in the future.

Since bridges share a common datapath, the ovs-dpctl commands won't
provide bridge-specific information.  Users wishing to have that
information should use the new "ovs-appctl dpif/*" commands as
documented in ovs-vswitchd(8).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agodpif-sflow: Remove unused parameter from dpif_sflow_create().
Justin Pettit [Thu, 1 Nov 2012 23:16:16 +0000 (16:16 -0700)]
dpif-sflow: Remove unused parameter from dpif_sflow_create().

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agodpif: Add function to get the dpif type.
Justin Pettit [Thu, 1 Nov 2012 23:04:06 +0000 (16:04 -0700)]
dpif: Add function to get the dpif type.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agodpif: Add new dpif_port_exists() function.
Justin Pettit [Thu, 18 Oct 2012 06:11:53 +0000 (23:11 -0700)]
dpif: Add new dpif_port_exists() function.

Provide the ability to determine whether a port exists in a datapath
without having to deal with a "dpif_port" structure as with
dpif_port_query_by_name().  A future patch will use this function.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoofproto: Add type "run", "run_fast", and "wait" provider methods.
Justin Pettit [Fri, 12 Oct 2012 00:17:40 +0000 (17:17 -0700)]
ofproto: Add type "run", "run_fast", and "wait" provider methods.

Add the ability for ofproto providers to have top-level "run",
"run_fast", and "wait" methods, similar to the current ofproto ones.
There are no current users, but this will be useful in a future commit.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoovs-dpctl: Make specifying datapath optional for some commands.
Justin Pettit [Sat, 13 Oct 2012 00:46:06 +0000 (17:46 -0700)]
ovs-dpctl: Make specifying datapath optional for some commands.

A future commit will make all bridges use a single backing datapath.
This commit makes the "dp" argument for "dump-flows" and "del-flows"
optional, since there will typically only be one actual datapath.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoofproto-dpif: Introduce subfacet_destroy_batch().
Justin Pettit [Wed, 17 Oct 2012 02:21:52 +0000 (19:21 -0700)]
ofproto-dpif: Introduce subfacet_destroy_batch().

A future commit will introduce another caller that wants to destroy
batches of subfacets.  Repurpose expire_batch() to be a more generic
method for destroying batches of subfacets.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoofproto-dpif: Add ovs-appctl commands for ovs-dpctl functions.
Justin Pettit [Wed, 26 Sep 2012 01:47:02 +0000 (18:47 -0700)]
ofproto-dpif: Add ovs-appctl commands for ovs-dpctl functions.

These commands will be useful in a future commit that makes multiple
bridges share a single backing datapath.  The ovs-dpctl commands will
show information about the backing datapath, so it will be difficult to
determine which information belongs to which bridge.  The new "dpif/*"
ovs-appctl commands return information about the bridge--regardless of
how the backing datapath is configured.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agotests: Rewrite unit tests to not expect bridge with odp zero.
Justin Pettit [Sun, 14 Oct 2012 00:45:00 +0000 (17:45 -0700)]
tests: Rewrite unit tests to not expect bridge with odp zero.

A future commit will make all bridges of a particular type share a
single backing datapath.  That backing datapath will have a datapath
port number of zero and bridges will be assigned other numbers.  This
commit modifies the tests so that they don't expect port zero.

It adopts the convention that bridges of type "dummy" with a name of the
form "br<n>" will be assigned a port number of 100+<n>.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoSeparate OpenFlow port numbers from datapath ones.
Justin Pettit [Sat, 29 Sep 2012 00:56:07 +0000 (17:56 -0700)]
Separate OpenFlow port numbers from datapath ones.

In a future commit, we will make multiple bridges share a single backing
datapath.  Our simple mapping from datapath to OpenFlow port numbers
won't work, since we'll want the same OpenFlow port numbers on different
bridges.  For example, the OFPP_LOCAL port must be the same on all
bridges, but will have to be a different datapath port on the converged
datapath.

This commit makes it the responsibility of ofproto to assign the
OpenFlow port numbers instead of doing a simple translation from the
datapath ones.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agotests: Define new ADD_OF_PORTS macro for ofproto tests.
Justin Pettit [Thu, 4 Oct 2012 07:51:41 +0000 (00:51 -0700)]
tests: Define new ADD_OF_PORTS macro for ofproto tests.

A future commit will break the relation between OpenFlow and datapath
port numbers.  The new ADD_OF_PORTS macro adds an interface to a bridge
and configures it such that both the OpenFlow and datapath port numbers
are the same.  This is important in tests that deal with both OpenFlow
and datapath port numbers (e.g., ones that use ofproto/trace).

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoofproto: Add initialization function.
Justin Pettit [Tue, 9 Oct 2012 00:57:22 +0000 (17:57 -0700)]
ofproto: Add initialization function.

A future commit will make all bridges of a particular dpif share a
single backing datapath.  In order to handle restart, the datapath will
need to have some idea of what the initial state looks like.  Otherwise,
it won't know which ports belong to which bridges and orphaned ports may
never be cleaned up.

This commit introduces an initialization method to ofproto, which takes
as an argument a high-level description of the bridges and ports.  An
ofproto provider can then use this information to initialize its state.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoAllow the OpenFlow port to be requested for a port.
Justin Pettit [Wed, 3 Oct 2012 05:25:51 +0000 (22:25 -0700)]
Allow the OpenFlow port to be requested for a port.

A new "ofport_request" column makes it possible to request the OpenFlow
port number when adding a port.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoUse ODP ports in dpif layer and below.
Justin Pettit [Tue, 25 Sep 2012 22:25:51 +0000 (15:25 -0700)]
Use ODP ports in dpif layer and below.

The current code has a simple mapping between datapath and OpenFlow port
numbers (the port numbers were the same other than OFPP_LOCAL which maps
to datapath port 0).  Since the translation was know at compile time,
this allowed different layers to easily translate between the two, so
the translation often occurred late.

A future commit will break this simple mapping, so this commit draws a
line between where datapath and OpenFlow port numbers are used.  The
ofproto-dpif layer will be responsible for the translations.  Callers
above will use OpenFlow port numbers.  Providers below will use
datapath port numbers.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoAlways treat datapath ports as 32 bits.
Justin Pettit [Wed, 26 Sep 2012 23:22:47 +0000 (16:22 -0700)]
Always treat datapath ports as 32 bits.

Most of the code referred to datapath ports as 32-bit values, but a few
places still used 16-bit references.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agosset: Add sset_at_position() function.
Justin Pettit [Thu, 1 Nov 2012 06:08:32 +0000 (23:08 -0700)]
sset: Add sset_at_position() function.

This will be useful in a future commit.

Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agodpif: Fix minor typo in comment.
Justin Pettit [Tue, 25 Sep 2012 23:42:45 +0000 (16:42 -0700)]
dpif: Fix minor typo in comment.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoodp: Enable parsing ipv4_tunnel key.
Jesse Gross [Thu, 1 Nov 2012 22:50:16 +0000 (15:50 -0700)]
odp: Enable parsing ipv4_tunnel key.

We can format ipv4_tunnel keys from the kernel but can't currently
parse them.  Userspace doesn't know how to do anything with this
information but this support enables utilities like ovs-dpctl and
ovs-appctl ofproto/trace to show useful information.

Bug #13785

Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoMakefile: Allow "make modules_install" to work from top-level directory.
Ben Pfaff [Thu, 1 Nov 2012 20:54:20 +0000 (13:54 -0700)]
Makefile: Allow "make modules_install" to work from top-level directory.

INSTALL recommends running "make modules_install" but it didn't mention
that this has to be done from datapath/linux.  This commit makes this work
from the top-level build directory.

(Another solution would be to update INSTALL, but this approach seems a
little easier for the user.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agonetdev-vport: Warn users that pmtud is deprecated
Ansis Atteka [Mon, 29 Oct 2012 16:12:03 +0000 (18:12 +0200)]
netdev-vport: Warn users that pmtud is deprecated

This is a complementary patch to the other one I sent out previously.
The purpose of it is to make it more obvious that tunnel pmtud is
deprecated and will be removed soon.

Requested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
12 years agoofproto-dpif: Fix "ofproto/trace" of flow for local port.
Ben Pfaff [Wed, 15 Aug 2012 00:14:43 +0000 (17:14 -0700)]
ofproto-dpif: Fix "ofproto/trace" of flow for local port.

The 'in_port' variable is an OpenFlow port, not an ODP port, so we should
not translate it to ODP.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
12 years agoovs-ctl.in: Do not fail 'restart'.
Gurucharan Shetty [Mon, 29 Oct 2012 19:25:09 +0000 (12:25 -0700)]
ovs-ctl.in: Do not fail 'restart'.

ovs-ctl restart is called by the debian package upgrade.
We do not want to fail the package upgrade just because
restoring of flows failed.

The error message will still be printed on the console.

Bug #13730.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agoflow: Set ttl in flow_compose().
Justin Pettit [Sat, 27 Oct 2012 06:05:55 +0000 (15:05 +0900)]
flow: Set ttl in flow_compose().

Thanks to Ben Pfaff for immediately pinpointing the likely location of
the issue.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Automatically up the slave interfaces of a bond.
Gurucharan Shetty [Tue, 4 Sep 2012 19:40:27 +0000 (12:40 -0700)]
debian: Automatically up the slave interfaces of a bond.

When physical interfaces are added to a bond through the
/etc/network/interfaces script, administratively 'up' the
slave interfaces.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agotimeval: Fix occasional backtrace() related deadlock.
Ethan Jackson [Fri, 26 Oct 2012 19:33:01 +0000 (12:33 -0700)]
timeval: Fix occasional backtrace() related deadlock.

Occasionally, backtrace() will deadlock in the signal handler
because it does some non signal safe initialization.  Specifically,
it opens a shared object.  As a work around, this patch forces
backtrace() to run outside of a signal handler, so that future
calls will perform as expected.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoovs-save: Use timeout option for ovs-vsctl
Gurucharan Shetty [Fri, 26 Oct 2012 18:17:17 +0000 (11:17 -0700)]
ovs-save: Use timeout option for ovs-vsctl

Running ovs-save directly to save datapath configuration can
wait forever if ovsdb-server is not running. Use a timeout.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agonetdev-vport: Disable Path MTU Discovery by default
Ansis Atteka [Mon, 22 Oct 2012 07:04:28 +0000 (10:04 +0300)]
netdev-vport: Disable Path MTU Discovery by default

In near future we will switch to the flow-based tunneling and drop path
MTU discovery support. This patch prepares for that by changing the default
PMTUD value from 'enabled' to 'disabled'.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
12 years agoOF11: push_vlan support
Isaku Yamahata [Fri, 26 Oct 2012 04:43:19 +0000 (13:43 +0900)]
OF11: push_vlan support

This implementes push_vlan with 802.1Q.
NOTE: 802.1AD (QinQ) is not supported. It requires another effort.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopoll-loop: Log backtraces when CPU usage is high.
Ethan Jackson [Mon, 22 Oct 2012 23:53:54 +0000 (16:53 -0700)]
poll-loop: Log backtraces when CPU usage is high.

Often when debugging Open vSwitch, one will see in the logs that
CPU usage has been high for some period of time, but it's totally
unclear why.  In an attempt to remedy the situation, this patch
logs backtraces taken at regular intervals as a poor man's
profiling alternative.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agotimeval: Coalesce backtraces with counts.
Ethan Jackson [Mon, 22 Oct 2012 22:42:31 +0000 (15:42 -0700)]
timeval: Coalesce backtraces with counts.

With this patch, `ovs-appctl backtrace` will return a unique list
of backtraces and a count of how many times it has been recorded.
This work had previously been done by ovs-parse-backtrace. However,
in future patches poll-loop will begin logging backtraces as a
matter of course.  At this point, coalescing the backtraces will
help keep these log messages brief.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agotimeval: Take a backtrace on each SIGALRM.
Ethan Jackson [Wed, 17 Oct 2012 23:43:38 +0000 (16:43 -0700)]
timeval: Take a backtrace on each SIGALRM.

With this patch, timeval will take a backtrace with each SIGALRM
allowing it to retrieve a profiling snapshot instantly.  This will
be useful in future patches when backtraces are logged.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agodebian: Save openflow flows during package upgrade.
Gurucharan Shetty [Wed, 24 Oct 2012 20:05:01 +0000 (13:05 -0700)]
debian: Save openflow flows during package upgrade.

When debian package for openvswitch-switch is upgraded,
export a variable, OVS_RESTART_SAVE_FLOWS=yes.
This will save the openflow flows in vswitchd and
re-apply it after the upgrade.

Feature #13555.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agoxenserver, rhel, debian: Use ovs-ctl restart.
Gurucharan Shetty [Wed, 24 Oct 2012 20:02:22 +0000 (13:02 -0700)]
xenserver, rhel, debian: Use ovs-ctl restart.

ovs-ctl has a new command called "restart" which
saves and restores the openflow flows on bridges.
Use that command from the init scripts when doing
a "restart --save-flows=yes".

Also, the debian package postinst script can
set the variable OVS_RESTART_SAVE_FLOWS to "yes"
to ask for save and restore of flows.

Feature #13555.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agoovs-ctl.in: Don't save flows if the daemons are not running.
Gurucharan Shetty [Wed, 24 Oct 2012 20:19:24 +0000 (13:19 -0700)]
ovs-ctl.in: Don't save flows if the daemons are not running.

When a 'ovs-ctl restart' is executed and the userspace daemons
like ovsdb-server and ovs-vswitchd are not running, attempt to
save flows can wait forever. This also results in the daemons
from not getting started.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agoPrepare for post-1.9.0 (1.9.90).
Ben Pfaff [Wed, 24 Oct 2012 23:13:31 +0000 (16:13 -0700)]
Prepare for post-1.9.0 (1.9.90).

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoPrepare for 1.9.0.
Ben Pfaff [Wed, 24 Oct 2012 23:11:38 +0000 (16:11 -0700)]
Prepare for 1.9.0.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Fix zero key tunnels.
Pravin B Shelar [Wed, 24 Oct 2012 22:47:59 +0000 (15:47 -0700)]
datapath: Fix zero key tunnels.

Datapath tunneling check for flag OVS_FLOW_TNL_F_KEY is failing,
causing it to drop packet. This only happens on tunnels with
zero key as vswitchd does not generate set-tunnel action. Set
tunnel action sets this flags for given action. To fix this issue
the check is dropped.

Bug #13666

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoAllow processing of RARP packets.
Mehak Mahajan [Wed, 24 Oct 2012 02:00:02 +0000 (19:00 -0700)]
Allow processing of RARP packets.

With this commit, the datapath will process the ARP header for
RARP packets.  It also fixes a bug whereby if the ARP opcode is
something other than ARP request or reply, the key_len is not
adjusted to include ARP info.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoovs-ctl.in: Ability to save flows and kernel datapath config.
Gurucharan Shetty [Thu, 18 Oct 2012 22:44:37 +0000 (15:44 -0700)]
ovs-ctl.in: Ability to save flows and kernel datapath config.

Add a new command - "restart" to ovs-ctl. Calling this command
will save and restore the Openflow flows on each bridge while
stopping and starting the userspace daemons respectively.

Also, during a force-reload-kmod, save the flows and kernel datapath
configuration. Use the saved datapath configuration while readding
the kernel module and the flows while starting the userspace daemons.

Feature #13555.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agoUpdate INSTALL.Fedora to mention Fedora 17 instead of Fedora 15
Kyle Mestery [Mon, 22 Oct 2012 20:12:43 +0000 (16:12 -0400)]
Update INSTALL.Fedora to mention Fedora 17 instead of Fedora 15

Reflect the fact Fedora RPM support was recently implemented
on Fedora 17 instead of Fedora 15.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib: Accomodate FreeBSD return value for ssl connection.
Ed Maste [Tue, 23 Oct 2012 13:50:10 +0000 (13:50 +0000)]
lib: Accomodate FreeBSD return value for ssl connection.

On FreeBSD I see ECONNRESET being returned from check_connection_completion
in ssl_connect.  This happens before entering the SSL states, which return
EPROTO on failure.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoARP packets must have print arp_tpa/arp_spa instead of nw_dst/nw_src.
Mehak Mahajan [Mon, 22 Oct 2012 21:03:54 +0000 (14:03 -0700)]
ARP packets must have print arp_tpa/arp_spa instead of nw_dst/nw_src.

With a previous commit 953cc1888321346e6c4175fbc0a3f66d34913ea3, the
ovs logs were re-formatted such that they can be input into the
ofproto/trace.  For ARP packets, ofproto/trace expects arp_tpa/arp_spa
instead of nw_dst/nw_src.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoDo not print ICMP fields for non IP packets.
Mehak Mahajan [Mon, 22 Oct 2012 21:01:40 +0000 (14:01 -0700)]
Do not print ICMP fields for non IP packets.

The packet's nw_proto field overlaps with the ARP opcode field.  The
nw_proto for ICMP packets is 1.  Hence when the packet is an ARP
request (opcode 1), we erroneously print the ICMP code and ICMP type
for ARP frames as well.  With this commit, the ICMP code and ICMP
type will be printed only if the packet is an IP packet and the
nw_proto is ICMP.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoChange logging format for flows to that accepted by ofproto/trace.
Mehak Mahajan [Mon, 22 Oct 2012 21:00:35 +0000 (14:00 -0700)]
Change logging format for flows to that accepted by ofproto/trace.

flow_format() logs packets contents.  However, the format used is not
the format accepted by ofproto/trace.  Hence it becomes difficult to
trace the packets using the debugs printed.  With this commit, the
logging of the packet contents is done in a format that is accepted
by ofproto/trace.  This will make debugging easier.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoovs-pki: Unique subject DNs for certificate requests.
Gurucharan Shetty [Mon, 22 Oct 2012 17:52:41 +0000 (10:52 -0700)]
ovs-pki: Unique subject DNs for certificate requests.

Some applications expect subject DNs to be unique.

Bug #13609.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agotimeval: Simplify poll interval logging.
Ethan Jackson [Fri, 19 Oct 2012 01:56:48 +0000 (18:56 -0700)]
timeval: Simplify poll interval logging.

log_poll_interval() is a little bit too aggressive, and is
therefore less useful than it could be.  This patch removes the
mean interval calculation, and simply logs if the poll loop took
longer than 1 second instead.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoovs-vsctl: Do not accept any arguments to "del-manager" command.
Ben Pfaff [Mon, 15 Oct 2012 23:47:49 +0000 (16:47 -0700)]
ovs-vsctl: Do not accept any arguments to "del-manager" command.

It doesn't use them and never has.

Found when I accidentally typed this command with some arguments and it
worked, surprising me.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Tunnel port without destination IP.
Pravin B Shelar [Sat, 20 Oct 2012 19:18:05 +0000 (12:18 -0700)]
datapath: Tunnel port without destination IP.

Following patch allow port create without any parameters. This is
required for compatibility with future flow based tunneling
where each type would have single vport with all parameter
wild carded. So that all packet for all ports are received on
the port and same port is used for sending all traffic for
that tunnel type.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Optimize flow key match for non tunnel flows.
Pravin B Shelar [Sat, 20 Oct 2012 19:17:15 +0000 (12:17 -0700)]
datapath: Optimize flow key match for non tunnel flows.

Following patch adds start offset for sw_flow-key, so that we can
skip tunneling information in key for non-tunnel flows.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Add support for tun_key to Open vSwitch datapath
Kyle Mestery [Sat, 20 Oct 2012 19:15:24 +0000 (12:15 -0700)]
datapath: Add support for tun_key to Open vSwitch datapath

This is a first pass at providing a tun_key which can be
used as the basis for flow-based tunnelling. The
tun_key includes and replaces the tun_id in both struct
ovs_skb_cb and struct sw_tun_key.

This patch allows all existing tun_id behaviour to still work. Existing
users of tun_id are redirected to tun_key->tun_id to retain compatibility.
However, when the userspace code is updated to make use of the new
tun_key, the old behaviour will be deprecated and removed.

NOTE: With these changes, the tunneling code no longer assumes input and
output keys are symmetric.  If they are not, PMTUD needs to be disabled
for tunneling to work.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-ctl: Fix implementation of --extra-dbs.
Henry Mai [Fri, 19 Oct 2012 17:22:42 +0000 (10:22 -0700)]
ovs-ctl: Fix implementation of --extra-dbs.

Commit b4e8d1705 (ovsdb-server: Add support for multiple databases.)
added the --extra-dbs option to ovs-ctl but failed to add a specific
database name to the SSL options passed to ovsdb-server.  This meant
that ovsdb-server would fail to start if --extra-dbs were actually
used, because it didn't know which database to look in for the SSL
settings.

Signed-off-by: Henry Mai <hmai@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-actions: Implement writing to metadata field
Joe Stringer [Thu, 18 Oct 2012 17:37:37 +0000 (02:37 +0900)]
ofp-actions: Implement writing to metadata field

In OpenFlow 1.1, we add support for OFPIT_WRITE_METADATA. This allows us to
write to the metadata field. Internally it is represented using ofpact_metadata.

We introduce NXAST_WRITE_METADATA to handle writing to the metadata field in
OpenFlow 1.0+. This structure reflects OFPIT_WRITE_METADATA.

When writing out the structure to OpenFlow 1.1, it uses the OFPIT_WRITE_METADATA
instruction only, and not the new NXAST action (which would be redundant).

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-actions: Prefer OFPAT11_DEC_TTL to NXAST_DEC_TTL for OpenFlow 1.1+.
Ben Pfaff [Thu, 18 Oct 2012 18:12:38 +0000 (11:12 -0700)]
ofp-actions: Prefer OFPAT11_DEC_TTL to NXAST_DEC_TTL for OpenFlow 1.1+.

When "dec_ttl" is specified as the name of an action, in OpenFlow 1.1 and
later we should prefer to use the standardized action, rather than the
Nicira extension.

Reported-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
12 years agoofp-parse: Remove unreachable code.
Ben Pfaff [Thu, 18 Oct 2012 18:10:55 +0000 (11:10 -0700)]
ofp-parse: Remove unreachable code.

OFPUTIL_OFPAT11_DEC_NW_TTL does not have a name in the table of actions'
names, so this code in parse_named_action() can never be reached.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Isaku Yamahata <yamahata@valinux.co.jp>
12 years agonicira-ext: Clarify behavior of overlapping src and dst for NXAST_REG_MOVE.
Ben Pfaff [Tue, 16 Oct 2012 18:01:27 +0000 (11:01 -0700)]
nicira-ext: Clarify behavior of overlapping src and dst for NXAST_REG_MOVE.

Reported-by: Pankaj Thakkar <thakkar@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofpaction: support OF11 pop_vlan
Isaku Yamahata [Wed, 17 Oct 2012 18:51:58 +0000 (03:51 +0900)]
ofpaction: support OF11 pop_vlan

This patch adds support of OF11+ pop_vlan.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[blp@nicira.com added a test]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Again allow OpenFlow port 0 in commands and actions.
Ben Pfaff [Wed, 17 Oct 2012 20:29:34 +0000 (13:29 -0700)]
ofp-util: Again allow OpenFlow port 0 in commands and actions.

Commit c6100d92142b (ovs-ofctl: Accept port keywords, OF1.1 port numbers,
reject port number 0.) intentionally prohibited using port 0, which is not
a valid OpenFlow port number, in OpenFlow commands and actions.  However,
since then we have discovered that the NVP controller uses port 0 in
"resubmit" actions and hence in flow matches as well.  This seems like a
valid enough use case; after all, the port number in a resubmit action is
really just an arbitrary number that need not (and preferably does not)
refer to an actual OpenFlow port.  Therefore, this commit restores the
ability to use port 0.

(Only functions that parse OpenFlow commands and actions from strings, not
those that interpret binary OpenFlow coming in on OpenFlow connections,
were affected by this prohibition, so this only comes up in corner cases
anyhow.)

Reported-by: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofp-util: Separate output, error reporting in ofputil_port_from_string().
Ben Pfaff [Wed, 17 Oct 2012 20:10:08 +0000 (13:10 -0700)]
ofp-util: Separate output, error reporting in ofputil_port_from_string().

When I wrote this function I didn't think that port 0 was important (it's
not a valid OpenFlow port number) so I used a return value of 0 to indicate
an error.  However, my assumption turns out to be wrong, so this commit
changes the interface to use the return value only for error reporting
and store the parsed port number into a pointer passed in as a parameter.

This commit doesn't change the behavior of ofputil_port_from_string().

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agolib: support OF11 dec_nw_ttl
Isaku Yamahata [Wed, 17 Oct 2012 22:02:04 +0000 (07:02 +0900)]
lib: support OF11 dec_nw_ttl

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[blp@nicira.com changed code to use "dec_ttl" instead of "dec_nw_ttl"]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoutilities: New helper ovs-parse-backtrace.
Ethan Jackson [Mon, 15 Oct 2012 19:42:48 +0000 (12:42 -0700)]
utilities: New helper ovs-parse-backtrace.

The new ovs-parse-backtrace utility makes the output of ovs-appctl
backtrace more human readable by removing duplicate traces and
converting addresses to function names.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agotimeval: Optionally enable cached timing at configure time.
Ethan Jackson [Wed, 17 Oct 2012 01:16:16 +0000 (18:16 -0700)]
timeval: Optionally enable cached timing at configure time.

Often when developing, it would be convenient to force OVS to
either enable or disable cached timing so that a feature can be
tested under both strategies.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agom4: Remove trailing whitespace.
Ethan Jackson [Wed, 17 Oct 2012 01:16:37 +0000 (18:16 -0700)]
m4: Remove trailing whitespace.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agostream.py: un-decorator Stream.register_method
Isaku Yamahata [Wed, 17 Oct 2012 18:18:16 +0000 (03:18 +0900)]
stream.py: un-decorator Stream.register_method

c38f8724aeb994fd840fa4283a07e38c3c114d68 made stream.py not use class
decorator. So Stream.register need not to be decorator any more.
So simplify it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agostream.py: Don't use class decorators.
Reid Price [Wed, 17 Oct 2012 00:23:26 +0000 (17:23 -0700)]
stream.py: Don't use class decorators.

Commit 8cc820 (python/ovs/stream: teach stream.py tcp socket) made a
change that used class decorators.  Unfortunately, they were not
introduced until Python 2.6.  XenServer uses Python 2.4, so the change
caused some Python-based daemons not to start.  This commit uses an
alternate syntax suggested by Reid Price.

Bug #13580

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Reid Price <reid@nicira.com>
12 years agoofp-actions: Remove unused variable.
Ethan Jackson [Tue, 16 Oct 2012 22:40:27 +0000 (15:40 -0700)]
ofp-actions: Remove unused variable.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agotimeval: Block SIGALRM when sleeping.
Ethan Jackson [Tue, 16 Oct 2012 00:05:35 +0000 (17:05 -0700)]
timeval: Block SIGALRM when sleeping.

Commit 00a16895 (timeval: Don't require signals for time_alarm().)
Incorrectly disabled signals when when CACHE_TIME was disabled.  In
fact, the reverse was correct.  As a result of this bug, OVS would
wake once every 100ms unnecessarily.  It shouldn't have affected
correctness otherwise.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoinstruction/clear-actions: string parser/formater, of packet decoder/encoder
Isaku Yamahata [Fri, 5 Oct 2012 06:56:57 +0000 (15:56 +0900)]
instruction/clear-actions: string parser/formater, of packet decoder/encoder

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoinstruction: support goto-table action
Isaku Yamahata [Fri, 5 Oct 2012 06:56:56 +0000 (15:56 +0900)]
instruction: support goto-table action

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopython/ovs/socket_util: don't use Exception, but ValueError
Isaku Yamahata [Mon, 15 Oct 2012 21:57:27 +0000 (06:57 +0900)]
python/ovs/socket_util: don't use Exception, but ValueError

67656b9ff297f305b3bfcca2868e8e870e108283
used Exception, but it should be more specific error.
Use ValueError instread of Exception.

Suggested-by: Reid Price <reid@nicira.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-pki: Increase the validity days for self-signed certificates.
Gurucharan Shetty [Mon, 15 Oct 2012 21:41:31 +0000 (14:41 -0700)]
ovs-pki: Increase the validity days for self-signed certificates.

For self-signed certificates, increase validity from the default
30 days to 6 years.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
12 years agopython/ovs/stream: teach stream.py tcp socket
Isaku Yamahata [Thu, 27 Sep 2012 09:28:08 +0000 (18:28 +0900)]
python/ovs/stream: teach stream.py tcp socket

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopython/ovs/socket_util: add tcp related helper functions which will be used by tcp
Isaku Yamahata [Thu, 27 Sep 2012 09:28:07 +0000 (18:28 +0900)]
python/ovs/socket_util: add tcp related helper functions which will be used by tcp

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agotimeval: Add new "backtrace" appctl command.
Ethan Jackson [Fri, 12 Oct 2012 22:18:26 +0000 (15:18 -0700)]
timeval: Add new "backtrace" appctl command.

Often, it can be quite difficult to debug performance issues in
Open vSwitch.  Typically one needs to run something like gprof, but
that requires rebuilding and installing on the affected system
which is often problematic.  This patch adds a light weight
profiling solution which can be used in these situations.  The
ovs-appctl backtrace command prints out backtraces taken at 100
millisecond intervals over a 5 second period of time.  It is
currently only supported on systems which have the execinfo library
and enable time caching.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agocfm: Scope CFM packets to key zero.
Ethan Jackson [Fri, 12 Oct 2012 20:19:35 +0000 (13:19 -0700)]
cfm: Scope CFM packets to key zero.

Before this patch, when a tunnel is configured with key=flow, CFM
didn't verify that incoming packets had the appropriate key of
zero.  This could cause the CFM module to consume packets which
weren't actually intended for it.

Bug #13542.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full".
Ben Pfaff [Fri, 12 Oct 2012 17:15:11 +0000 (10:15 -0700)]
ofp-errors: Merge OF1.0 "all tables full" with OF1.1+ "table full".

These codes represent essentially the same condition and only one of them
exists in any given version of OpenFlow, so merge them together into a
single OFPERR_* code.

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Fix typo in macro name.
Ben Pfaff [Fri, 12 Oct 2012 20:18:41 +0000 (13:18 -0700)]
ofproto: Fix typo in macro name.

I like the sound of "evicton" but it isn't a real word.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
12 years agoofproto: Do not add flow on flow mod if new_cookie is UINT64_MAX
Simon Horman [Fri, 12 Oct 2012 00:26:28 +0000 (09:26 +0900)]
ofproto: Do not add flow on flow mod if new_cookie is UINT64_MAX

Internally a new_cookie value UINT64_MAX is used for
an OpenFlow 1.2 flow mod whose command is not Add.
Open Flow 1.2 does not permit adding flows for such commands.
Also, UINT64_MAX is a prohibited cookie value, and the
existing code created a flow with that value as for the cookie.

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