]> git.proxmox.com Git - ovs.git/log
ovs.git
11 years agoFAQ: Add QoS section.
Ben Pfaff [Thu, 24 Jan 2013 00:09:46 +0000 (16:09 -0800)]
FAQ: Add QoS section.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobridge: Fix bug in equal_pathnames().
Ben Pfaff [Wed, 23 Jan 2013 23:12:10 +0000 (15:12 -0800)]
bridge: Fix bug in equal_pathnames().

Reported-by: Pavithra Ramesh <paramesh@vmware.com>
Acked-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto-dpif: Fix minor memory leak when creating dpif_backers.
Ethan Jackson [Tue, 22 Jan 2013 23:43:15 +0000 (15:43 -0800)]
ofproto-dpif: Fix minor memory leak when creating dpif_backers.

Found by inspection.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
11 years agohash: Replace primary hash functions by murmurhash.
Ben Pfaff [Thu, 17 Jan 2013 00:14:42 +0000 (16:14 -0800)]
hash: Replace primary hash functions by murmurhash.

murmurhash is faster than Jenkins and slightly higher quality, so switch to
it for hashing words.

The best timings I got for hashing for data lengths of the following
numbers of 32-bit words, in seconds per 1,000,000,000 hashes, were:

words     murmurhash      Jenkins hash
-----     ----------      ------------
   1           8.4              10.4
   2          10.3              10.3
   3          11.2              10.7
   4          12.6              18.0
   5          13.9              18.3
   6          15.2              18.7

In other words, murmurhash outperforms Jenkins for all input lengths other
than exactly 3 32-bit words (12 bytes).  (It's understandable that Jenkins
would have a best case at 12 bytes, because Jenkins works in 12-byte
chunks.)  Even in the case where Jenkins is faster, it's only by 5%.  On
average within this data set, murmurhash is 15% faster, and for 4-word
input it is 30% faster.

We retain Jenkins for flow_hash_symmetric_l4() and flow_hash_fields(),
which are cases where the hash value is exposed externally.

This commit appears to improve "ovs-benchmark rate" results slightly by
a few hundred connections per second (under 1%), when used with an NVP
controller.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agohash: Change mhash_finish() data measurement from words to bytes.
Ben Pfaff [Fri, 14 Dec 2012 22:50:06 +0000 (14:50 -0800)]
hash: Change mhash_finish() data measurement from words to bytes.

murmurhash includes an xor with the number of bytes hashed in its finishing
step.  Until now, we've only had murmurhash for full words, but an upcoming
commit adds murmurhash for bytes, so the finishing function will need to
take a count of bytes instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agohash: Correct implementation of mhash_finish().
Ben Pfaff [Fri, 14 Dec 2012 21:43:54 +0000 (13:43 -0800)]
hash: Correct implementation of mhash_finish().

With rotates instead of shifts, the upper and lower 16 bits of the returned
hash are always the same.

I noticed this while working on replacing Jenkins hash by murmurhash,
because some of the database unit tests started failing, e.g. "row
hashing (scalars)".

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agotests: Fix dependencies on hash function in ofproto-dpif tests.
Ben Pfaff [Wed, 16 Jan 2013 05:48:25 +0000 (21:48 -0800)]
tests: Fix dependencies on hash function in ofproto-dpif tests.

These tests relied on luck to ensure that OpenFlow ports received the
expected OpenFlow port numbers.  With a different hash function, or (I
expect) on a big-endian architecture, the port numbers were assigned
differently and the tests failed.

This commit fixes the problem by requesting the specific expected port
numbers explicitly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agodatapath: Return correct error code when dumping flow actions.
Jesse Gross [Mon, 21 Jan 2013 11:59:17 +0000 (03:59 -0800)]
datapath: Return correct error code when dumping flow actions.

Currently, if there isn't enough space to store the actions in a
flow during a dump we return -ENOMEM.  However, the standard error
in this situation is -EMSGSIZE so this changes the behavior to match.
This issue was introduced in 354d4c98a8cdaae3525848f564e58a9016bcd3af
 (datapath: Fix nelink attribute size for flow.).

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Don't dump partial action lists in flows.
Ben Pfaff [Mon, 21 Jan 2013 11:59:16 +0000 (03:59 -0800)]
datapath: Don't dump partial action lists in flows.

After commit 9b405f1aa8d175dc63ad3ffe5d0fe05d5ee09162 (datapath: More
flexible kernel/userspace tunneling attribute.), it was possible for a
flow dump to return a partial action list.  It's better to return no
action list at all in this situation since then userspace will know
that it should request the full thing if it wants rather than have
incorrect results.  Therefore, this prevents those partial lists in
situations where we have a very large number of actions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoRevert "datapath: Avoid null deref when GSO is for verifying header integrity only."
Jesse Gross [Mon, 21 Jan 2013 13:23:32 +0000 (05:23 -0800)]
Revert "datapath: Avoid null deref when GSO is for verifying header integrity only."

This reverts commit 00c7faf3e5b7d4020e995a1429cf94313f197171.

In general, it should not be possible have a NULL return value from
skb_gso_segment() since we're not actually trying to verify the
header integrity.  No other callers with similar needs have NULL
checks.  The actual cause of the problem was LRO packets, which
OVS isn't equipped to handle.  The commit
33e031e99cc630baf1b0cb9256710dee7d9ab66d (datapath: Move LRO check
from transmit to receive.) solves that problem by fixing the LRO
check.  In order to avoid possibly masking any other problems, this
reverts the GSO check which should no longer be needed.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Move LRO check from transmit to receive.
Jesse Gross [Mon, 21 Jan 2013 13:13:32 +0000 (05:13 -0800)]
datapath: Move LRO check from transmit to receive.

Commit 24b019f808211a95078efd916064af0975ca5733 (datapath: Disable
LRO from userspace instead of the kernel.) accidentally moved the
check for LRO packets from the receive path to transmit.  Since
this check is supposed to protect OVS (and other parts of the system)
from packets that it cannot handle it is obviously not useful on
egress.  Therefore, this commit moves it back to the receive side.

The primary problem that this caused is upcalls to userspace tried
to segment the packet even though no segmentation information is
available.  This would later cause NULL pointer dereferences when
skb_gso_segment() did nothing.

Bug #14772

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Avoid null deref when GSO is for verifying header integrity only.
Ben Pfaff [Mon, 21 Jan 2013 22:29:15 +0000 (14:29 -0800)]
datapath: Avoid null deref when GSO is for verifying header integrity only.

skb_gso_segment() has the following comment:

 *    It may return NULL if the skb requires no segmentation.  This is
 *    only possible when GSO is used for verifying header integrity.

Somehow queue_gso_packets() has never hit this case before, but some
failures have suddenly been reported.  This commit should fix the problem.

Additional commentary by Jesse: We shouldn't normally be hitting this case
because we're actually trying to do GSO, not header validation.  However, I
guess the guest/backend must be generating a packet with an MSS, which
tricks us into thinking that it's GSO, but no GSO is actually requested.
In the case of the bridge, header validation does take place so the
situation is handled already.  It seems not ideal that the network backend
doesn't sanitize these packets but it's probably good that we handle
it in any case.

Bug #14772.
Reported-by: Deepesh Govindan <dgovindan@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agoofproto: Remove redundant call to ofconn_get_ofproto
Ben Pfaff [Mon, 21 Jan 2013 15:37:21 +0000 (07:37 -0800)]
ofproto: Remove redundant call to ofconn_get_ofproto

This is a cosmetic change. Remove the redundant call to ofconn_get_ofproto
in handle_flow_mod.

Signed-off-by: Paraneetharan Chandrasekaran <paraneetharanc@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodatapath: Fix nelink attribute size for flow.
Pravin B Shelar [Mon, 21 Jan 2013 07:15:07 +0000 (23:15 -0800)]
datapath: Fix nelink attribute size for flow.

Following patch fixes flow buffer size calculation to allocate
sufficient memory for all nested attributes in new tunnel
attribute.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Bug #14767

11 years agodatapath: Fix Flow dump operation.
Pravin B Shelar [Mon, 21 Jan 2013 07:14:36 +0000 (23:14 -0800)]
datapath: Fix Flow dump operation.

Following patch adds null check while inserting new netlink attribute.
This was introduced by commit 9b405f1aa8d175d (datapath: More
flexible kernel/userspace tunneling attribute.)

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Bug #14767

11 years agodatapath: More flexible kernel/userspace tunneling attribute.
Pravin B Shelar [Sat, 19 Jan 2013 02:10:59 +0000 (18:10 -0800)]
datapath: More flexible kernel/userspace tunneling attribute.

Following patch breaks down single ipv4_tunnel netlink attribute into
individual member attributes. It will help when we extend tunneling
parameters in future.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Bug #14611

11 years agodebian: Change openvswitch restart logic for kernel package.
Gurucharan Shetty [Thu, 17 Jan 2013 18:08:47 +0000 (10:08 -0800)]
debian: Change openvswitch restart logic for kernel package.

Currently, every time we install the non-dkms openvswitch kernel package,
we restart openvswitch. This has no useful effect when an Open vSwitch kernel
module is already loaded, because "/etc/init.d/openvswitch restart" does not
load the new version of the kernel module.

With this patch, we start openvswitch if there is no kernel module
currently loaded (which is a case for a fresh install of openvswitch). This
will load the kernel module.

If someone wants to use the latest kernel module after an upgrade, they need
to run "/etc/init.d/openvswitch-switch force-reload-kmod" manually.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoofproto: Add "actions=" to drop action in "ovs-appctl bridge/dump-flows".
Justin Pettit [Thu, 17 Jan 2013 08:31:20 +0000 (00:31 -0800)]
ofproto: Add "actions=" to drop action in "ovs-appctl bridge/dump-flows".

The function flow_stats_ds() did its own formatting when there were no
actions, but this didn't include "action=".  There's actually no reason
to special-case this, since ofpact_format() properly handles actions
with a zero length and prints it properly.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodpif-netdev: Limit scope of vlan in dp_netdev_execute_actions
Simon Horman [Thu, 17 Jan 2013 06:24:59 +0000 (15:24 +0900)]
dpif-netdev: Limit scope of vlan in dp_netdev_execute_actions

This is to make the code consistent with the proposed MPLS changes
and avoid cluttering the top of the NL_ATTR_FOR_EACH_UNSAFE loop.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoNEWS: Mention that bridge compatibility is gone.
Ben Pfaff [Thu, 17 Jan 2013 18:32:30 +0000 (10:32 -0800)]
NEWS: Mention that bridge compatibility is gone.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agodpif-linux: Fix segfault when a port already exists.
Justin Pettit [Wed, 16 Jan 2013 23:53:14 +0000 (15:53 -0800)]
dpif-linux: Fix segfault when a port already exists.

Commit 78a2d59c (dpif-linux.c: Let the kernel pick a port number if one
not requested.) changed the logic for port assignment, but didn't
properly handle some error conditions.  An attempt to add a tunnel port
that already exists would lead to a segfault.  This commit fixes the
logic to stop processing and return an error.

Reported-by: Gurucharan Shetty <shettyg@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoMakefile.am: add check that <assert.h> is not used from unexpected files.
Ben Pfaff [Wed, 7 Nov 2012 18:16:27 +0000 (10:16 -0800)]
Makefile.am: add check that <assert.h> is not used from unexpected files.

In general, with a few specific exceptions, ovs_assert is now preferred
over assert, so this commit adds a check for that in the top-level
Makefile.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoRemove useless use of <assert.h>.
Ben Pfaff [Tue, 6 Nov 2012 21:15:44 +0000 (13:15 -0800)]
Remove useless use of <assert.h>.

These files #included <assert.h> but didn't ever use assert.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoReplace most uses of assert by ovs_assert.
Ben Pfaff [Tue, 6 Nov 2012 21:14:55 +0000 (13:14 -0800)]
Replace most uses of assert by ovs_assert.

This is a straight search-and-replace, except that I also removed #include
<assert.h> from each file where there were no assert calls left.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoutil: Introduce ovs_assert macro.
Ben Pfaff [Thu, 17 Jan 2013 00:03:03 +0000 (16:03 -0800)]
util: Introduce ovs_assert macro.

An occasionally significant problem with the standard "assert" macro is
that it writes the failure message to stderr.  In our daemons, stderr is
generally redirected to /dev/null.  It's more useful to write the failure
message to the log, which is what the new ovs_assert macro introduced in
this patch does.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-ctl.in: Restore ofport values across force-reload-kmod.
Gurucharan Shetty [Fri, 11 Jan 2013 21:40:23 +0000 (13:40 -0800)]
ovs-ctl.in: Restore ofport values across force-reload-kmod.

If we want to upgrade from pre-1.10 branch to 1.10 or later
and restore flows across force-reload-kmod, we need to maintain
the value of ofport.

To do this, we fetch the value of ofport before the upgrade and use
it to populate the column 'ofport_request' after ovsdb is upgraded.
We need to do this before vswitchd is restarted as vswitchd
needs the ofport_request column populated before it starts.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-save: Add a helper command to maintain ofport value.
Gurucharan Shetty [Fri, 11 Jan 2013 21:01:55 +0000 (13:01 -0800)]
ovs-save: Add a helper command to maintain ofport value.

This patch adds a helper command: save-ofports. The command
will o/p a shell script that will set the 'ofport_request' column
of the interface table with the value of the corresponding ofport.

This command takes a list of bridges as input and will be used by
a future commit to restore the ofport value across force-reload-kmod.

This command is only useful while trying to upgrade from a pre-1.10
branch to 1.10 or a later branch.

Issue #13556
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
11 years agoovs-vsctl: Add --if-exists option to many database commands.
Ben Pfaff [Tue, 15 Jan 2013 21:23:53 +0000 (13:23 -0800)]
ovs-vsctl: Add --if-exists option to many database commands.

A few ovs-vsctl commands have accepted --if-exists options for some time,
to make it possible to execute them in cases where it doesn't really
matter if the records they touch exist.  This commit adds this option to
other commands.

This is intended for initial use with "ovs-vsctl set interface <iface>
ofport_request=<number>" commands in ovs-ctl for upgrades from OVS 1.9
to later versions.

This makes a very small incompatible change to the ovs-vsctl "get"
command: previously with --if-exists, only keys in map columns were
allowed to be missing; now with --if-eixsts, also records are allowed
to be missing.

CC: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobridge: Remove restriction on socket name.
Pavithra Ramesh [Tue, 15 Jan 2013 20:23:46 +0000 (12:23 -0800)]
bridge: Remove restriction on socket name.

Following patch removes restriction on the listening socket name that gets
configured as bridge controller. Currently, we only connect to sockets in a
specific directory with the name of the bridge. This patch removes the
restriction on the bridge name, keeping the directory restriction.

Bug #14029.
Signed-off-by: Pavithra Ramesh <paramesh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev: Add NULL get_tunnel_config for BSD.
Ed Maste [Wed, 16 Jan 2013 14:57:52 +0000 (09:57 -0500)]
netdev: Add NULL get_tunnel_config for BSD.

Commit f431bf7d78f3212d32bb3d122f783c5c796a1576 (netdev: Parse and make
available tunnel configuration.) added new method get_tunnel_config to
netdev_class but did not update netdev-bsd.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopython: Workaround UNIX socket path length limits
James Page [Wed, 16 Jan 2013 11:12:09 +0000 (11:12 +0000)]
python: Workaround UNIX socket path length limits

From aa28e8bfb646a54ba91e3545f3c0b9db39eddb7f Mon Sep 17 00:00:00 2001
From: James Page <james.page@ubuntu.com>
Date: Wed, 16 Jan 2013 10:52:59 +0000
Subject: [PATCH] python: Workaround UNIX socket path length limits
To: dev@openvswitch.org

UNIX socket paths have a limit in terms of length.  On Linux
this is 103 characters.

This is a problem in Debian/Ubuntu buildds which can generate
quite long paths.

This patch works around this issue by detecting when socket
connection/binding fails due to this issue and accessing the
socket path using a file descriptor path in /proc/self/fd.

The workaround is limited to Linux.

This is based on similar code in the C parts of OpenvSwitch.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAUTHORS: Add James Page.
Jesse Gross [Wed, 16 Jan 2013 17:20:34 +0000 (09:20 -0800)]
AUTHORS: Add James Page.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: support Linux 3.8 kernel
James Page [Wed, 16 Jan 2013 11:19:21 +0000 (11:19 +0000)]
datapath: support Linux 3.8 kernel

Add Linux 3.8 kernel to the range of supported kernel versions.

Signed-off-by: James Page <james.page@ubuntu.com>
[jesse: Update NEWS and FAQ]
Signed-off-by: Jesse Gross <jesse@nicira.com>
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>