sliver-openvswitch.git
14 years agoIncrease version number to v0.90.1. v0.90.1
Justin Pettit [Mon, 15 Jun 2009 23:19:08 +0000 (16:19 -0700)]
Increase version number to v0.90.1.

14 years agoUpdate license on file not in citrix branch to Apache 2.0.
Ben Pfaff [Mon, 15 Jun 2009 23:08:34 +0000 (16:08 -0700)]
Update license on file not in citrix branch to Apache 2.0.

On the citrix branch we changed the license to Apache 2.0.  Merging the
citrix branch into master hence updated the license of all the files that
existed in the citrix branch.  However one file was added in master that
wasn't in citrix, so this commit updates the license on that new file.

14 years agoMerge changes from citrix branch into master.
Ben Pfaff [Mon, 15 Jun 2009 23:04:54 +0000 (16:04 -0700)]
Merge changes from citrix branch into master.

14 years agoReplace SHA-1 library with one that is clearly licensed.
Ben Pfaff [Mon, 15 Jun 2009 23:03:28 +0000 (16:03 -0700)]
Replace SHA-1 library with one that is clearly licensed.

The SHA-1 library that we used until now was taken from RFC 3174.  That
library has no clearly free license statement, only a license on the text
of the RFC.  This commit replaces this library with a modified version of
the code from the Apache Portable Runtime library from apr.apache.org,
which is licensed under the Apache 2.0 license, the same as the rest of
Open vSwitch.

14 years agoUpdate primary code license to Apache 2.0.
Ben Pfaff [Mon, 15 Jun 2009 22:11:30 +0000 (15:11 -0700)]
Update primary code license to Apache 2.0.

14 years agoxenserver: Fix stupid typo in previous commit (s/modudules/modules/).
Ben Pfaff [Mon, 15 Jun 2009 20:40:41 +0000 (13:40 -0700)]
xenserver: Fix stupid typo in previous commit (s/modudules/modules/).

14 years agoxenserver: Don't include veth_mod.ko in RPMs.
Ben Pfaff [Mon, 15 Jun 2009 20:17:49 +0000 (13:17 -0700)]
xenserver: Don't include veth_mod.ko in RPMs.

veth_mod.ko is built only for Linux 2.6.18 (since later versions already
have it).  Our XenServer build doesn't use it at all, so don't package it.

(This is in response to a build failure against a XenServer 5.7.0
prerelease, which uses a 2.6.27 kernel and thus for which veth_mod.ko is
not built.)

14 years agovswitch: Avoid segfault when revalidating ARP flows.
Ben Pfaff [Mon, 15 Jun 2009 19:14:47 +0000 (12:14 -0700)]
vswitch: Avoid segfault when revalidating ARP flows.

The 'packet' argument to process_flow() is allowed to be null, but some of
the code was assuming that it was always non-null, which caused a segfault
while revalidating ARP flows.

Bug #1394.

14 years agovconn: Add unit test for tcp and unix vconns.
Ben Pfaff [Sat, 13 Jun 2009 00:10:09 +0000 (17:10 -0700)]
vconn: Add unit test for tcp and unix vconns.

14 years agovconn: Factor out common code from TCP and SSL vconns.
Ben Pfaff [Sat, 13 Jun 2009 00:05:51 +0000 (17:05 -0700)]
vconn: Factor out common code from TCP and SSL vconns.

The TCP and SSL vconn implementations had a lot of common code to make
and accept TCP connections, which this commit factors out into common
functions in socket-util.c.

Also adds the ability to bind ptcp and pssl vconns to a particular IP
address instead of the wildcard address.

14 years agovconn: Drop obsolete code for Netlink-based vconns.
Ben Pfaff [Fri, 12 Jun 2009 22:18:52 +0000 (15:18 -0700)]
vconn: Drop obsolete code for Netlink-based vconns.

Older versions of Open vSwitch implemented OpenFlow in the kernel over
a Netlink channel, and this code was here to work around some issues with
that, but now it is unnecessary since the OpenFlow kernel implementation is
gone.

14 years agovconn: Report valid errno value if connection closed waiting for hello.
Ben Pfaff [Fri, 12 Jun 2009 22:14:42 +0000 (15:14 -0700)]
vconn: Report valid errno value if connection closed waiting for hello.

vconn_connect() is defined to return 0 on success or a positive errno
value on failure, but it was possible to get a negative value (EOF).  This
commit changes this to ECONNRESET to match caller expectations.

14 years agodatapath: Add sysfs support for all (otherwise supported) Linux versions.
Ben Pfaff [Fri, 12 Jun 2009 23:45:01 +0000 (16:45 -0700)]
datapath: Add sysfs support for all (otherwise supported) Linux versions.

This turned out to be less trouble than I expected.

This builds successfully against 2.6.18 through 2.6.28.  Justin has lightly
tested it on a 2.6.27 kernel provided by Citrix.

14 years agoxenserver: xen 2.6.27 kernel doesn't need skb_checksum_setup defined
Justin Pettit [Fri, 12 Jun 2009 22:39:59 +0000 (15:39 -0700)]
xenserver: xen 2.6.27 kernel doesn't need skb_checksum_setup defined

The latest XenServer release is based on 2.6.27.  The datapath code
defined "skb_checksum_setup", since it wasn't exported in their 2.6.18
kernels.  This change causes it only to be built if the kernel is
version 2.6.18.

14 years agoxenserver: Fix key used to identify network UUID
Justin Pettit [Fri, 12 Jun 2009 01:30:41 +0000 (18:30 -0700)]
xenserver: Fix key used to identify network UUID

The "dump-vif-details" script adds the network UUID to the
ovs-vswitchd.conf file.  Unfortunately, it wrote the key as
"network-uuid", but the code that retrieves it for the management
protocol checked our "net-uuid".  The script now uses the key
"net-uuid".

Thanks to Natasha for catching the problem.

14 years agoDon't accept unix: connections, etc. in OpenFlow controller discovery.
Ben Pfaff [Thu, 11 Jun 2009 20:02:33 +0000 (13:02 -0700)]
Don't accept unix: connections, etc. in OpenFlow controller discovery.

The controller discovery code has always had the capability to whitelist
only certain types of controller locations.  Until now, we have only taken
advantage of this when SSL is enabled (so that all OpenFlow connections are
authenticated with SSL if SSL is configured).

However, it occurs to me that making the section of connections entirely
unrestricted is too permissive.  An attacker could make the vswitch connect
to an arbitrary Unix domain socket, for example.  I don't have a
description of how this is an exploitable security vulnerability, but it
seems entirely too lax.

So: this commit changes the default to allowing only TCP connections to
controller in the non-SSL case.

14 years agoxenserver: Pass network UUID to controller for internal networks too.
Ben Pfaff [Thu, 11 Jun 2009 18:33:39 +0000 (11:33 -0700)]
xenserver: Pass network UUID to controller for internal networks too.

vNetManager needs to know the xapi UUIDs for the networks that correspond
to OpenFlow connections.  For some time now we have passed these to it
over the management connection using bridge.<bridgename>.xs-network-uuids
configuration keys, but only now did we notice that this didn't get set for
internal networks.

The reason that it didn't get set is that interface-reconfigure is the
script that sets up these configuration keys, but interface-reconfigure
is never called for internal networks.  Instead, xapi creates them itself
using directly calls to bridge ioctls.  So no amount of tweaks to
interface-reconfigure will help.

This commit fixes the problem by modifying the vif script instead.  This
works acceptably only because xapi is lazy about creating bridges for
internal networks: it creates them only just before it is about to add the
first vif to them.  Thus, by setting up the configuration key in the vif
script, it gets added just after the bridge itself is created.  There is
a race, of course, meaning that there may be a delay between the initial
OpenFlow connection and the time when the configuration key is set up,
but vNetManager can tolerate that.

14 years agovswitch: Add support for large OFMP messages
Justin Pettit [Thu, 11 Jun 2009 08:58:52 +0000 (01:58 -0700)]
vswitch: Add support for large OFMP messages

OpenFlow uses a 16-bit field to describe the message length, which
limits messages to a maximum 65535 bytes.  Some of the messages passed
by the management protocol may be larger than this, so a general
Extended Data message has been added to management protocol.  It
encapsulates a single giant OpenFlow-like message, and breaks it into
however many vaild smaller ones are required.

14 years agoxenserver: Remove debugging redirect from vif script
Justin Pettit [Wed, 10 Jun 2009 22:30:55 +0000 (15:30 -0700)]
xenserver: Remove debugging redirect from vif script

I redirected some output to a temporary file during debugging, but
forgot to remove it.  Now it's removed.

Thanks to Ben for pointing it out.

14 years agovswitch: Fix memory leak when OFMP resource updates are sent
Justin Pettit [Wed, 10 Jun 2009 20:00:10 +0000 (13:00 -0700)]
vswitch: Fix memory leak when OFMP resource updates are sent

When a resource update message is generated by vSwitch, it creates a
couple of svec objects that need to be explicitly destroyed.  This
wasn't happening, so memory would leak after each resource update.  This
commit properly destroys them after use.

14 years agoAdd unit test for SHA-1 library.
Ben Pfaff [Wed, 10 Jun 2009 23:45:28 +0000 (16:45 -0700)]
Add unit test for SHA-1 library.

14 years agoAdd file missing from commit baf099 "Fix glibc 2.7 strtok_r() bug...".
Ben Pfaff [Wed, 10 Jun 2009 23:45:02 +0000 (16:45 -0700)]
Add file missing from commit baf099 "Fix glibc 2.7 strtok_r() bug...".

Oops.

14 years agovswitch: Fix handling of multicast packets received by bonds.
Ben Pfaff [Wed, 10 Jun 2009 22:24:03 +0000 (15:24 -0700)]
vswitch: Fix handling of multicast packets received by bonds.

As long as bonding has been implemented, the vswitch has refused to learn
from multicast packets that arrive on a bond slave if it has already
learned any other port for that source MAC, because it is likely that we
sent the packet out ourselves and are only now receiving a copy of it on
our active slave.

This is entirely correct, but it does not go far enough.  In fact, the
bridge needs to entirely drop such packets.  Otherwise, a host whose MAC
is assigned to a slave other than the active slave will receive a second
copy of multicast packets that it sends out the bond, and other ports
will receive two copies of every multicast packet sent by such a host.

This commit implements this new policy, which simplifies the code at the
same time.

Bug #1387.

14 years agovswitch: Add ovs-appctl commands for debugging and managing bonds.
Ben Pfaff [Wed, 10 Jun 2009 22:13:21 +0000 (15:13 -0700)]
vswitch: Add ovs-appctl commands for debugging and managing bonds.

14 years agoFix glibc 2.7 strtok_r() bug in a more permanent fashion.
Ben Pfaff [Wed, 10 Jun 2009 21:16:40 +0000 (14:16 -0700)]
Fix glibc 2.7 strtok_r() bug in a more permanent fashion.

The glibc 2.7 headers contain a bug that causes strtok_r() to segfault
in some circumstances.  Until now, we have been working around this
problem at each invocation, but this depends on the programmer to remember
to do so each time.

This commit instead adds a shim that adds a work-around to the string.h
header itself, so that it is much more difficult to miss the workaround.

14 years agovswitch: Clarify what "ingress" means in policing
Justin Pettit [Wed, 10 Jun 2009 06:32:30 +0000 (23:32 -0700)]
vswitch: Clarify what "ingress" means in policing

The man page for ovs-vswitchd.conf explains how ingress policing works.
However, what "ingress" means is a bit confusing depending on the
perspective.  For vSwitch, it's from the switch's perspective.  This
means on a PIF, it's the rate traffic comes into the box.  On a VIF,
it's the rate traffic can be *transmitted* from a VM.  This commit
clarifies the man page a bit.

Thanks to Johan for pointing out the problem.

14 years agoxenserver: Add dump-vif-details to automake
Justin Pettit [Wed, 10 Jun 2009 01:40:15 +0000 (18:40 -0700)]
xenserver: Add dump-vif-details to automake

14 years agoxenserver: Send VIF details to controller
Justin Pettit [Wed, 10 Jun 2009 01:19:02 +0000 (18:19 -0700)]
xenserver: Send VIF details to controller

The controller needs to know various things about virtual interfaces as
they move about the network.  This commit sends the VIF, virtual
machine, and network UUIDs associated with the VIF, as well as its MAC
address over the management channel.

Feature #1324

14 years agoXen: Fixes for core handling configuration
Justin Pettit [Tue, 9 Jun 2009 22:46:50 +0000 (15:46 -0700)]
Xen: Fixes for core handling configuration

An improper string comparison operator was used to check whether
FORCE_COREFILES was enabled.  Further, the check to enable core files
was only down when vswitch was started, and not when restarted.

Thanks to Ben for help debugging the issue.

14 years agoFix url in RPM spec.
Justin Pettit [Tue, 9 Jun 2009 00:29:37 +0000 (17:29 -0700)]
Fix url in RPM spec.

14 years agoAdd unit test for TCP/IP checksumming code.
Ben Pfaff [Wed, 10 Jun 2009 00:10:18 +0000 (17:10 -0700)]
Add unit test for TCP/IP checksumming code.

14 years agoFix another "make" versus "make dist" build problem.
Ben Pfaff [Tue, 9 Jun 2009 22:19:24 +0000 (15:19 -0700)]
Fix another "make" versus "make dist" build problem.

14 years agoRemove "dpkg-buildpackage" test from "make distcheck".
Ben Pfaff [Tue, 9 Jun 2009 21:22:52 +0000 (14:22 -0700)]
Remove "dpkg-buildpackage" test from "make distcheck".

Now the Debian packaging is regularly tested via the autobuilder, so there
is less need to do it from "make distcheck", and not doing it saves time
there.

14 years agoFix behavior of simultaneous "make" and "make dist".
Ben Pfaff [Tue, 9 Jun 2009 21:19:53 +0000 (14:19 -0700)]
Fix behavior of simultaneous "make" and "make dist".

We were distributing lib/dirs.c, which doesn't make sense, but in any case
it created a race between "make" and "make dist" in updating lib/dirs.c,
which showed up in the Debian package build (which runs build-indep and
build-arch in parallel).

Also, clean lib/dhparams.c.

This should fix the failure seen in build openvswitch843.

14 years agoxenserver: Use parallel make in RPM build on SMP machines.
Ben Pfaff [Tue, 9 Jun 2009 20:49:49 +0000 (13:49 -0700)]
xenserver: Use parallel make in RPM build on SMP machines.

14 years agodebian: Honor "noopt", "parallel=<n>" build options.
Ben Pfaff [Tue, 9 Jun 2009 20:33:24 +0000 (13:33 -0700)]
debian: Honor "noopt", "parallel=<n>" build options.

14 years agodebian: Run build tests during build (unless "nocheck" is specified).
Ben Pfaff [Tue, 9 Jun 2009 20:32:59 +0000 (13:32 -0700)]
debian: Run build tests during build (unless "nocheck" is specified).

14 years agodebian: Ignore directories created as part of Debian package build.
Ben Pfaff [Tue, 9 Jun 2009 20:32:20 +0000 (13:32 -0700)]
debian: Ignore directories created as part of Debian package build.

14 years agoUpdate documentation.
Ben Pfaff [Tue, 9 Jun 2009 20:09:08 +0000 (13:09 -0700)]
Update documentation.

14 years agoovs-pki: Improve readability of manpage.
Ben Pfaff [Tue, 9 Jun 2009 00:12:27 +0000 (17:12 -0700)]
ovs-pki: Improve readability of manpage.

14 years agoovs-pki: Fix formatting errors in manpage.
Ben Pfaff [Tue, 9 Jun 2009 00:11:46 +0000 (17:11 -0700)]
ovs-pki: Fix formatting errors in manpage.

14 years agovswitch: Send gratuitous learning packets when bond slaves go down.
Ben Pfaff [Mon, 8 Jun 2009 19:26:27 +0000 (12:26 -0700)]
vswitch: Send gratuitous learning packets when bond slaves go down.

When a bond slave goes down, all of the MACs that were on it are migrated
to another slave, but this is not apparent to the switch that the bond is
connected to until each MAC sends out a packet.  This causes incoming
traffic for a given MAC to be dropped until the MAC sends out a packet.
This is not usually a problem, because traffic is not ordinarily one-way,
and we can't avoid losing some packets in some cases, but we can do a
little better by sending out a gratuitous learning packet on the new slave
as soon as we know about it, and that is what this commit implements.

Bug #1290.

14 years agomac-learning: Make data structures public.
Ben Pfaff [Mon, 8 Jun 2009 19:20:38 +0000 (12:20 -0700)]
mac-learning: Make data structures public.

The vswitchd bonding code needs to iterate through the table entries to
be able to send out gratuitous learning packets when bond slaves go down.
It might be best to create an abstract interface to the MAC learning table,
but this commit does the simpler thing and exposes the data structures in
the header file.

14 years agovswitch: Fix typos in OFMP comments.
Justin Pettit [Fri, 5 Jun 2009 21:52:55 +0000 (14:52 -0700)]
vswitch: Fix typos in OFMP comments.

A couple of comments describing the new UUID TLVs were incorrect and
this fixes them.

14 years agovswitch: Fix OFMP alignment problem on 64-bit systems.
Justin Pettit [Fri, 5 Jun 2009 21:50:08 +0000 (14:50 -0700)]
vswitch: Fix OFMP alignment problem on 64-bit systems.

One of the OpenFlow managment protocol's UUID TLV messages had a problem
building on 64-bit systems.  By extending the structure length by 4
bytes, the problem goes away.

14 years agovswitch: Enable bond slaves based on carrier status, not up/down.
Ben Pfaff [Fri, 5 Jun 2009 21:28:39 +0000 (14:28 -0700)]
vswitch: Enable bond slaves based on carrier status, not up/down.

Whether a bond slave is enabled should be based on whether the device's
PHY sees carrier, not based on whether the device is configured up or down.
(Note that a device that is configured down will always see "no carrier").
Otherwise a device that is up but has no carrier will initially be enabled,
which does not make sense.

This has no effect on interfaces that are not bond slaves, because the
"enabled" setting is used only by bond slaves.

Bug #1247.

14 years agonetdev: New function netdev_nodev_get_carrier().
Ben Pfaff [Fri, 5 Jun 2009 21:26:42 +0000 (14:26 -0700)]
netdev: New function netdev_nodev_get_carrier().

14 years agoxenserver: Bring up bond slave device before adding to bond.
Ben Pfaff [Fri, 5 Jun 2009 21:08:36 +0000 (14:08 -0700)]
xenserver: Bring up bond slave device before adding to bond.

Until now, we've added network devices to the ovs-vswitchd configuration
file before bringing them up.  This works suboptimally for bond slaves,
because vswitchd takes the initial carrier state of the bond slaves as
whether to initially enable or disable them, and a device that is down
always reports "no carrier".  So this commit changes interface-reconfigure
to bring up bond slaves before adding them to the configuration file,
which gives them a chance to detect carrier before vswitchd checks for it.

This might still be an imperfect situation, because it takes quite a while
(maybe 1 second?) for some network devices to detect carrier after being
brought up.  But the kernel implementation of bonding seems to do the very
same thing, so we should be at least no worse than it.

Incidentally, this is only important for bonds that have long updelays.
XenServer uses an updelay of 31 seconds (!), so it is especially important
there.

Bug #1247.

14 years agoxenserver: Allow RPM to install only with correct Xen kernel version.
Ben Pfaff [Fri, 5 Jun 2009 19:24:58 +0000 (12:24 -0700)]
xenserver: Allow RPM to install only with correct Xen kernel version.

Bug #638.

14 years agovswitch: Send Xen UUIDs associated with system and networks
Justin Pettit [Fri, 5 Jun 2009 19:13:37 +0000 (12:13 -0700)]
vswitch: Send Xen UUIDs associated with system and networks

This commit sends information about Xen UUIDs to the controller through
the management connection.  Specifically, it sends the XenServer UUID
and a list of network UUIDs associated with each datapath.

14 years agoxenserver: Rename cache file to ovs-vswitch.dbache, for consistency.
Ben Pfaff [Fri, 5 Jun 2009 18:18:33 +0000 (11:18 -0700)]
xenserver: Rename cache file to ovs-vswitch.dbache, for consistency.

Fixes bug #1374.

14 years agoImport from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45. v0.90.0
Ben Pfaff [Wed, 8 Jul 2009 20:19:16 +0000 (13:19 -0700)]
Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.