sliver-openvswitch.git
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 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 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>
11 years agoflow: Fix harmless typo in flow_wildcards_hash().
Ben Pfaff [Fri, 14 Dec 2012 00:38:22 +0000 (16:38 -0800)]
flow: Fix harmless typo in flow_wildcards_hash().

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agometa-flow: Don't allow negative port numbers.
Justin Pettit [Fri, 14 Dec 2012 00:22:55 +0000 (16:22 -0800)]
meta-flow: Don't allow negative port numbers.

If a negative number is supplied, the parsing code used to convert it
into a signed one.  We ran into an incident where a third-party script
was attempting to get the OpenFlow port number for an interface, but got
-1 from the database, since the number had not yet been assigned.  This
was converted to 65535, which maps to OFPP_NONE and all flows with
ingress port OFPP_NONE were modified.  This commit disallows negative
port numbers to help prevent broken integration scripts from disturbing
the flow table.

Issue #14036

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoofp-util: Fix typo in invalid port range error message.
Justin Pettit [Thu, 13 Dec 2012 22:41:36 +0000 (14:41 -0800)]
ofp-util: Fix typo in invalid port range error message.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agodaemon: Start monitor process, not daemon process, in new session.
Ben Pfaff [Thu, 13 Dec 2012 22:01:23 +0000 (14:01 -0800)]
daemon: Start monitor process, not daemon process, in new session.

To keep control+C and other signals in the initiating session from killing
the monitor process, we need to put the monitor process into its own
session.  However, until this point, we've only done that for the daemon
processes that the monitor started, which means that control+C would kill
the monitor but not the daemons that it launched.

I don't know of a benefit to putting the monitor and daemon processes in
different sessions, as opposed to one new session for both of them, so
this change does the latter.

daemonize_post_detach() is called from one additional context where we'd
want to be in a new session, the worker_start() function, but that function
is documented as to be called after daemonize_start(), in which case we
will (after this commit) already have called setsid(), so no additional
change is required there.

Bug #14280.
Reported-by: Gordon Good <ggood@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agopackets: Change IP_ARGS interface to take an ovs_be32 instead of a pointer.
Ben Pfaff [Wed, 12 Dec 2012 23:26:21 +0000 (15:26 -0800)]
packets: Change IP_ARGS interface to take an ovs_be32 instead of a pointer.

An ovs_be32 is a more obvious way to represent an IP address than a
pointer to one.  It is also more type-safe, especially since "sparse" is
able to check that the argument is in network byte order.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
11 years agoovs-vsctl: Allow command-specific options to mingle with global options.
Ben Pfaff [Mon, 10 Dec 2012 22:24:36 +0000 (14:24 -0800)]
ovs-vsctl: Allow command-specific options to mingle with global options.

Until now, a command like "ovs-vsctl --may-exist add-br br0" yielded a
confusing error message.  Users had to realize that the correct form was
"ovs-vsctl -- --may-exist add-br br0", but instead they often reported a
bug or gave up in frustration.  Even though the behavior was documented, it
was counterintuitive.

This commit allows command-specific options to be mixed with global
options, making both forms of the command listed above equally acceptable.

CC: 691508@bugs.debian.org
Reported-by: Adam Heath <doogie@brainfood.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoAdd OpenFlow13 to the allowed protocols for ofproto testing.
Jarno Rajahalme [Fri, 7 Dec 2012 13:48:23 +0000 (15:48 +0200)]
Add OpenFlow13 to the allowed protocols for ofproto testing.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoOpenflow 1.1 queue set/get config placeholders.
Jarno Rajahalme [Fri, 7 Dec 2012 13:48:21 +0000 (15:48 +0200)]
Openflow 1.1 queue set/get config placeholders.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agovswitchd: Avoid writing to const struct
Ed Maste [Sat, 8 Dec 2012 23:23:12 +0000 (18:23 -0500)]
vswitchd: Avoid writing to const struct

When built with Clang, vswitchd segfaulted in ovsrec_open_vswitch_init,
from calling memset() on a const struct.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofproto: Report correct error for emergency flow with timeout.
Ben Pfaff [Thu, 1 Nov 2012 07:22:41 +0000 (00:22 -0700)]
ofproto: Report correct error for emergency flow with timeout.

The OpenFlow 1.0 specification says:

    Emergency flow mod messages must have timeout values set to zero.
    Otherwise, the switch must refuse the addition and respond with an
    ofp_error_msg with OFPET_FLOW_MOD_FAILED type and
    OFPFMFC_BAD_EMERG_TIMEOUT code.

but Open vSwitch reported OFPFMFC_TABLE_FULL in this case.  This commit
fixes the problem.

Fixes detailed_contr_sw_messages.EmerFlowTimeout failure in OFTest.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agovswitchd: Make the maximum size of MAC learning tables user-configurable.
Ben Pfaff [Sat, 8 Dec 2012 20:32:33 +0000 (12:32 -0800)]
vswitchd: Make the maximum size of MAC learning tables user-configurable.

We've had a couple of requests for this over the years.  It's easy to do,
so let's implement it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agovlog: New vlog/enable-rate-limit and vlog/disable-rate-limit commands.
Ben Pfaff [Sat, 8 Dec 2012 20:23:08 +0000 (12:23 -0800)]
vlog: New vlog/enable-rate-limit and vlog/disable-rate-limit commands.

A few times while troubleshooting it would have been useful to get
complete logs, rather than post-rate-limiting snapshots of them.  These
ovs-appctl commands make that possible.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoAdded RHEL ovs-ifup STP option handling
Andres Toomsalu [Wed, 28 Nov 2012 12:38:29 +0000 (14:38 +0200)]
Added RHEL ovs-ifup STP option handling

Signed-off-by: Andres Toomsalu <andres@active.ee>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonx-match: Log a warning when a wildcarded bit is set to 1.
Ben Pfaff [Wed, 3 Oct 2012 16:48:57 +0000 (09:48 -0700)]
nx-match: Log a warning when a wildcarded bit is set to 1.

This was prompted by a conversation on the openflow-discuss mailing list
where developers of some OpenFlow switches mentioned that they save an
entire copy of raw flows passed in by controllers because of the
possibility that there might be wildcarded 1-bits, e.g. something like
192.168.1.1/255.255.0.0 instead of 192.168.0.0/255.255.0.0.  I've always
intended that this not be necessary, but it was never explicitly written
down.  This commit starts the process of updating OVS to make this a
requirement, by logging a warning whenever such a NXM or OXM entry is seen,
and by updating the spec in nicira-ext.h to describe my intent.

This is related to issue EXT-238 (OXM should require that 0-bits in mask
be 0-bits in value) in the Open Networking Foundation's "extensibility"
bugtracker at https://www.opennetworking.org/bugs/browse/EXT-238.
(Unfortunately one must be an employee of an ONF member company to
access this bug tracker.  It's the network that's open, not the
foundation.)

Thanks to Zoltán Lajos Kis, Dan Talayco, Rob Sherwood, and HIDEyuki
Shimonishi for participating in the discussion on openflow-discuss.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agonetdev-bsd: Use underlying tap device on netdev_bsd_listen().
Ed Maste [Fri, 7 Dec 2012 16:28:26 +0000 (11:28 -0500)]
netdev-bsd: Use underlying tap device on netdev_bsd_listen().

This is a trivial port to netdev-bsd of Justin Pettit's netdev-linux
commit 33d82a56d (netdev-linux: Use underlying tap device on
netdev_linux_listen().), which had the commit message:

  Commit acf608 (ofproto-dpif: Use a single underlying datapath across
  multiple bridges.) broke connectivity to userspace datapath devices.  The
  code assumed the first caller to open a tap device with
  netdev_linux_open() wanted to write to it.  This commit moves that logic
  to when netdev_linux_listen() is called.

This fixes the userspace datapath on FreeBSD.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agotests: Avoid race condition in flow monitoring test.
Ben Pfaff [Fri, 7 Dec 2012 15:38:11 +0000 (07:38 -0800)]
tests: Avoid race condition in flow monitoring test.

The execution of "ovs-appctl -t ovs-ofctl ofctl/send" could happen before
ovs-appctl received and printed the
    NXST_FLOW_MONITOR reply (xid=0x0):
     event=ADDED table=0 cookie=0 in_port=2 actions=output:1
msesage, which could cause the
    send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
message to be printed before rather than after the NXST_FLOW_MONITOR reply.

This commit fixes the problem by inserting a serializing barrier.

Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-linux: Use underlying tap device on netdev_linux_listen().
Justin Pettit [Thu, 6 Dec 2012 01:02:48 +0000 (17:02 -0800)]
netdev-linux: Use underlying tap device on netdev_linux_listen().

Commit acf608 (ofproto-dpif: Use a single underlying datapath across
multiple bridges.) broke connectivity to userspace datapath devices.
The code assumed the first caller to open a tap device with
netdev_linux_open() wanted to write to it.  This commit moves that logic
to when netdev_linux_listen() is called.

Thanks to Ben Pfaff for helping debug the issue.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Reported-by: Simon Horman <horms@verge.net.au>
Tested-by: Simon Horman <horms@verge.net.au>
11 years agolinux/Makefile.main.in, acinclude: preparation for linux 3.7.0+
Isaku Yamahata [Fri, 7 Dec 2012 03:37:02 +0000 (12:37 +0900)]
linux/Makefile.main.in, acinclude: preparation for linux 3.7.0+

The version.h is moved from include/linux/version.h to
include/generated/uapi/linux/version.h.
So check both pathes.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoPrevent pager from appearing during build
Ed Maste [Fri, 7 Dec 2012 15:26:12 +0000 (10:26 -0500)]
Prevent pager from appearing during build

The config.h check added in commit 9e4ba00 may bring up the pager during
build (depending on git config).

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoMakefile.am: Exclude third-party code from config.h check.
Jesse Gross [Thu, 6 Dec 2012 22:14:02 +0000 (14:14 -0800)]
Makefile.am: Exclude third-party code from config.h check.

It doesn't make sense to enforce our rules for code in the third-
party directory.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoMakefile.am: Add a build check that every .c file #includes <config.h>.
Ben Pfaff [Thu, 6 Dec 2012 20:48:48 +0000 (12:48 -0800)]
Makefile.am: Add a build check that every .c file #includes <config.h>.

This can find mysterious build problems.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ed Maste <emaste@freebsd.org>
11 years agolib: remove duplicate #include <config.h>
Ed Maste [Thu, 6 Dec 2012 20:14:34 +0000 (15:14 -0500)]
lib: remove duplicate #include <config.h>

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agonetdev-vport: Drop extra parentheses around "vxlan".
Jesse Gross [Thu, 6 Dec 2012 19:10:08 +0000 (11:10 -0800)]
netdev-vport: Drop extra parentheses around "vxlan".

Cc: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agovxlan: Use sk_release_kernel() instead of sock_release().
Jesse Gross [Thu, 6 Dec 2012 19:06:06 +0000 (11:06 -0800)]
vxlan: Use sk_release_kernel() instead of sock_release().

A socket that is created using sock_create_kern() and then switched
to a namespace using sk_change_net() should be released using
sk_release_kernel() instead of sock_release().  This is because
sk_change_net() has already released a reference to the namespace
and we shouldn't try to release it again later.

Cc: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agodatapath: Add support for VXLAN tunnels to Open vSwitch
Kyle Mestery [Wed, 5 Dec 2012 21:06:46 +0000 (16:06 -0500)]
datapath: Add support for VXLAN tunnels to Open vSwitch

Add support for VXLAN tunnels to Open vSwitch. Add support
for setting the destination UDP port on a per-port basis.
This is done by adding a "dst_port" parameter to the port
configuration. This is only applicable currently to VXLAN
tunnels.

Please note this currently does not implement any sort of multicast
learning. With this patch, VXLAN tunnels must be configured similar
to GRE tunnels (e.g. point to point). A subsequent patch will implement
a VXLAN control plane in userspace to handle multicast learning.

This patch set is based on one posted by Ben Pfaff on Oct. 12, 2011
to the ovs-dev mailing list:

http://openvswitch.org/pipermail/dev/2011-October/012051.html

The patch has been maintained, updated, and freshened by me and a
version of it is available at the following github repository:

https://github.com/mestery/ovs-vxlan/tree/vxlan

I've tested this patch with multiple VXLAN tunnels between hosts
using different UDP port numbers. Performance is on par (though
slightly faster) than comparable GRE tunnels.

See the following IETF draft for additional information about VXLAN:
http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-02

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
[jesse: simplify error path in vxlan_tunnel_setup, don't print default VXLAN port,
        and remove dead code]
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agorconn: Maintain original allowed_versions instead of substituting for zero.
Ben Pfaff [Wed, 5 Dec 2012 02:23:00 +0000 (18:23 -0800)]
rconn: Maintain original allowed_versions instead of substituting for zero.

rconn_create() was substituting OFPUTIL_DEFAULT_VERSIONS if an
allowed_versions of 0 was passed in.  At the same time,
connmgr_set_controllers() compared the adjusted value of allowed_versions
against the original value, saw that they were different, and concluded
that it should kill off and recreate the rconn with the "corrected"
allowed_versions.

This commit fixes the problem by no longer adjusting allowed_versions.
There is no need, because it is only used in contexts where the original
version is OK.

This problem was introduced by commit 90ef0206ea8f5a39 (connmgr:
Reinitialise controllers if protocols changes).

Bug #14126.
CC: Simon Horman <horms@verge.net.au>
Reported-by: Natasha Gude <natasha@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Add table of supported Linux versions.
Ben Pfaff [Tue, 4 Dec 2012 21:43:14 +0000 (13:43 -0800)]
FAQ: Add table of supported Linux versions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
Acked-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Avoid useless holes in struct vport
Thomas Graf [Tue, 4 Dec 2012 17:39:13 +0000 (09:39 -0800)]
datapath: Avoid useless holes in struct vport

Having the 16bit port_no in between a set of pointers creates
an unwanted and useless hole in the struct.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Use eth_mac_addr() instead of duplicating it
Thomas Graf [Tue, 4 Dec 2012 17:33:47 +0000 (09:33 -0800)]
datapath: Use eth_mac_addr() instead of duplicating it

bonus: if we ever are to use IFF_LIVE_ADDR_CHANGE for
anything further than to check availability in eth_mac_addr(),
Open vSwitch will be ready for that.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agodatapath: Backport eth_mac_addr().
Jesse Gross [Tue, 4 Dec 2012 18:06:55 +0000 (10:06 -0800)]
datapath: Backport eth_mac_addr().

eth_mac_addr() has always been available on the kernels that we
support but the behavior has varied over time.  This provides a
backport that is equivalent to the current kernel, previous OVS
behavior, and the bridge.

Signed-off-by: Jesse Gross <jesse@nicira.com>
11 years agoofp-errors: Make every error encodable.
Ben Pfaff [Sat, 1 Dec 2012 00:22:52 +0000 (16:22 -0800)]
ofp-errors: Make every error encodable.

Until now, some values could not be encoded to send over OpenFlow, for a
few possible reasons.  This meant that, when one of these situations came
up, that a controller would not receive any notification that its request
failed.  This is not a good way to behave, so this commit changes the
error encoder so that, if a particular error cannot be encoded, it will
instead encode a fallback error code.

This commit also slightly simplifies ofconn_send_error() because it no
longer has to handle ofperr_encode_error() returning NULL.

Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-errors: Remove OFPERR_* values for error categories.
Jarno Rajahalme [Fri, 30 Nov 2012 22:32:12 +0000 (14:32 -0800)]
ofp-errors: Remove OFPERR_* values for error categories.

The main use of OFPERR_* is to define specific errors, but OFPERR_* also
existed for each possible category of error, to enable partial decoding of
unknown specific errors within a known category.  However, in practice,
it was very easy to misuse the error categories as if they were particular
errors.  This commit removes the error category values, to make that error
impossible.

(If partial decoding of unknown specific errors turns out to have been a
valuable feature, then we can reintroduce it some other way.)

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-errors: Correctly encode errors as extensions or not depending on domain.
Ben Pfaff [Fri, 30 Nov 2012 22:18:03 +0000 (14:18 -0800)]
ofp-errors: Correctly encode errors as extensions or not depending on domain.

When ofp-errors was introduced, each OFPERR_* was either an extension or
not.  However, since then, some Nicira extension error code have been
given official error codes in later OpenFlow versions, so now whether an
OFPERR_* is an extension depends on the OpenFlow versions.  This means
that certain errors were encoded incorrectly as extensions in later
OpenFlow versions.  This commit fixes the problem.

This commit also adds a test that should prevent a regression.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoDon't use error categories as if they were actually errors.
Jarno Rajahalme [Fri, 30 Nov 2012 21:45:08 +0000 (13:45 -0800)]
Don't use error categories as if they were actually errors.

The OFPERR_* naming scheme is confusing, because it mixes categories with
specific errors.  Categories can't be encoded for sending to controllers,
so this is a problem.  This commit fixes up the cases where categories
were used as errors, replacing them by real errors types.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-errors: Fix typo in comment.
Jarno Rajahalme [Fri, 30 Nov 2012 22:32:51 +0000 (14:32 -0800)]
ofp-errors: Fix typo in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
11 years agoINSTALL.Debian: New instructions for installing on Debian.
Ben Pfaff [Tue, 4 Dec 2012 15:39:59 +0000 (07:39 -0800)]
INSTALL.Debian: New instructions for installing on Debian.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobridge: Set mac address when no physical ports attached.
Justin Pettit [Tue, 4 Dec 2012 03:05:08 +0000 (19:05 -0800)]
bridge: Set mac address when no physical ports attached.

Commit 1a8cfb41(bridge: Drop warning about thedefault bridge Ethernet
address.) attempted to reduce unnecessary logging, but deleted some code
that was necessary to set the mac address on local ports when no
physical ports were attached.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Issue #14126

11 years agoINSTALL.RHEL: Explain how to work around RHEL 6 kernel-devel bug.
Ben Pfaff [Mon, 3 Dec 2012 20:59:08 +0000 (12:59 -0800)]
INSTALL.RHEL: Explain how to work around RHEL 6 kernel-devel bug.

Based on http://networkstatic.net/open-vswitch-red-hat-installation/

Reported-by: Brent Salisbury <brent.salisbury@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agoinclude/openflow: Moved remaining common definitions from openflow-1.0.h
Jarno Rajahalme [Mon, 3 Dec 2012 10:37:56 +0000 (12:37 +0200)]
include/openflow: Moved remaining common definitions from openflow-1.0.h

 Moved remaining common definitions from openflow-1.0.h to
 openflow-common.h and renamed 1.0 specific definitions with
 the "10" infix. Added hstamp rules for new headers, fixed
 non-ASCII characters in openflow-1.3.h, Commented out
 trailing zero-length data members.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoconnmgr: Reinitialise controllers if protocols changes
Simon Horman [Mon, 3 Dec 2012 07:30:19 +0000 (16:30 +0900)]
connmgr: Reinitialise controllers if protocols changes

This is allows protocol changes to take effect without needing
to restart ovs-vswitchd. However, connected controllers will
be disconnected regardless of if the OpenFlow protocol of the
session remains acceptable or not.

My feeling is that this is acceptable to avoid the complexity
of further modifications to ofconn and pvconn to allow live
updates of protocols.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-ctl: Don't run "ovs-save save-flows" on fake bridges.
Justin Pettit [Sat, 1 Dec 2012 02:58:09 +0000 (18:58 -0800)]
ovs-ctl: Don't run "ovs-save save-flows" on fake bridges.

Previously, ovs-ctl would determine which bridges to run "ovs-save
save-flows" on by running "ovs-vsctl list-br".  In addition to real
bridges, that command also returns fake bridges.  An error is returned
when "ovs-save save-flows" is run on a fake bridge.  By using the newly
added "--real" flag to "ovs-vsctl list-br", we can get rid of that
unnecessary warning.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoovs-vsctl: Add "--real" and "--fake" options to "list-br".
Justin Pettit [Sat, 1 Dec 2012 02:50:18 +0000 (18:50 -0800)]
ovs-vsctl: Add "--real" and "--fake" options to "list-br".

By default, "ovs-vsctl list-br" returns all bridges, real or fake.  This
commit adds "--real" and "--fake" options that limit the output to only
bridges of that type.  This will be useful in a future commit that needs
to perform actions only on bridges of a particular type.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
11 years agoAdd OpenFlow 1.2 parse-flows test
Simon Horman [Fri, 30 Nov 2012 01:04:07 +0000 (10:04 +0900)]
Add OpenFlow 1.2 parse-flows test

This is based on an existing OpenFlow 1.0 variant of this test.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoofp-actions: Add OpenFlow1.1+ Set Queue action
Simon Horman [Fri, 30 Nov 2012 01:04:06 +0000 (10:04 +0900)]
ofp-actions: Add OpenFlow1.1+ Set Queue action

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoovs-dpctl: Describe -s option in usage message.
Ben Pfaff [Fri, 30 Nov 2012 00:14:53 +0000 (16:14 -0800)]
ovs-dpctl: Describe -s option in usage message.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
11 years agobond: Fix segfault sending learning packets with LACP disabled.
Ben Pfaff [Thu, 29 Nov 2012 17:32:28 +0000 (09:32 -0800)]
bond: Fix segfault sending learning packets with LACP disabled.

It is essentially an invalid configuration to disable LACP but request TCP
balancing: in this configuration, the bond drops all packets.  But
may_send_learning_packets() would still indicate that learning packets
should be sent, so bond_compose_learning_packet() would try to choose an
output slave for those packets, which would be NULL (because all packets
are dropped), which would cause a segfault upon dereference.

This commit fixes the problem by making may_send_learning_packets() no
longer indicate that learning packets should be sent.

I tested this issue by modifying bond_should_send_learning_packets() to
always return true if may_send_learning_packets() returns true, and then
introducing the invalid configuration described above.  Without this comit,
ovs-vswitchd segfaults quickly; with this commit, it does not.

Bug #14090.
Reported-by: Kiran Shanbhog <kiran@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agoFAQ: Add Q&A to emphasize that VLANs partition a network.
Ben Pfaff [Thu, 29 Nov 2012 17:12:10 +0000 (09:12 -0800)]
FAQ: Add Q&A to emphasize that VLANs partition a network.

A few users don't seem to understand this.

Signed-off-by: Ben Pfaff <blp@nicira.com>
11 years agobridge: Drop warning about the default bridge Ethernet address.
Ben Pfaff [Fri, 26 Oct 2012 00:02:01 +0000 (17:02 -0700)]
bridge: Drop warning about the default bridge Ethernet address.

This information is also available via ovs-ofctl and through other means,
and it's not really anything we need to warn about anyhow.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>