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.
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>
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).
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.
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>
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.
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.
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.
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.
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.
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.
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.
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>
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>
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>
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>
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.
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>
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>
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>
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>
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.
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:
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>
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>
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>
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.
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>
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>
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.
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>
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.
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>
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>
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.
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.
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>
Ben Pfaff [Thu, 29 Nov 2012 06:22:38 +0000 (22:22 -0800)]
ovs-ofctl: Reject impossible protocols configurations at startup.
The -O and -F options interact, so that it's possible to select only
flow formats that are not supported on a given OpenFlow version. It seems
best to report these problems up front rather than failing in a more
mysterious way later.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
Ben Pfaff [Thu, 29 Nov 2012 05:41:05 +0000 (21:41 -0800)]
ofp-util: New functions for converting protocols to and from versions.
The values of enum ofputil_protocol have meanings that overlap with
OpenFlow version numbers. These new functions provide ways to figure out
these overlaps.
These functions will be used for the first time in an upcoming commit.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
Ben Pfaff [Thu, 29 Nov 2012 04:43:02 +0000 (20:43 -0800)]
ofp-util: Make "OXM" flow format name include both OpenFlow 1.2 and 1.3.
To my mind, it makes sense, when a user requests OXM as the flow format,
to allow any protocol based on the OXM flow format to be used. Until this
commit, however, "OXM" was specifically OpenFlow 1.2, and "OpenFlow13" was
required to request OXM on OpenFlow 1.3.
This doesn't affect the behavior of any released version of Open vSwitch.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Simon Horman <horms@verge.net.au>
Jesse Gross [Wed, 28 Nov 2012 20:15:49 +0000 (12:15 -0800)]
datapath: Use RCU callback when detaching netdevices.
Currently, each time a device is detached from an OVS datapath
we call synchronize RCU before freeing associated data structures.
However, if a bridge is deleted (which detaches all ports) when
many devices are connected then there can be a long delay. This
switches to use call_rcu() to group the cost together.
Simon Horman [Tue, 27 Nov 2012 18:12:26 +0000 (10:12 -0800)]
lib: Add helpers for OpenFlow version command line options
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com renamed some functions and options and revised
the documentation] Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Tue, 27 Nov 2012 15:44:22 +0000 (17:44 +0200)]
Initial OpenFlow 1.3 support
Initial OpenFlow 1.3 support with new include/openflow/openflow-1.3.h.
Most of the messages that differ from 1.2 are implemented. OFPT_SET_ASYNC
is implemented via NX_SET_ASYNC_CONFIG, other new message types are yet to
be implemented. Stats replies that add duration fields are implemented at
encode/decode level only. Test cases for implemented features are included.
Remaining FIXME:s should not cause runtime aborts. Make check comes out
clean.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Jarno Rajahalme [Mon, 26 Nov 2012 16:17:08 +0000 (18:17 +0200)]
Fix handling of OFPP_ANY in OpenFlow 1.1 and later.
Add OFPP_ANY to include/openflow/openflow-1.1.h, and allow it as a port in
queue stats request. Make ovs_ofctl use OFPP_ANY instead of OFPP_ALL for queue
stats requests on OF 1.1+.
This patch changes "none" ports print out. "none" is still accepted on input
for backwards compatibility, but it prints out as "ANY". To make this less
confusing, I changed the test cases to use "controller" or "any" instead of
"none". The test case that tests for both "none" and "controller" still tests
for them.
Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
vswitchd: Make Interface's ofport a persistent column.
Currently, the 'ofport' column in Interface table is
ephemeral and is populated by vswitchd everytime it is
started or when a new interface is created with vswitchd
running.
Making it persistent lets vswitchd try and assign the
same ofport number to a particular interface across
restarts. This is just a fallback option when
'ofport_request' column is empty.
Commit a41754333f6 (ovs-ctl.in: Ability to save flows and kernel
datapath config.) made ovs-ctl able to usefully save and restore
the flow table across loading and unloading the OVS kernel module
and stopping and starting the OVS daemons. To ensure that the
flow table was still meaningful, it ensured that the datapath port
numbers were the same with the old and new versions of the kernel
module.
However, later commit e1b1d06afde (Separate OpenFlow port numbers
from datapath ones.) changed the OpenFlow implementation so that
keeping the same datapath port numbers no longer ensured that the
OpenFlow port numbers would be the same. This caused a regression
in saving and restoring the flow table. Although the flow table
was still saved and restored, it was no longer useful, since the
datapath port numbers might change.
This commit does not fix the regression, but it does drop the code
that saves and restores the port datapath numbers, since it is no
longer useful. The following commit fixes the regression.
Ansis Atteka [Thu, 22 Nov 2012 21:00:05 +0000 (13:00 -0800)]
vswitchd: fix 32-bit builds
My previous 72e8bf28bb38e8816435c64859fb350215b6a9e6 (datapath:
add skb mark matching and set action) commit broke 32-bit builds.
This patch assures that size of struct flow is equal on both
32-bit and 64-bit architectures so that build asserts would
not fire anymore.
Acked-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Ben Pfaff [Thu, 22 Nov 2012 06:09:55 +0000 (22:09 -0800)]
python/ovs/stream: Fix Stream.connect() retval for incomplete connection.
If the loop condition in Stream.connect() was false, which is especially
likely for TCP connections, then Stream.connect() would return None,
which violates its documented behavior. This commit fixes the problem.
Ethan Jackson [Wed, 10 Oct 2012 20:33:54 +0000 (13:33 -0700)]
ovs-ofctl: Don't rely on stat() to check unix sockets.
ESX supports unix sockets, but they don't manifest themselves in
file system like they do on Linux. Instead of using stat to check
if a unix socket exist, this patch simply tries to open it instead.