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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
dpif: Fix minor typo in comment.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
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>
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>
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>
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>
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>
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>
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>
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>