Ben Pfaff [Tue, 15 Dec 2009 06:59:55 +0000 (22:59 -0800)]
netdev-linux: Fix aliasing error.
The latest version of GCC flags a common socket convention as breaking
strict-aliasing rules. This commit removes the aliasing and gets rid of
the scary warning.
Justin Pettit [Tue, 15 Dec 2009 01:44:17 +0000 (17:44 -0800)]
xenserver: Actually destroy VIFs by using ovs-vsctl
When VIFs were destroyed, they were not actually being deleted in the
config database. This commit makes the appropriate ovs-vsctl commands
in the 'vif' script to accomplish that.
Justin Pettit [Mon, 14 Dec 2009 21:59:58 +0000 (13:59 -0800)]
ovs-vsctl: Set timeout to a default value of five seconds
In general, we don't want ovs-vsctl to wait forever to connect to the
database, as ovs-vsctl is used extensively in init scripts and the
system will not boot. Use a default value of five seconds as a
stop-gap. Eventually, we'll switch to a model of connection attempts,
since using time-based approach is kind of a hack.
Justin Pettit [Mon, 14 Dec 2009 21:43:25 +0000 (13:43 -0800)]
xenserver: Cleanup xs-network-uuids and xs-network-names usage
Switch xs-network-uuids delimiter to a semicolon to match the one used
by xs-network-uuids. Also, fix pluralization of xs-network-uuids in
vswitch IDL description of the "Bridge" table.
Add description of xs-network-names to vswitch IDL description.
Ben Pfaff [Mon, 14 Dec 2009 21:09:47 +0000 (13:09 -0800)]
vswitchd: Do not choose generated MAC address for local port.
ovs-vswitchd needs to choose a sensible MAC address for the local port of
a bridge. Until now, the algorithm has ignored certain interfaces, in
particular internal interfaces and those with the MAC addresses that
indicate that they are probably Xen VIFs. The goal is to choose a physical
interface's MAC address because this is more stable and more likely to
be meaningful to the outside world. Stability, in turn, is important
because the MAC address of the local port is used as the default datapath
ID for OpenFlow connections.
This existing algorithm was too specialized to work well with the new
kinds of ports that we have been introducing in OVS. In particular,
GRE ports could be chosen as the MAC address. This commit changes the
algorithm for choosing the local port MAC address. Now it ignores any
interface that has the "local" bit set in its MAC address, which
catches GRE ports. The new rule also catches the VIF and internal
port cases, so this commit also deletes those special cases.
This commit deleted the only user of eth_addr_is_vif(), so it deletes
that function also.
Ben Pfaff [Sat, 12 Dec 2009 00:59:44 +0000 (16:59 -0800)]
socket-util: Clarify EAGAIN error code for make_unix_socket().
make_unix_socket() can return EAGAIN in rare circumstances, e.g. when the
server's socket listen queue is full. A lot of OVS callers interpret
EAGAIN as a "try again" error code, but in this case it means that the
attempt to create the socket failed. So munge EAGAIN into another error
code to prevent that misinterpretation.
Ben Pfaff [Fri, 11 Dec 2009 18:46:59 +0000 (10:46 -0800)]
ovsdb-idl: Fix row insertion and deletion behavior.
When the IDL was used to insert a row, but all of the new row's columns
were left at the default values, then the IDL would not insert the row at
all.
When the IDL was used to delete one or more rows, and the transaction did
not include any update or insertion operations, the transaction was dropped
entirely.
This commit fixes these two bugs. It needs a regression test, but this
commit does not add one.
Justin Pettit [Thu, 10 Dec 2009 23:21:56 +0000 (15:21 -0800)]
xenserver: Remove references to "reload" in init script
With ovs-vswitchd using the config DB, it is no longer necessary to tell
it to reload its configuration file. This removes references to the
need for reloading.
It also cleans up some messages placed on the console during boot up.
Ben Pfaff [Fri, 11 Dec 2009 00:43:10 +0000 (16:43 -0800)]
xensource: Add kluge to make interface-reconfigure work better.
This change makes xsconsole able to reconfigure the management interface
on some XenServer hosts. It's not clear why it is needed--apparently
xapi is creating the bridge behind our back.
Ben Pfaff [Thu, 10 Dec 2009 23:53:03 +0000 (15:53 -0800)]
xenserver: Make basic VM networking work.
Tested by starting and stopping a VM that has a single VIF and verifying
that the VM could get an IP address via DHCP and access the network and
that the VIF's external-ids were set to plausible values.
Justin Pettit [Thu, 10 Dec 2009 08:08:39 +0000 (00:08 -0800)]
ovs-brcompatd: First cut at integration with new config db
This is an extremely lightly tested attempt at switching ovs-brcompatd
from using the config file to the new config db. There are a lot of
shortcomings in this cut, but we need to make progress on the XenServer
integration, so it's going in now. Expect changes in the near future.
Ben Pfaff [Tue, 8 Dec 2009 17:48:37 +0000 (09:48 -0800)]
ovsdb-idl: Update IDL data when "set" functions are called.
Until now, the "set" functions generated by the IDL updated the data in the
database (during commit) but not the data exposed by the IDL in its data
structures. This was just an oversight, so this commit causes the data
exposed by IDL to be updated also.
Ben Pfaff [Tue, 8 Dec 2009 01:09:52 +0000 (17:09 -0800)]
bitmap: New function bitmap_scan() and macro BITMAP_FOR_EACH_1.
bitmap_scan() can be optimized significantly for the case of a sparse
bitmap but it doesn't seem worth the additional overhead of writing a test
unless and until we show that it's a useful optimization in practice.
Ben Pfaff [Tue, 8 Dec 2009 01:02:00 +0000 (17:02 -0800)]
hmap: Add function to mark an hmap_node as "null" and check for the mark.
This is useful in cases where one might want to know whether an hmap_node
is actually part of an hmap, without using a separate variable to indicate
it.
Ben Pfaff [Mon, 7 Dec 2009 21:02:37 +0000 (13:02 -0800)]
vswitchd: Avoid segfault when local port is required but missing.
Connecting to a controller requires the vswitch to have a local port
(typically named the same as the bridge itself). Before the introduction
of ovsdb ovs-vswitchd simply added the local port itself if it was missing.
This was not properly implemented with the ovsdb transition, and a segfault
resulted. This commit avoids the segfault, although it should possibly
be improved to also add the local port, as before.
Jesse Gross [Sun, 6 Dec 2009 02:49:37 +0000 (18:49 -0800)]
gre: Temporary workarounds for GRE on Xen.
Two issues exist that prevent GRE tunnels from working properly on
Xen: iptables rules and brcompatd. The first issue is that GRE
traffic is not permitted by the default iptables rules. The second
is that brcompatd removes ports from the configuration that it
believes do not exist, which causes GRE ports to be deleted before
they are created.
This commit avoids these issues though not in the most optimal way.
Better fixes will be forthcoming in the near future.
Jesse Gross [Sun, 6 Dec 2009 00:01:06 +0000 (16:01 -0800)]
gre: Add userspace GRE support.
This implements the userspace portion of GRE on Linux. It communicates
with the kernel module to setup tunnels using either Netlink or ioctls
as appropriate based on the kernel version.
Significant portions of this commit were actually written by
Justin Pettit.
Jesse Gross [Sun, 6 Dec 2009 23:10:35 +0000 (15:10 -0800)]
gre: Add kernel GRE support.
This implements the kernel portion of GRE on Linux. It consists
of a backported module that provides the GRE capabilities of 2.6.32
plus bug fixes to kernels 2.6.18+.
Jesse Gross [Thu, 3 Dec 2009 02:56:36 +0000 (18:56 -0800)]
gre: Compatibility with older Linux kernel versions.
The upcoming GRE kernel module compiles on a range (2.6.18+) of
Linux kernel versions. The module expects the kernel headers to
look like newer versions. Where older and newer versions of the
kernel differ this commit implements shims to paper over the changes.
Jesse Gross [Mon, 7 Dec 2009 05:37:57 +0000 (21:37 -0800)]
netflow: Correctly set active timeout value.
This fixes a bug originally introduced in commit 763435 "vswitchd:
Initial conversion to database-based configuration." The bug
reversed a less than operator when setting the active timeout field.
Also add a warning if the timeout is set to an invalid value.
Ben Pfaff [Thu, 3 Dec 2009 18:59:09 +0000 (10:59 -0800)]
vswitchd: Remove vestigial spanning tree protocol (STP) support.
ovs-vswitchd has never supported spanning tree protocol, but there was
nevertheless a considerable amount of code that provided a framework for
supporting it.
This commit deletes this code, since we have no plans to introduce STP
support soon.
Ben Pfaff [Thu, 3 Dec 2009 18:35:45 +0000 (10:35 -0800)]
ovsdb-idl: Fix resolution of references from one table to another.
Our tests only checked references from a table to itself, so of course
there were bugs in references from one table to another. This fixes the
obvious one and adds a test.
Ben Pfaff [Thu, 3 Dec 2009 18:34:26 +0000 (10:34 -0800)]
ovsdb-idlc: C code generation improvements.
This eliminates many casts from the IDL's generated C code and reduces the
number of levels of indirection for simple cases of optional string or
pointer columns.
Justin Pettit [Tue, 1 Dec 2009 09:14:33 +0000 (01:14 -0800)]
netdev: Allow explicit creation of netdev objects
This change adds netdev_create() and netdev_destroy() functions to allow
the creation of network devices through the netdev library. Previously,
network devices had to already exist or be created on demand through
netdev_open(). This caused problems such as not being able to specify
TAP devices as ports in ovs-vswitchd, which this patch fixes.
This also lays the groundwork for adding GRE and VDE support.