Ben Pfaff [Wed, 24 Feb 2010 21:42:43 +0000 (13:42 -0800)]
Fix excessive white space in manpages.
In nroff manpages, a blank line adds vertical white space. When this is
followed by another command that also starts a new paragraph, the result
is a vertical skip twice as big as the normal inter-paragraph gap. The
solution is to use a line that contains just "." for white space within
the manpage, instead of a blank line. The resulting manpages look better.
If an OpenFlow description was too long, it would not be properly
truncated with a final null character. In addition to properly terminating
the string, this set of changes prints a warning if a description is too
long and standardizes on a naming standard for description variables.
Justin Pettit [Fri, 29 Jan 2010 23:45:46 +0000 (15:45 -0800)]
ovs-openflowd: Standardize on OpenFlow description option
ovs-vswitchd used a slightly different way to set the manufacturer,
hardware revision, software revision, serial number, and datapath
description than ovs-openflowd. This standardizes on the ovs-vswitch
style and describes how to use them in the man page.
Justin Pettit [Wed, 20 Jan 2010 06:47:33 +0000 (22:47 -0800)]
ofproto: Set protocol version to 0x01 (OpenFlow 1.0)
Finalize OpenFlow 1.0 wire-compatibility:
- Set protocol version to 0x01
- Remove references to retired OFPC_MULTI_PHY_TX
- Clean extraneous spaces in header file
NOTE: This is the final commit in the OpenFlow 1.0 set. Starting with
this commit, OVS is OpenFlow 1.0 wire-compatible. Slicing is not yet
implemented.
Justin Pettit [Wed, 20 Jan 2010 06:35:18 +0000 (22:35 -0800)]
ofproto: Querying port stats for individual ports (OpenFlow 1.0)
OpenFlow 1.0 adds "port_no" field to the Port Stat request messages to
allow stats for individual ports to be queried. Port stats for all ports
can still be requested by specifying OFPP_NONE as the port number.
NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0 until
the final commit in this OpenFlow 1.0 set.
Justin Pettit [Tue, 19 Jan 2010 23:35:02 +0000 (15:35 -0800)]
ofproto: Improve resolution of flow stats and removed messages (OpenFlow 1.0)
OpenFlow 1.0 increases the resolution of flow stats and flow removed messages
from seconds to (potentially) nanoseconds. The spec stats that only
millisecond granularity is required, so that's all we provide at this
time. Increasing to nanoseconds would require more significant code
change and would not provide an appreciable improvement in real world
use.
NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0 until
the final commit in this OpenFlow 1.0 set.
Justin Pettit [Tue, 10 Nov 2009 00:43:47 +0000 (16:43 -0800)]
ofproto: Add support for matching IP addresses in ARP header (OpenFlow 1.0)
The OpenFlow 1.0 specification supports matching the IP address and
opcode in ARP messages. The datapath already supports this, so this
commit merely exposes that through the OpenFlow module.
NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0
until the final commit in this OpenFlow 1.0 set.
Justin Pettit [Wed, 13 Jan 2010 07:22:22 +0000 (23:22 -0800)]
ofproto: Add support for flow cookies (OpenFlow 1.0)
In OpenFlow 1.0, flows have been extended to include an opaque
identifier, referred to as a cookie. The cookie is specified by the
controller when the flow is installed; the cookie will be returned as
part of each flow stats and flow removed message.
NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0 until
the final commit in this Openflow 1.0 set.
In OpenFlow 1.0, a "dp_desc" character array was added to the ofp_desc_stats
structure that allows a human readable description of the datapath to be
provided.
NOTE: OVS at this point is not wire-compatible with OpenFlow 1.0 until
the final commit in this OpenFlow 1.0 set.
Justin Pettit [Fri, 13 Nov 2009 20:41:57 +0000 (12:41 -0800)]
ofproto: Add support for barrier command (OpenFlow 0.9)
OpenFlow 0.9 introduces the concept of the barrier command. When the
controller sends a Barrier Request, the switch is not allowed to respond
with a Barrier Reply until it has finished processing any other commands
that preceded it. This commit provides that support.
NOTE: OVS at this point is not wire-compatible with OpenFlow 0.9 until the
final commit in this OpenFlow 0.9 set.
Justin Pettit [Fri, 13 Nov 2009 19:36:02 +0000 (11:36 -0800)]
ofproto: Cleanups to openflow.h (OpenFlow 0.9)
This commit cleans up a few comments in openflow.h. The only one of
significance is that OpenFlow port numbers now begin enumeration at 1.
OVS already behaved in this manner, so this is just a documentation
issue for us.
NOTE: OVS at this point is not wire-compatible with OpenFlow 0.9 until the
final commit in this OpenFlow 0.9 set.
In OpenFlow 0.9, flow "expiration" messages are sent when flows are
explicitly removed by a delete action. As such, the message is renamed
from Flow Expired to Flow Removed. This commit adds that support as well
as supporting the ability to choose sending these messages on a per flow
basis.
NOTE: OVS at this point is not wire-compatible with OpenFlow 0.9 until the
final commit in this OpenFlow 0.9 set.
This commit adds (some) support for a couple new OpenFlow 0.9 features:
- The OFPFF_CHECK_OVERLAP flag in Flow Mod messages allows the
controller to prevent flows that would conflict at the same
priority.
- An emergency flow cache that contains a small flow table that is
used if the switch loses connectivity with the controller. I
believe the design has fundamental flaws and looks likely to be
retired. If a controller attempts to add a flow to the emergency
flow cache, OVS always responds that the tables are full.
The OpenFlow 0.9 error codes are also sync'd in the commit.
NOTE: OVS at this point is not wire-compatible with OpenFlow 0.9 until the
final commit in this OpenFlow 0.9 set.
Justin Pettit [Wed, 11 Nov 2009 22:59:49 +0000 (14:59 -0800)]
ofproto: Match VLAN PCP and rewrite ToS bits (OpenFlow 0.9)
Starting in OpenFlow 0.9, it is possible to match on the VLAN PCP
(priority) field and rewrite the IP ToS/DSCP bits. This check-in
provides that support and bumps the wire protocol number to 0x98.
NOTE: The wire changes come together over the set of OpenFlow 0.9 commits,
so OVS will not be OpenFlow-compatible with any official release between
this commit and the one that completes the set.
Ben Pfaff [Tue, 23 Feb 2010 23:14:15 +0000 (15:14 -0800)]
ofproto: Delete fail-open flow when turning off fail-open mode.
fail_open_destroy() was not deleting the fail-open flow, so turning off
fail-open mode did not work if fail-open had already been triggered.
This commit fixes the problem.
Ben Pfaff [Tue, 23 Feb 2010 00:28:30 +0000 (16:28 -0800)]
tests: Add basic unit tests for interface-reconfigure.
These tests are probably not perfect, and we could and should certainly
add more of them, but they should at least help us to notice when commits
change interface-reconfigure's behavior.
Ben Pfaff [Tue, 23 Feb 2010 00:26:50 +0000 (16:26 -0800)]
xenserver: Add --no-syslog feature to interface-reconfigure.
This makes it easier to do unit tests (some of which will be added in an
upcoming commit) by allowing messages to be read from stderr instead of
having to somehow intercept syslog calls.
Ben Pfaff [Tue, 23 Feb 2010 00:25:54 +0000 (16:25 -0800)]
xenserver: Add --root-prefix feature to interface-reconfigure.
This makes it easier to do unit tests (some of which will be added in an
upcoming commit) by allowing fake configuration files and scripts to be
added in a directory other than the real root.
Ben Pfaff [Tue, 23 Feb 2010 00:41:19 +0000 (16:41 -0800)]
xenserver: Set xs-network-uuids for both datapath and VLAN bridges.
It makes sense to set xs-network-uuids for every bridge, so this commit
does so. It also makes the code a bit more readable by factoring logic
out into a new function.
Ben Pfaff [Mon, 22 Feb 2010 21:08:10 +0000 (13:08 -0800)]
xenserver: Fix bringing up VLAN PIFs.
In configure_datapath(), bringing up a VLAN PIF's datapath is no different
from bringing up a non-VLAN PIF's datapath, but the code was making
unnecessary distinctions. Also, the test
if parent and datapath:
did not work at all, because there was no variable named 'datapath' in
scope and no obvious source of one.
In preconfigure(), it then becomes necessary to create a VLAN bridge for a
VLAN PIF, in a straightforward way.
Ben Pfaff [Tue, 23 Feb 2010 17:47:31 +0000 (09:47 -0800)]
xenserver: Hoist identical bridge and vswitch functions into common code.
The previous commit made pif_bridge_name() in the bridge and vswitch
versions of interface-reconfigure functionally identical, so this commit
hoists them into a single common implementation in InterfaceReconfigure.py.
pif_is_bridged() also comes along for the ride because it is also generic
and because it is logically related. Only the bridge code uses it at the
moment.
Suggested-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 22 Feb 2010 20:53:17 +0000 (12:53 -0800)]
xenserver: Accept VLAN PIFs in pif_bridge_name().
pif_bridge_name() was written when the vswitch interface-reconfigure was
working with the raw Open vSwitch configuration via ovs-cfg-mod. Then,
it made no sense to ask for the "bridge name" of a VLAN PIF, because a
VLAN PIF didn't have a bridge.
Now, however, the vSwitch interface-reconfigure works with ovs-vsctl, which
provides a thin layer over the OVS configuration that makes VLAN bridges
appear to exist. So now it makes sense to ask for the bridge of a VLAN
PIF, and this commit enables that.
Ben Pfaff [Tue, 23 Feb 2010 00:36:30 +0000 (16:36 -0800)]
xenserver: Delete ports by interface name.
ovs-vsctl command "--if-exists del-port eth0" does nothing if eth0 is on
a bridge as part of a bond, because the bond's port name is not eth0 but
something else. But interface-reconfigure needs to do that, so this commit
adds that ability to ovs-vsctl and modifies interface-reconfigure to use it.
Ben Pfaff [Mon, 15 Feb 2010 19:31:32 +0000 (11:31 -0800)]
ovsdb: Allow ovsdb_log_open()'s caller to choose whether to lock.
The current callers of ovsdb_log_open() always want to lock the file if
they are accessing it for read/write access. An upcoming commit will add
a new caller that does not fit this model (it wants to lock the file
across a wider region) and so the caller should be able to choose whether
to do locking. This commit adds that ability.
Also, get rid of the use of <fcntl.h> flags to choose the open mode, which
has always seemed somewhat crude and which this change would make even
cruder.
Ben Pfaff [Fri, 12 Feb 2010 19:34:10 +0000 (11:34 -0800)]
ovsdb-client: Improve HTML output.
This commit introduces links from UUIDs to rows that represent them and
shortens UUIDs added to tables to their first 8 characters. This makes
the output more readable.
Ben Pfaff [Wed, 10 Feb 2010 19:18:48 +0000 (11:18 -0800)]
ofproto: Avoid passing indeterminate value to rule_insert().
The 'in_port' argument to rule_insert() is only used if its 'packet'
argument is nonnull, so this is not, strictly speaking, a bug, but it
seems much cleaner.
The default -1 value of in_port matches what pktbuf_retrieve() stores
there on failure.
Ben Pfaff [Wed, 10 Feb 2010 19:04:30 +0000 (11:04 -0800)]
sflow: Don't assign value that is never used.
The "error" return from collectors_create() is actually not that
interesting, because there could still be some collectors configured
properly anyhow, so we might as well discard the error return here,
without even assigning it to a variable.
Ben Pfaff [Wed, 10 Feb 2010 18:51:11 +0000 (10:51 -0800)]
ovsdb: Add default case to ovsdb_mutation_set_execute().
The value of 'error' is indeterminate if m->mutator is not set to a valid
value here, so we should add a default case to handle the exception. It
shouldn't happen, of course.
Ben Pfaff [Thu, 11 Feb 2010 18:34:45 +0000 (10:34 -0800)]
netdev-linux: Avoid fiddling with indeterminate data.
If we are using netlink to get stats and get_ifindex() fails, then for
an internal network device we will then swap around a bunch of
indeterminate (uninitialized) data values. That won't hurt anything--the
caller will still set them to all-1-bits due to the error--but it still
seems wrong. So this commit avoid it.
Found using Clang (http://clang-analyzer.llvm.org/).
Ben Pfaff [Wed, 10 Feb 2010 19:13:09 +0000 (11:13 -0800)]
vswitch: Fix uninitialized variable.
The 'ip' variable in this inner "if" statement shadows a variable with
the same name in the enclosing block. The variable in the inner block
is never initialized.
Ben Pfaff [Wed, 10 Feb 2010 18:41:44 +0000 (10:41 -0800)]
ovs-brcompatd: Handle transaction errors slightly more gracefully.
It is not a good idea to just exit on an OVSDB transaction error.
TXN_TRY_AGAIN will definitely happen in practice; TXN_ERROR should not but
we should not just fail if it does.
Ben Pfaff [Tue, 9 Feb 2010 18:17:58 +0000 (10:17 -0800)]
ovsdb: Add support for multiple databases to the protocol.
This also adds protocol compatibility to the database itself and to
ovsdb-client. It doesn't actually add multiple database support to
ovsdb-server, since we don't really need that yet.
Ben Pfaff [Tue, 9 Feb 2010 19:17:16 +0000 (11:17 -0800)]
xenserver: Fix failure to bring up secondary management interfaces.
When a secondary management interface is configured on a XenServer,
interface-reconfigure would fail to bring it up because it would attempt
to add a bridge that already exists. This commit makes it tolerate that
situation.
Ben Pfaff [Tue, 9 Feb 2010 00:37:49 +0000 (16:37 -0800)]
ovsdb: Make scalars and 1-element sets interchangeable.
It is natural to write "abc" in place of ["set",["abc"]] and vice versa.
I cannot think of a reason not to support this, and it can make reading
and writing OVSDB files and transactions easier, so support it.
There is no value in saving a call to uuid_hash() in ovsdb_table_put_row(),
because uuid_hash() is a trivial inline function, so integrate
ovsdb_table_get_row__() into ovsdb_table_get_row() and simplify
ovsdb_table_put_row().
Ben Pfaff [Thu, 4 Feb 2010 19:47:32 +0000 (11:47 -0800)]
ovsdb: Use direct pointer from table to txn_table to simplify code.
Until now, when a transaction modified rows in a table, the metadata
associated with that table modification (in struct ovsdb_txn_table) had to
be looked up through a hash table. This made the code unnecessarily
complicated and had no benefit in itself, so this commit changes
struct ovsdb_table to have a direct pointer to its ovsdb_txn_table.
Ben Pfaff [Thu, 4 Feb 2010 22:34:01 +0000 (14:34 -0800)]
ovsdb: Fix result object for "declare" operation.
The "declare" operation is specified to return a <uuid>, e.g.:
["uuid", "7b703002-f7b6-45c6-bfd6-7619b21a1a5f"]
It was actually just returning the second part, e.g.
"7b703002-f7b6-45c6-bfd6-7619b21a1a5f"
This commit makes the result match the specification.