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.
Jesse Gross [Mon, 1 Feb 2010 23:20:22 +0000 (18:20 -0500)]
vswitch: Consistently set Nicira OUI.
In places where a random Ethernet address needs to be generated we
are inconsistent about setting an OUI. This sets an OUI everywhere
to allow the source of packets to be easily identified.
Jesse Gross [Mon, 8 Feb 2010 19:52:20 +0000 (14:52 -0500)]
gre: Fix use after free in netns compatibility layer.
The newly updated network namespace compatibility layer contained
an issue in the pernet automatic storage allocation feature that
prematurely freed memory. This caused an OOPS if the module was
unloaded.
Jesse Gross [Tue, 2 Feb 2010 21:44:44 +0000 (16:44 -0500)]
gre: Unify IPTUNNEL_XMIT across kernel versions.
The IPTUNNEL_XMIT macro was split into different versions based on
the kernel. This adds the compatibility code to allow a single
copy to work on all kernel versions, making it easier to maintain.
Ben Pfaff [Tue, 2 Feb 2010 22:25:11 +0000 (14:25 -0800)]
ovs-vsctl: Use vsctl_fatal() consistently.
vsctl_fatal() logs its argument as well as printing it on stderr, so it
is preferable within ovs-vsctl. An upcoming commit will also make
vsctl_fatal() free memory, so using it consistently will also make that
memory freed consistently.
Ben Pfaff [Tue, 2 Feb 2010 22:16:06 +0000 (14:16 -0800)]
tests: Always make ovsdb-server exit cleanly, to better find memory leaks.
"ovs-appctl exit" causes a cleaner shutdown than "kill" and in particular
lets ovsdb-server clean up better, which makes it easier to find real
memory leaks.
Ben Pfaff [Tue, 2 Feb 2010 22:31:36 +0000 (14:31 -0800)]
tests: Fix timing dependency in ovsdb-log test.
The "lockfile" module logs a message if locking takes a measurable amount
of time. Running the tests under valgrind tends to make this message
appear, so we need to disable it to make the output comparison come out
cleanly.
Jesse Gross [Mon, 1 Feb 2010 21:43:44 +0000 (16:43 -0500)]
datapath: Set datapath device MTU to minimum of MTU of ports.
The MTU of the local port should be no larger than the minimum of
the MTUs of the ports attached to the bridge, overwise packets may be
dropped. We already prevent changes to the MTU that would violate
this constraint but don't actuallly proactively set the MTU. This
changes makes everything consistent and matches the behavior of
the bridge.
Jesse Gross [Fri, 29 Jan 2010 20:54:47 +0000 (15:54 -0500)]
xenserver: Add XenServer 5.5.0 updates 1 and 2 to supported versions.
Add the file hashes for updates 1 and 2 (the scripts we care about
are the same) to the list of supported versions to prevent a warning
message on install.
Ben Pfaff [Tue, 26 Jan 2010 19:35:38 +0000 (11:35 -0800)]
ofproto: Remove support for OpenFlow-based management protocol.
Older versions of Open vSwitch supported a management protocol based on
OpenFlow message framing. The current Open vSwitch instead uses the
OVSDB protocol for the same purposes. We don't plan to support this older
protocol any longer, so this commit deletes support.
This commit also deletes the management_id column from the vswitch's
database schema. The management_id was used by the older management
protocol to match up OpenFlow switch connections to management connections,
but the current implementation instead matches up connections based on
the datapath IDs exported by the configuration database. In fact, the
OpenFlow connections had no way to actually export the management ID, so
this just deletes code that was essentially without function anyhow.
Ben Pfaff [Fri, 29 Jan 2010 00:09:26 +0000 (16:09 -0800)]
ovs-vsctl: Refactor in preparation for adding "postprocess" step.
Until now, all the ovs-vsctl commands have had no need to look at the
results of the database transaction. However, to print the UUID of newly
inserted database records, they do need to do this.
This commit refactors ovs-vsctl in preparation for adding this ability.
Ben Pfaff [Thu, 28 Jan 2010 22:12:56 +0000 (14:12 -0800)]
hmap: Rename hmap_moved() to hmap_node_moved().
This prepares for adding a new function that deals with a "struct hmap"
moving, as opposed to a "struct hmap_node".
Since there was only a single call to this in the whole tree, and its
caller didn't have any callers of its own at all, also move this function
from hmap.h to hmap.c.
Ben Pfaff [Thu, 28 Jan 2010 21:23:30 +0000 (13:23 -0800)]
ovsdb-idl: Add interface to find out the permanent IDL of an inserted row.
The ovs-vsctl "create" command, and perhaps other commands, should print
the UUID of the newly created database row, but until now the IDL has not
provided a way to find that out. This commit adds the ability.
Jesse Gross [Fri, 22 Jan 2010 19:37:05 +0000 (14:37 -0500)]
openflowd: Update for changes to dpif and netdev.
Openflowd had been a bit neglected as changes were made to the dpif
and netdev interfaces over time. This brings it up to date with all
the latest changes.
Jesse Gross [Fri, 22 Jan 2010 19:37:10 +0000 (14:37 -0500)]
dpif: Update dpif interface to match netdev.
This brings over some features that were added to the netdev interface,
most notably the separation between the name and the type. In addition
to being cleaner, this also avoids problems where it is expected that
the local port has the same name as the datapath.
Ben Pfaff [Wed, 27 Jan 2010 19:25:20 +0000 (11:25 -0800)]
ovs-vsctl: Make parsing functions return error instead of aborting.
The upcoming "remove" command for ovs-vsctl wants to try parsing an
argument two different ways. This doesn't work if a parse error always
aborts immediately. This commit fixes the problem, by making a parsing
failure pass up an error for higher layers to deal with instead of aborting
immediately.
Ben Pfaff [Wed, 27 Jan 2010 19:21:43 +0000 (11:21 -0800)]
ovs-vsctl: Score perfect matches higher than ones that differ in case.
Before, both "xY_z" and "xy-z" were considered equally good matches for
"xy-z", but obviously the latter is a much better match. This commit fixes
the problem (which was found by inspection).
Jesse Gross [Mon, 25 Jan 2010 00:58:40 +0000 (19:58 -0500)]
datapath: Fix compilation on newer old-style Xen kernels.
Some ports of Xen (such as Debian Lenny's) use the old style
Xen checksumming fields on newer kernels. Normally the code that
deals with those fields isn't used at all on newer kernels. This
updates the checksumming pointer code with some changes from Lenny
Xen since it is cleaner and works well with our existing compatibility
layer.
Jesse Gross [Mon, 25 Jan 2010 00:58:46 +0000 (19:58 -0500)]
datapath: Support CHECKSUM_PARTIAL on older kernels.
On older kernels we would not correctly update partial checksums
because it was difficult to determine the type of checksum. This
uses some hints to infer the correct type of checksum so that it
can be updated. It also allows us to correctly define
CHECKSUM_PARTIAL, which is important for other components.
Jesse Gross [Mon, 25 Jan 2010 00:57:54 +0000 (19:57 -0500)]
datapath: Transport port is not part of psuedoheader.
While updating the checksum after changing the transport port,
we indicated that this was a change to the psuedoheader. Since
this is not the case, it could produce an incorrect checksum.
Jesse Gross [Fri, 22 Jan 2010 22:26:31 +0000 (17:26 -0500)]
datapath: Handle packets with precomputed checksums.
On older kernels (< 2.6.19) CHECKSUM_HW can mean either that the
checksum has already been computed by hardware or that the checksum
needs to be computed by hardware, depending on whether we are on
the transmit or receive path. Unfortunately since we are in the
middle of these two paths it is impossible to tell which is the
case. Code after us assumes that CHECKSUM_HW means that the
checksum needs to be computed and will panic if there already is
a checksum. On these kernels we mark these packets as CHECKSUM_NONE
before handing them off.
Without this change using certain NICs will cause panics.
Ben Pfaff [Mon, 25 Jan 2010 18:32:39 +0000 (10:32 -0800)]
configure: Silence check for broken strtok_r().
The check for strtok_r() prints a line of text on stdout as part of its
run. This is noticeable when running "configure", especially with -q.
This commit fixes it.
(The apparent alternative of not printing anything at all seems like a bad
idea because this might encourage the compiler to completely optimize
everything out of main().)
Ben Pfaff [Tue, 19 Jan 2010 23:00:56 +0000 (15:00 -0800)]
daemon: Make --monitor process change its process title.
When --monitor is used, administrators sometimes become confused about the
presence of two copies of each process. This commit attempts to clarify
the situation by making the monitoring process change its process name, as
seen in /proc/$pid/cmdline and in "ps", to clearly indicate what is going
on.
Ben Pfaff [Tue, 26 Jan 2010 18:46:56 +0000 (10:46 -0800)]
tests: Fix ovsdb tests.
This code was updated to use the new name of the schema, but I accidentally
left in the old code to check for the old schema's name. This worked fine
in my own tests, because I still have a copy of that file sitting around,
but fails on "make distcheck" or a clean source dir.
So this commit deletes the code that checks for the old schema file.
Ben Pfaff [Tue, 26 Jan 2010 18:35:11 +0000 (10:35 -0800)]
xenserver: Update to use upstream XenServer location for dbcache.
I thought that this was going to be more difficult (see this email thread:
http://openvswitch.org/pipermail/dev_openvswitch.org/2010-January/001023.html
) but it turned out to be trivial.
Ben Pfaff [Tue, 26 Jan 2010 18:32:33 +0000 (10:32 -0800)]
ovsdb: Require column type "min" value be 0 or 1.
A "min" value greater than 1 is problematic for the database. There is no
reasonable way to synthesize a default value for such a column: keys in a
set or map must unique, so the database cannot, say, simply set a set of
3 or more integers to [0, 0, 0].
This should have no effect on the vswitch in practice because it does not
have any columns that require more than one element.
Ben Pfaff [Mon, 25 Jan 2010 18:13:52 +0000 (10:13 -0800)]
ovs-vsctl: Add commands for low-level database manipulation.
The new "get", "list", "set", and "add" commands provide lower-level
access to the vswitch database than the other ovs-vsctl commands, but they
are more convenient than using ovsdb-client directly.
This commit deserves several enhancements, but users are clamoring for
some kind of interface, so this is a starting point.