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>
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>
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>
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>
vconn: Paramatise pvconn_open() over minimum OpenFlow version

The motivation for this is to avoid avoids needing to provide a minimu
version parameter to pvconn_accept().  This will in turn avoid the need to
pass version information to connmgr_run() when the range of accetable
OpenFlow versions is made configurable.

Signed-off-by: Simon Horman <horms@verge.net.au>
vconn: Add ofputil_version_bitmap

Data structure to store allowed versions as a bitmap.

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>
vconn: Allowed OpenFlow versions

Replace minimum version with bitmap of allowed versions.

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

Signed-off-by: Simon Horman <horms@verge.net.au>
connmgr: Paramatise 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>
ofproto: Make set_pvconns() aware of OpenFlow versions

Paramatise the allowed OpenFlow verion for snoops.
This is in preparation for making the allow OpenFlow verions to
be configured.

Signed-off-by: Simon Horman <horms@verge.net.au>
rconn: Add allowed OpenFlow versions

Add allowed OpenFlow versions to struct rconn to allow
reconnect to use these parameters rather than hard-coded defaults.

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

Signed-off-by: Simon Horman <horms@verge.net.au>
ofproto, connmgr: Parameterise OpenFlow versions for adding controller

Allow allowed Open Flow versions to be passed rather
than relying on hard-coded defaults.

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

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-util: Allow use of OpenFlow 12 flow format

This enables the use of the OpenFlow 12 flow format.

Signed-off-by: Simon Horman <horms@verge.net.au>
connmgr: Use version of underlying rconn

Signed-off-by: Simon Horman <horms@verge.net.au>
vswitchd: Configuration of allowed OpenFlow versions

Versions may be configured using a comma delimited list as
the value for 'openflow-versions' the 'other-config' column
of the Bridge table.

Currently list elements other than 'OpenFlow10' and 'OpenFlow12' will
be ignored.

If the list is empty, then OpenFlow10 is used.
This default is consistent with the behaviour of ovs-vswtichd
prior to this patch.

Signed-off-by: Simon Horman <horms@verge.net.au>
lib: Add helpers for OpenFlow version command line options

Signed-off-by: Simon Horman <horms@verge.net.au>
ovs-ofctl: Add option to set allowed OpenFlow versions

--allowed-ofp-versions allows configuration of the versions
that may be used when establishing an OpenFlow connection.

The default is 'OpenFlow10' which is consistent with
the behaviour prior to this patch.

The useful values at this time are:
'OpenFlow10', 'OpenFlow12' and 'OpenFlow10,OpenFlow12'.

Signed-off-by: Simon Horman <horms@verge.net.au>
ovs-controller: Allow setting of allowed OpenFlow versions

--allowed-ofp-versions allows configuration of the versions
that may be used when establishing an OpenFlow connection.

The default is 'OpenFlow10' which is consistent with
the behaviour prior to this patch.

The useful values at this time are:
'OpenFlow10', 'OpenFlow12' and 'OpenFlow10,OpenFlow12'.

Signed-off-by: Simon Horman <horms@verge.net.au>
ovs-ofctl: By default, do not set flow format for OpenFlow 1.1+

Only set the default format for ovs-ofctl monitor if
OpenFlow 1.0 is the prevailing version. IMHO that is
the only case where it makes sense.

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-util: Open Flow 1.1 and 1.2 flow format capabilities

Open Flow and 1.1 and 1.2 support some of the same
flow format capabilities as NXM.

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-util: Flow Dump Protocol for OpenFlow 12

Allow only OpenFlow 12 as a flow dump protocol for OpenFlow12.
Allow OpenFlow10 and NXM as flow dump protocols for other OpenFlow versions.
This only changes the behaviour prior to this patch in the case of OpenFlow12
which seemed broken as an attempt would be made to set NXM as the
flow dump format using an OpenFlow 1.0 message even though an OpenFlow 1.2
connection had been negotiated..

Signed-off-by: Simon Horman <horms@verge.net.au>