sliver-openvswitch.git
11 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Wed, 16 Jan 2013 15:24:43 +0000 (16:24 +0100)]
Merge branch 'mainstream'

Conflicts:
lib/dpif-netdev.c

11 years agonetdev: Parse and make available tunnel configuration.
Ethan Jackson [Tue, 8 Jan 2013 00:56:04 +0000 (16:56 -0800)]
netdev: Parse and make available tunnel configuration.

Future patches will need to know the details of a netdev's tunnel
configuration from outside the netdev library.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agotunnels: Remove support for df_inherit from userspace.
Ethan Jackson [Mon, 7 Jan 2013 23:48:12 +0000 (15:48 -0800)]
tunnels: Remove support for df_inherit from userspace.

This will be required to support flow based tunneling.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: Maintain tun_id across action lists.
Jesse Gross [Tue, 15 Jan 2013 21:45:41 +0000 (13:45 -0800)]
ofproto-dpif: Maintain tun_id across action lists.

Previously, a tunnel ID received on input would be used by default
on output if the packet was later sent out a tunnel.  This was not
actually intentional behavior - tunnel information is not supposed
to carry over.  However, it is useful in the case where move actions
are used to load the original tunnel ID into registers for further
processing or additional lookups in resubmits since otherwise the
information is lost before handling actions.

When the initial components for flow based tunneling were introduced
this behavior for tunnel headers caused problems since it resulted
in packets being sent to the IP address they were originally received
on.  All of this behavior was "fixed" in commit
47d4a9db26329f9d93eb945c1fcc0e248cf2656a (ofproto-dpif: Initialize
tunnel metadata in both 'flow' and 'base_flow'.), breaking the use
cases the require tun_id during action processing.

For the time being, at least, this restores the original behavior
for tun_id, while keeping the new behavior for the rest of the
tunnel headers.  The latter are not exposed through OpenFlow and
therefore do not have similar complications.  If we do expose these
headers then we might have to revist this.

Thanks to Ben Pfaff for identifying the commit that introduced the
problem.

Bug #14625

Reported-by: Michael Hu <humichael@vmware.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agobond: Fix comment on bond_entry::tag
Zoltan Kiss [Sat, 5 Jan 2013 21:42:16 +0000 (21:42 +0000)]
bond: Fix comment on bond_entry::tag

The hash entry tag connects to facet(s), not slaves.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-print.c: Fix remaining port number prints.
Jarno Rajahalme [Mon, 14 Jan 2013 12:43:53 +0000 (14:43 +0200)]
ofp-print.c: Fix remaining port number prints.

Use ofputil_format_port() to print port numbers so that special ports
will be printed out as symbolic names (e.g., LOCAL) instead of numbers.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-vport: Create new TUNNEL_CLASS macro.
Ethan Jackson [Wed, 9 Jan 2013 04:01:24 +0000 (20:01 -0800)]
netdev-vport: Create new TUNNEL_CLASS macro.

There are a lot of tunnels, and they all use the exact same
functions, so it makes sense to collapse their initialization into
a macro.

Suggested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoalloc_ofp_port does not allocate the port number correctly
Krishna Kondaka [Fri, 11 Jan 2013 05:20:22 +0000 (21:20 -0800)]
alloc_ofp_port does not allocate the port number correctly

alloc_ofp_port() does not allocate the port number correctly if the port
number passed initially is already in use. The following if block

if (ofp_port >= ofproto->max_ports
            || bitmap_is_set(ofproto->ofp_port_ids, ofp_port)) {

is entered when either of the two conditions is true but the while block
after this is not entered if the second condition above is true and the
first condition is false.

This results in an existing port_number to be re-assigned!

Signed-off-by: Krishna Kondaka <kkondaka@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoFAQ: Update question about OpenFlow version support.
Ben Pfaff [Thu, 10 Jan 2013 19:28:26 +0000 (11:28 -0800)]
FAQ: Update question about OpenFlow version support.

We've had a lot of questions about this on the mailing lists recently, and
it would be nice to have an authoritative answer to cut and paste.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoworker: Remove unreachable statement.
Ben Pfaff [Fri, 11 Jan 2013 01:19:58 +0000 (17:19 -0800)]
worker: Remove unreachable statement.

Nothing ever breaks out of the loop, so this statement couldn't be reached.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agosocket-util: Use CONST_CAST in send_iovec_and_fs().
Ben Pfaff [Fri, 11 Jan 2013 01:10:41 +0000 (17:10 -0800)]
socket-util: Use CONST_CAST in send_iovec_and_fs().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoworker: Make worker_request_iovec() verify that it is not being reentered.
Ben Pfaff [Fri, 11 Jan 2013 01:16:01 +0000 (17:16 -0800)]
worker: Make worker_request_iovec() verify that it is not being reentered.

This function cannot easily be reentrant because the inner call would
interrupt and corrupt the data being sent by the outer call.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoworker: Do not use poll_block() in worker_send_iovec().
Ben Pfaff [Fri, 11 Jan 2013 01:22:24 +0000 (17:22 -0800)]
worker: Do not use poll_block() in worker_send_iovec().

The following call stack was possible:

    poll_block()
        -> vlog
            -> worker_send_iovec()
                -> poll_block()

which caused corruption because poll_block() is not reentrant.

Bug #14616.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agovlog: Avoid calling worker_request() reentrantly.
Ben Pfaff [Fri, 11 Jan 2013 01:14:03 +0000 (17:14 -0800)]
vlog: Avoid calling worker_request() reentrantly.

The following call stack was possible:

    vlog
        -> worker_request()
            -> poll_block()
                -> vlog
                     -> worker_request()

which caused problems because worker_request() is not reentrant.  In a
little more detail, the second worker_request() shoves its RPC protocol
data into the middle of the first.  This means that, first, you get
some binary crud in the log (the header for the second RPC).  And,
second, text from the first RPC log message gets treated by the worker
as the subsequent RPC's header.  That, in turn, typically causes the
worker to try to xmalloc() a huge number of bytes (0x20000000 or more,
since "space" has ASCII value 0x20), which causes the worker to die
with "virtual memory exhausted".  The main process then dies because
the worker's death closes the socket it uses to communicate with it
("connection reset").

Bug #14616.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agodpif-linux: Give each port its own userspace-kernel channel.
Justin Pettit [Sat, 5 Jan 2013 02:34:26 +0000 (18:34 -0800)]
dpif-linux: Give each port its own userspace-kernel channel.

Userspace-kernel communication is a possible bottleneck when OVS is
receiving a large number of flow set up requests.  To help prevent a bad
actor from consuming too much of this resource, we introduced channels
to segegrate traffic.  Previously, we created 17 channels and
round-robin assigned ports to one of 16 channels (the 17th was reserved
for use by the system).  This meant if there were more than 16 ports,
sharing of channels would occur.

This commit creates a new channel for each port, so that there is no
more sharing and better isolation.  The special system port uses the
"ovs-system"'s channel (port 0), since it is not heavily loaded.

This also fixes an issue introduced in commit acf60855 (ofproto-dpif:
Use a single underlying datapath across multiple bridges.) where ports
that were added at run-time were given the special system channel.

Issue #12073

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodpif-linux: Log the correct port-PID mapping.
Justin Pettit [Sat, 5 Jan 2013 18:43:49 +0000 (10:43 -0800)]
dpif-linux: Log the correct port-PID mapping.

When adding a port, the code previously logged the requested port number
(which is generally UINT32_MAX) instead of the assigned port number.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofproto-dpif: Use proper special value for the reserved PID.
Justin Pettit [Sat, 5 Jan 2013 02:21:27 +0000 (18:21 -0800)]
ofproto-dpif: Use proper special value for the reserved PID.

The compose_slow_path() function used UINT16_MAX for
dpif_port_get_pid(), when it should be UINT32_MAX to get the proper
reserved PID.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agonetdev-vport: Remove useless struct netdev_vport.
Ethan Jackson [Wed, 26 Dec 2012 20:33:23 +0000 (12:33 -0800)]
netdev-vport: Remove useless struct netdev_vport.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Use FIELD_SIZEOF() in dp_init().
YOSHIFUJI Hideaki [Thu, 10 Jan 2013 17:41:16 +0000 (09:41 -0800)]
datapath: Use FIELD_SIZEOF() in dp_init().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoAdd Openflow 1.3 test for asynchronous message control.
Jarno Rajahalme [Fri, 7 Dec 2012 13:48:24 +0000 (15:48 +0200)]
Add Openflow 1.3 test for asynchronous message control.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotests: Fix memory leaks in test-classifier program.
Ben Pfaff [Fri, 21 Dec 2012 22:59:35 +0000 (14:59 -0800)]
tests: Fix memory leaks in test-classifier program.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoclassifier: Fix theoretical leak in classifier_destroy().
Ben Pfaff [Fri, 21 Dec 2012 22:59:11 +0000 (14:59 -0800)]
classifier: Fix theoretical leak in classifier_destroy().

The open-coded version of destroy_table() in classifier_destroy() didn't
free the table's minimatch.  Use destroy_table() to do it properly.

This is only a theoretical leak because all the existing callers actually
remove all the rules from their classifiers before they destroy them
(outside of the tests/ directory, which I didn't examine) and so they don't
ever have anything left to remove in classifier_destroy().

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto: Fix remaining incorrect users of OVSP_LOCAL.
Justin Pettit [Wed, 9 Jan 2013 00:39:15 +0000 (16:39 -0800)]
ofproto: Fix remaining incorrect users of OVSP_LOCAL.

In the switch to a single datapath, the simple mapping between
OFPP_LOCAL and OVSP_LOCAL was broken.  Unfortunately, a couple of
translations were missed, so this commit fixes them.

Reported-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodpif: Document.
Ben Pfaff [Wed, 9 Jan 2013 22:10:46 +0000 (14:10 -0800)]
dpif: Document.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Change ENOENT return value to ENODEV in lookup_vport().
Jarno Rajahalme [Tue, 8 Jan 2013 11:41:00 +0000 (13:41 +0200)]
datapath: Change ENOENT return value to ENODEV in lookup_vport().

This reduces the number of valid "no such device" error values that
need special attention by the caller.

Userspace code will need to keep on checking for both ENODEV and
ENOENT as long as older kernel modules are around.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Eliminate unneeded call to ofproto_dpif_cast().
Ben Pfaff [Wed, 9 Jan 2013 18:31:20 +0000 (10:31 -0800)]
ofproto-dpif: Eliminate unneeded call to ofproto_dpif_cast().

I noticed this was unneeded while looking over commit 7c33b18807804f
(ofproto-dpif: More efficient implementation of get_odp_port().).

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Fix a kernel crash when adding a 2nd VXLAN port with existing UDP port
Kyle Mestery [Wed, 9 Jan 2013 19:47:41 +0000 (14:47 -0500)]
datapath: Fix a kernel crash when adding a 2nd VXLAN port with existing UDP port

When creating a second VXLAN tunnel port with the same UDP
port as an existing VXLAN tunnel port, make sure to set
*vxport before returning. Fixes a kernel crash.

Reported-by: Todd Ruch <Todd.Ruch@wwtas.com>
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: More efficient implementation of get_odp_port().
Jarno Rajahalme [Wed, 9 Jan 2013 12:21:47 +0000 (14:21 +0200)]
ofproto-dpif: More efficient implementation of get_odp_port().

Avoids unnecessary hash bucket traversal (ofproto_get_port()), since we
have the ofport_dpif already after odp_port_to_ofport().

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
[blp@nicira.com simplified the test]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-ofctl: Remove 'ANY' as a wildcard.
Gurucharan Shetty [Tue, 8 Jan 2013 23:29:44 +0000 (15:29 -0800)]
ovs-ofctl: Remove 'ANY' as a wildcard.

Currently we use "*" or ANY to mark a field in flow syntax
as a wildcard. With ANY being a valid openflow port now,
there is a conflict for in_port field. So at the least, we
need to remove ANY from being considered as a wildcard for
in_port. But this may cause general confusion and it may be
a better idea to remove 'ANY' as a wildcard for all fields.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoopenflow: Print in_port as string for reserved/special ports.
Gurucharan Shetty [Fri, 28 Dec 2012 19:02:40 +0000 (11:02 -0800)]
openflow: Print in_port as string for reserved/special ports.

Currently, when we add a flow with in_port=65534, we get the
following warning.

"ofp_util|WARN|referring to port LOCAL as 65534 is deprecated
for compatibility with future versions of OpenFlow."

But ovs-ofctl, while dumping flows uses 65534 instead of LOCAL.
The same is true for other reserved ports.

This patch corrects that.

Bug #14118.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovsdb-server: Fix memory leak when manager table has no status column.
Ben Pfaff [Wed, 26 Dec 2012 17:43:51 +0000 (09:43 -0800)]
ovsdb-server: Fix memory leak when manager table has no status column.

This is a corner case.  I doubt that it's triggered in practice outside the
unit tests.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoconnmgr: Fix memory leak destroying ofmonitor.
Ben Pfaff [Wed, 26 Dec 2012 17:42:33 +0000 (09:42 -0800)]
connmgr: Fix memory leak destroying ofmonitor.

This should be pretty minor because it only leaks memory if the match does
not fit in the inline area of a miniflow and minimask.  I imagine that the
most common match used for an ofmonitor is "match everything", which
wouldn't leak.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif-governor: Fix small memory leak.
Ben Pfaff [Wed, 26 Dec 2012 20:32:34 +0000 (12:32 -0800)]
ofproto-dpif-governor: Fix small memory leak.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoofp-util: Fix uninitialized bytes in OF1.0 and OF1.1 table stats replies.
Ben Pfaff [Fri, 21 Dec 2012 22:11:29 +0000 (14:11 -0800)]
ofp-util: Fix uninitialized bytes in OF1.0 and OF1.1 table stats replies.

Also, use ovs_strlcpy() instead of strcpy() just to be a teensy bit safer.

Found by valgrind.

Bug #14357.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agometa-flow: Fix uninitialized data parsing tnl_flags in mf_parse().
Ben Pfaff [Fri, 21 Dec 2012 22:01:43 +0000 (14:01 -0800)]
meta-flow: Fix uninitialized data parsing tnl_flags in mf_parse().

Also, add an assertion that the field is the expected size.

This bug was introduced in commit 2fdf762a006f (vswitchd: Log all tunnel
parameters of given flow.)

Found by valgrind.

Bug #14357.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agobugtool: Add manpage to gitignore.
Ethan Jackson [Mon, 7 Jan 2013 23:13:25 +0000 (15:13 -0800)]
bugtool: Add manpage to gitignore.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agobond: Change rebalance ratio to be more fair
Zoltan Kiss [Mon, 7 Jan 2013 22:47:51 +0000 (22:47 +0000)]
bond: Change rebalance ratio to be more fair

The old algorithm tries to converge to 0, despite it would mean a very
unbalanced situation. We're aiming for an ideal ratio of 1, meaning both
the 'from' and 'to' slave have the same load.  Therefore, we only move an
entry if it decreases the load on 'from', and brings us closer to equal
traffic load.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agorconn: Avoid memory leak in rconn_send_with_limit() on queue overflow.
Ben Pfaff [Fri, 4 Jan 2013 21:48:19 +0000 (13:48 -0800)]
rconn: Avoid memory leak in rconn_send_with_limit() on queue overflow.

Bug #14357.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agomanpages.mk: Install auto-generated update.
Ben Pfaff [Mon, 7 Jan 2013 22:30:10 +0000 (14:30 -0800)]
manpages.mk: Install auto-generated update.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobond: Correct comments.
Ben Pfaff [Mon, 7 Jan 2013 20:23:07 +0000 (12:23 -0800)]
bond: Correct comments.

Signed-off-by: Ben Pfaff <blp@nicira.com>
CC: Zoltan Kiss <zoltan.kiss@citrix.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoinclude/linux/openvswitch.h: Make OVSP_LOCAL 32-bit.
Jarno Rajahalme [Mon, 7 Jan 2013 10:45:27 +0000 (12:45 +0200)]
include/linux/openvswitch.h: Make OVSP_LOCAL 32-bit.

ODP ports are now 32-bit, so OVSP_LOCAL should be too.
(Internally, kernel module still keeps port numbers 16-bit, though.)

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoovs-vsctl.8: Add an example to configure openflow version.
Isaku Yamahata [Mon, 7 Jan 2013 04:58:28 +0000 (20:58 -0800)]
ovs-vsctl.8: Add an example to configure openflow version.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agomanpages: Fix build
Saul St. John [Sat, 5 Jan 2013 02:11:40 +0000 (20:11 -0600)]
manpages: Fix build

This patch fixes regressions in the dist and distclean targets, and in
the Debian build process, that were introduced by commit d2cb6c956b
(manpages: Put version number instead of date at bottom of page.).

Signed-off-by: Saul St. John <sstjohn@cs.wisc.edu>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovconn: Fix parameters for vconn_open(), vconn_open_block(), pvconn_open().
Ben Pfaff [Thu, 3 Jan 2013 01:10:43 +0000 (17:10 -0800)]
vconn: Fix parameters for vconn_open(), vconn_open_block(), pvconn_open().

The customary parameter order in Open vSwitch is to put input parameters
before output parameters, but vconn_open() and pvconn_open() had the 'dscp'
input parameter at the end, which bugged me a bit.  Also,
vconn_open_block() didn't take a 'dscp' parameter at all even though it's
otherwise a wrapper around vconn_open().  This commit fixes all that up.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoFAQ: Remove doubled "modified" in FAQ answer.
Ben Pfaff [Fri, 4 Jan 2013 00:52:04 +0000 (16:52 -0800)]
FAQ: Remove doubled "modified" in FAQ answer.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agomanpages: Put version number instead of date at bottom of page.
Ben Pfaff [Wed, 2 Jan 2013 18:19:14 +0000 (10:19 -0800)]
manpages: Put version number instead of date at bottom of page.

We're really good about keeping manpages up to date, but terrible at
updating the dates at the bottom of the manpages.  So, instead of using
manually updated dates, this commit switches to using automatically updated
version numbers.

We can only use automatically updated version numbers for manpages that
we preprocess, that is, the manpages whose sources end with ".in".  This
excludes a couple of manpages that don't actually get installed with OVS,
such as the manpages for ovs-ctl and ovsdb-idlc.  This commit doesn't
change those manpages.  It does change the ovs-bugtool manpage to one that
is preprocessed so that we can use the version there.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-ofctl: Document to work with any OpenFlow switch.
Ben Pfaff [Wed, 2 Jan 2013 17:56:36 +0000 (09:56 -0800)]
ovs-ofctl: Document to work with any OpenFlow switch.

I've always intended ovs-ofctl to work with any OpenFlow switch, not just
with Open vSwitch.  This explicitly documents that intention.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-vport: Manage ethernet addresses in userspace.
Ethan Jackson [Fri, 30 Nov 2012 19:36:42 +0000 (11:36 -0800)]
netdev-vport: Manage ethernet addresses in userspace.

Letting netdev-vport manage ethernet addresses itself instead of
relying on the datapath has several advantages.  It simplifies the
code, is significantly more efficient, and will work when there is
no longer a one to one mapping from netdev-vports to datapath
vports.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agovswitch: Remove PMTUD support from userspace.
Ethan Jackson [Thu, 27 Dec 2012 00:20:12 +0000 (16:20 -0800)]
vswitch: Remove PMTUD support from userspace.

This patch removes path MTU discovery from userspace.  The feature
still exists in the kernel where it will need to be removed in the
future.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-vport: New helper netdev_vport_get_dev().
Ethan Jackson [Thu, 27 Dec 2012 00:33:58 +0000 (16:33 -0800)]
netdev-vport: New helper netdev_vport_get_dev().

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev: Rename get_drv_info() to get_status().
Ethan Jackson [Mon, 17 Dec 2012 00:42:17 +0000 (16:42 -0800)]
netdev: Rename get_drv_info() to get_status().

get_status() is a much more intuitive name since "status" is what
the database column is called.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-vport: Fix theoretical null pointer dereference.
Ethan Jackson [Thu, 27 Dec 2012 01:02:08 +0000 (17:02 -0800)]
netdev-vport: Fix theoretical null pointer dereference.

Theoretically, its possible for netdev_get_status() to be called
on a netdev-vport which hasn't had its configuration set yet.  In
this case, netdev-vport would dereference a null pointer.

Reported-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: New function ofproto_receive().
Ethan Jackson [Wed, 19 Dec 2012 04:54:28 +0000 (20:54 -0800)]
ofproto-dpif: New function ofproto_receive().

Before translating a datapath flow key into actions, ofproto-dpif
must parse it, tweak it, and figure out what ofproto_dpif it
belongs to.  This patch brings all this logic into one place where
it will be easier to extend in the future.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofp-actions: Fix the check for instruction ordering and duplication.
Ben Pfaff [Thu, 3 Jan 2013 17:02:52 +0000 (09:02 -0800)]
ofp-actions: Fix the check for instruction ordering and duplication.

Open vSwitch enforces that, when instructions appear as Nicira extensions
in OpenFlow 1.0 action lists, the instructions appear in the order that
an OpenFlow 1.1+ switch would execute them and that no duplicates appear.
But the check wasn't general enough, because it had been implemented when
only one instruction was implemented and never later generalized.  This
commit fixes the problem.

One of the tests was actually testing for the wrong behavior that the
check implemented, so this commit corrects that test.  It also updates
another test with updated log messages.

Reported-by: Jing Ai <ai_jing2000@hotmail.com>
Tested-by: Jing Ai <ai_jing2000@hotmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agolacp: Fix dumping of the aggregation key.
Anoob Soman [Wed, 2 Jan 2013 17:23:07 +0000 (17:23 +0000)]
lacp: Fix dumping of the aggregation key.

While dumping lacp information using ovs-appctl, the "aggregation
key" field displays the port_id even though the aggregation key is
set using "other-config:lacp-aggregation-key".

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agobridge: Log version number precisely once.
Ethan Jackson [Wed, 2 Jan 2013 21:28:51 +0000 (13:28 -0800)]
bridge: Log version number precisely once.

Before this patch, ovs-vswitchd logged its version number every
time the database changed.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoMake OVS_TUNNEL_ATTR_DST_IPV4 optional to allow configuration of null_ports.
Jarno Rajahalme [Sat, 29 Dec 2012 06:58:40 +0000 (08:58 +0200)]
Make OVS_TUNNEL_ATTR_DST_IPV4 optional to allow configuration of null_ports.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
[jesse: correct return type of get_u32_or_zero()]
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto-dpif: Initialize tunnel metadata in both 'flow' and 'base_flow'.
Jesse Gross [Mon, 31 Dec 2012 20:38:26 +0000 (12:38 -0800)]
ofproto-dpif: Initialize tunnel metadata in both 'flow' and 'base_flow'.

The datapath doesn't carry over tunnel metadata between input and
output because such an operation doesn't generally make sense.  In
order to keep the flow information in sync, userspace needs to do
this as well.  However, userspace was clearing out only the base
flow, which means that it later generated an action with the original
tunnel metadata.  If a packet is both being sent and received on a
tunnel then this will cause the output tunnel's configuration to be
overriden with incorrect information.  This was recently exposed
when the ability to interpret tunnel metadata was added to userspace.

Reported-by: Anand Krishnamurthy <krishnamurt4@wisc.edu>
Reported-by: Saul St. John <sstjohn@cs.wisc.edu>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Initialize tunnel_key pad member.
Jesse Gross [Mon, 31 Dec 2012 20:28:41 +0000 (12:28 -0800)]
datapath: Initialize tunnel_key pad member.

When a packet is received on a tunnel the pad member is currently
left uninitialized.  This didn't previously cause problems because
userspace didn't interprete the IPV4_TUNNEL attribute and blindly
copied back the uninitialized data.  However, now that userspace
knows how to serialize this attribute it was zeroing it out, which
prevented flows that had been previously installed from being
deleted.  In addition to zeroing out the padding on packet reception,
it also does the same thing on flow setup since we should be ignoring
the value.

Reported-by: Anand Krishnamurthy <krishnamurt4@wisc.edu>
Reported-by: Saul St. John <sstjohn@cs.wisc.edu>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodebian: Fix typo in comment in openvswitch-controller.default.
Ben Pfaff [Sun, 30 Dec 2012 17:56:46 +0000 (09:56 -0800)]
debian: Fix typo in comment in openvswitch-controller.default.

Reported-by: Saul St. John
Reported-by: Logan Rosen <logatronico@gmail.com>
Reported-at: https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/1094556
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdd Openflow 1.2 role request/reply processing, update OF 1.2 tests. Add struct ofput...
Jarno Rajahalme [Fri, 28 Dec 2012 16:28:49 +0000 (18:28 +0200)]
Add Openflow 1.2 role request/reply processing, update OF 1.2 tests. Add struct ofputil_role_request and encode/decode functions for role request/reply.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
[blp@nicira.com made ofp-print print any error, renamed a function,
 added a comment]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoopenvswitch: Remove Linux bridge compatibility.
Pravin B Shelar [Thu, 27 Dec 2012 21:48:51 +0000 (13:48 -0800)]
openvswitch: Remove Linux bridge compatibility.

Currently brcompat does not work on master due to recent
datapath changes. We have decided to remove it as it is
not used very widely.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agobrcompat: Mark ovs-brcompat as deprecated.
Pravin B Shelar [Thu, 27 Dec 2012 21:30:59 +0000 (13:30 -0800)]
brcompat: Mark ovs-brcompat as deprecated.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
bug #14341

11 years agoflow: Split flow_extract
Simon Horman [Thu, 27 Dec 2012 05:23:09 +0000 (14:23 +0900)]
flow: Split flow_extract

Split the L3 and above portion of flow_extract() out into
flow_extract_l3_onwards() and call flow_extract_l3_onwards()
from flow_extract().

This is to allow re-extraction of l3 and higher information using
flow->encap_dl_type which may be set using information contained
in actions.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-util: features reply of openflow13 does not have ports
SUGYO Kazushi [Tue, 18 Dec 2012 12:51:11 +0000 (21:51 +0900)]
ofp-util: features reply of openflow13 does not have ports

Signed-off-by: SUGYO Kazushi <sugyo.org@gmail.com>
[blp@nicira.com moved the test from ofproto.c to ofp-util.c]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodebian: Integrate interfaces config with OVS startup script.
Gurucharan Shetty [Thu, 27 Dec 2012 17:43:54 +0000 (09:43 -0800)]
debian: Integrate interfaces config with OVS startup script.

Currently, there is an option to use the /etc/network/interfaces
file to configure Open vSwitch bridges and ports. To create and
destroy bridges, one has to manually run the following commands.

ifup --allow=ovs $list_of_bridges
ifdown --allow=ovs $list_of_bridges

This commit will automatically run the above two commands when
the system boots up and shuts down respectively through the
OVS startup script.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-vswitch: Make OpenFlow "dp_desc" configurable.
Ben Pfaff [Wed, 26 Dec 2012 23:00:06 +0000 (15:00 -0800)]
ovs-vswitch: Make OpenFlow "dp_desc" configurable.

Signed-off-by: Felician Nemeth <nemethf@tmit.bme.hu>
[blp@nicira.com refactored the code that this was based on and revised the
 patch accordingly]
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Use NULL "desc" values to indicate defaults.
Ben Pfaff [Wed, 26 Dec 2012 22:56:01 +0000 (14:56 -0800)]
ofproto: Use NULL "desc" values to indicate defaults.

This saves a small amount of memory.  It should also save a small amount of
time for reconfiguration starting with an upcoming commit where it becomes
possible to change the dp_desc away from the default (because it will not
be necessary to compare the current value against the default).

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Remove ofproto_set_desc().
Ben Pfaff [Wed, 26 Dec 2012 22:36:12 +0000 (14:36 -0800)]
ofproto: Remove ofproto_set_desc().

Nothing calls it, and it's a lousy interface.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-vport: Remove set_stats() implementation.
Ethan Jackson [Sat, 1 Dec 2012 00:12:03 +0000 (16:12 -0800)]
netdev-vport: Remove set_stats() implementation.

The only user of netdev_set_stats() is bonding (for updating the
fake interface).  This interface is never a vport, so it seems
quite a bit cleaner to keep the relevant code in the netdev-linux
library where it's needed, instead of in netdev-vport, where it
adds needless complexity.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agonetdev-vport: Remove the ability to send packets.
Ethan Jackson [Thu, 22 Nov 2012 00:17:45 +0000 (16:17 -0800)]
netdev-vport: Remove the ability to send packets.

The only user of netdev_send() is dpif-netdev which doesn't support
vports.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-ctl: Exit, instead of resuming, after handling fatal signals.
Ben Pfaff [Wed, 26 Dec 2012 20:45:34 +0000 (12:45 -0800)]
ovs-ctl: Exit, instead of resuming, after handling fatal signals.

When I wrote the "trap" calls in ovs-ctl, I had the mistaken notion that
"trap $cmd $signal" would execute $cmd and then exit when $signal was
caught.  This is incorrect.  Instead, it executes $cmd and then resumes
executing the shell script.

On the other hand, "trap $cmd 0" does by itself what I wanted: it causes
the shell to execute $cmd and then exits due to the signal.  So this commit
changes the offending traps to use this form.

Bug #14290.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoofproto-dpif: Don't output to nonexistent ports.
Ethan Jackson [Sat, 15 Dec 2012 03:34:13 +0000 (19:34 -0800)]
ofproto-dpif: Don't output to nonexistent ports.

In older versions of Open vSwitch, one could reasonably predict
that the datapath port number would be the same as the OpenFlow
port number even for ports which may not exist yet.  With the
single datapath model, it's no possible longer to make this
prediction.  Therefore, instead of attempting to, this code simply
drops packets which output to a nonexistent port.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto-dpif: User proper type for odp_port when outputting.
Ethan Jackson [Thu, 20 Dec 2012 00:17:07 +0000 (16:17 -0800)]
ofproto-dpif: User proper type for odp_port when outputting.

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs: Replace TODO:XXX with XXX.
Ethan Jackson [Sat, 15 Dec 2012 04:43:30 +0000 (20:43 -0800)]
ovs: Replace TODO:XXX with XXX.

According to the coding style, XXX is the appropriate tag for code
that needs work.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoxenserver: Downgrade not on XenServer warning to DBG.
Ethan Jackson [Wed, 19 Dec 2012 03:31:41 +0000 (19:31 -0800)]
xenserver: Downgrade not on XenServer warning to DBG.

This log message is annoying and of questionable usefulness.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoofproto: Remove trailing whitespace.
Ethan Jackson [Mon, 17 Dec 2012 22:53:42 +0000 (14:53 -0800)]
ofproto: Remove trailing whitespace.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agoovsdb-doc: Fix formatting at top of generated manpage.
Ben Pfaff [Thu, 20 Dec 2012 18:16:35 +0000 (10:16 -0800)]
ovsdb-doc: Fix formatting at top of generated manpage.

This keeps the first paragraph of text from running into the title.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoAdd ODP level handling of OVS_KEY_ATTR_IPV4_TUNNEL.
Jarno Rajahalme [Fri, 21 Dec 2012 08:44:38 +0000 (10:44 +0200)]
Add ODP level handling of OVS_KEY_ATTR_IPV4_TUNNEL.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoSetting tag sliver-openvswitch-1.9.90-2 sliver-openvswitch-1.9.90-2
Thierry Parmentelat [Fri, 21 Dec 2012 07:17:55 +0000 (08:17 +0100)]
Setting tag sliver-openvswitch-1.9.90-2
merged with upstream
handling of promisc &up/down flags for tap devices
small improvements to the Makefile

11 years agodatapath: linux2.7 s/pid/portid/g
Isaku Yamahata [Wed, 19 Dec 2012 08:43:10 +0000 (17:43 +0900)]
datapath: linux2.7 s/pid/portid/g

the following up of 15e473046cb6e5d18a4d0057e61d76315230382b
This patch replaces pid with portid under datapath/linux/compat

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: support Linux 3.7
Isaku Yamahata [Wed, 19 Dec 2012 08:43:09 +0000 (17:43 +0900)]
datapath: support Linux 3.7

datapath: backport 15e473046cb6e5d18a4d0057e61d76315230382b

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[jesse: fix kernel version in error message]
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoMerge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
Giuseppe Lettieri [Thu, 20 Dec 2012 15:40:50 +0000 (16:40 +0100)]
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch

Conflicts:
lib/netdev-pltap.c

11 years agorefactoring of vsys_transaction
Giuseppe Lettieri [Thu, 20 Dec 2012 15:25:14 +0000 (16:25 +0100)]
refactoring of vsys_transaction

11 years agomove promisc to its own function
Giuseppe Lettieri [Thu, 20 Dec 2012 15:00:03 +0000 (16:00 +0100)]
move promisc to its own function

11 years agopltap: do not try to get flags until finalized
Giuseppe Lettieri [Thu, 20 Dec 2012 14:32:43 +0000 (15:32 +0100)]
pltap: do not try to get flags until finalized

11 years agoslight improvement in Makefile readability
Giuseppe Lettieri [Sun, 16 Dec 2012 18:17:47 +0000 (19:17 +0100)]
slight improvement in Makefile readability

Use .DELETE_ON_ERROR and Makefile implicit behaviour to remove some
'&&' and '||' from the recipes.

11 years agoproper handling of the DOWN flag
Giuseppe Lettieri [Thu, 20 Dec 2012 13:25:14 +0000 (13:25 +0000)]
proper handling of the DOWN flag

11 years agoproper handling of the UP flag
Giuseppe Lettieri [Wed, 19 Dec 2012 17:05:51 +0000 (18:05 +0100)]
proper handling of the UP flag

11 years agoremoved unused var
Giuseppe Lettieri [Wed, 19 Dec 2012 12:40:56 +0000 (13:40 +0100)]
removed unused var

11 years agouse new vsys promisc script
Giuseppe Lettieri [Mon, 17 Dec 2012 15:05:27 +0000 (16:05 +0100)]
use new vsys promisc script

We implement the update_flags method for planetlab tap
devices using the new vsys promisc script.

11 years agometa-flow: Correctly byteswap skb_priority/skb_mark for mf_value.
Ben Pfaff [Tue, 18 Dec 2012 23:54:29 +0000 (15:54 -0800)]
meta-flow: Correctly byteswap skb_priority/skb_mark for mf_value.

Fixes the following sparse warnings:

meta-flow.c:947:21: warning: incorrect type in assignment (different base types)
meta-flow.c:947:21:    expected restricted __be32 [usertype] be32
meta-flow.c:947:21:    got unsigned int const [unsigned] [usertype] skb_priority
meta-flow.c:951:21: warning: incorrect type in assignment (different base types)
meta-flow.c:951:21:    expected restricted __be32 [usertype] be32
meta-flow.c:951:21:    got unsigned int const [unsigned] [usertype] skb_mark

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto, ofproto-dpif: Fix memory leaks of struct iface_hint structures.
Ben Pfaff [Tue, 18 Dec 2012 21:41:49 +0000 (13:41 -0800)]
ofproto, ofproto-dpif: Fix memory leaks of struct iface_hint structures.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Fix another memory leak in type_run().
Ben Pfaff [Tue, 18 Dec 2012 21:18:26 +0000 (13:18 -0800)]
ofproto-dpif: Fix another memory leak in type_run().

'devname' needs to be destroyed whether it's the datapath device or not.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Fix memory leak in type_run().
Ben Pfaff [Tue, 18 Dec 2012 21:17:00 +0000 (13:17 -0800)]
ofproto-dpif: Fix memory leak in type_run().

The dpif_port_destroy() call was in the dpif_port_query_by_name() error
path, when there's nothing to destroy, rather than in the "success" path,
where there is data to destroy.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Avoid potential undefined behavior in type_run().
Ben Pfaff [Tue, 18 Dec 2012 21:15:49 +0000 (13:15 -0800)]
ofproto-dpif: Avoid potential undefined behavior in type_run().

When HMAP_FOR_EACH completes, the value in the loop control variable is not
necessarily NULL.  It is NULL minus the offset of the hmap_node struct
member, which is nonnull if that offset is nonzero.  Currently,
'all_ofproto_dpifs_node' is the first member in struct ofproto_dpif, so
there is no real bug, but there would be if the struct were rearranged.

This commit heads off the problem by avoiding any assumption about the
loop control variable after HMAP_FOR_EACH.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovswitchd: log skb_mark and skb_priority
Ansis Atteka [Thu, 29 Nov 2012 22:36:49 +0000 (14:36 -0800)]
vswitchd: log skb_mark and skb_priority

This patch adds logging support for skb_mark and skb_priority.

Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
11 years agometa-flow: Fix and simplify mf_get_mask().
Ben Pfaff [Tue, 18 Dec 2012 17:45:02 +0000 (09:45 -0800)]
meta-flow: Fix and simplify mf_get_mask().

This function can be implemented as a trivial wrapper around
mf_get_value(), which I hadn't noticed before, so it's better to do it
that way.  Also, examining the code that is removed, it had some bugs in
it (for example, all MFF_TUN_* fields were treated as if they were
MFF_TUN_ID) which mf_get_value() does not have, so this fixes bugs too.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Zero out key when looking up null ports.
Jesse Gross [Mon, 17 Dec 2012 20:07:07 +0000 (12:07 -0800)]
datapath: Zero out key when looking up null ports.

When we are searching for a tunnel port to receive traffic on,
everything should be zeroed out by the time that we get to null
ports since they are wildcarded.  However, if certain other ports
also exist (primarily multicast ports with keys) then this might
not be the case and the key can be set.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoOPENFLOW-1.1+: New file for OpenFlow 1.1 and later to-do list.
Ben Pfaff [Mon, 17 Dec 2012 18:58:00 +0000 (10:58 -0800)]
OPENFLOW-1.1+: New file for OpenFlow 1.1 and later to-do list.

This is an updated plain text version of the webpage at
    http://openvswitch.org/development/openflow-1-x-plan/
which I intend to replace by a link to this file after it is committed.

Signed-off-by: Ben Pfaff <blp@nicira.com>