Justin Pettit [Sat, 11 Jul 2009 00:36:09 +0000 (17:36 -0700)]
Remove "coverage/clear" command due its limited use
The poll loop calls coverage_clear on every pass anyway, so provide a
function to call it separately is of limited value.
Justin Pettit [Sat, 11 Jul 2009 00:33:41 +0000 (17:33 -0700)]
Fix small typo in ovs-ofctl man page.
Justin Pettit [Fri, 10 Jul 2009 22:09:41 +0000 (15:09 -0700)]
Provide ability to retrieve coverage information
Previously, there was no way to induce coverage information to be
displayed; it would only print when the system noticed unusual delays
between polling intervals. Now, production of coverage logs can be
forced with "coverage/log" command in ovs-appctl. Coverage counters may
be reset with "coverage/clear".
Ben Pfaff [Fri, 10 Jul 2009 20:38:58 +0000 (13:38 -0700)]
Document how to submit patches for Open vSwitch.
Ben Pfaff [Fri, 10 Jul 2009 18:04:05 +0000 (11:04 -0700)]
Document how to report bugs in Open vSwitch.
Ben Pfaff [Fri, 10 Jul 2009 18:03:00 +0000 (11:03 -0700)]
INSTALL.bridge: Add detail suggested by Pete.
Ben Pfaff [Fri, 10 Jul 2009 17:35:36 +0000 (10:35 -0700)]
Document how to use Open vSwitch as a replacement for the Linux bridge.
Ben Pfaff [Wed, 8 Jul 2009 19:32:07 +0000 (12:32 -0700)]
datapath: Fix races in updating dp_dev port statistics.
Ben Pfaff [Wed, 8 Jul 2009 18:31:59 +0000 (11:31 -0700)]
datapath: Fix race in datapath creation.
Before we create the local port, we should allocate and assign the table.
Otherwise packets sent on the local port before we do so will cause an
OOPS.
This is a theoretical race that has not been observed in practice.
Ben Pfaff [Wed, 8 Jul 2009 19:23:32 +0000 (12:23 -0700)]
datapath: Fix race against workqueue in dp_dev and simplify code.
The dp_dev_destroy() function failed to cancel the xmit_queue work, which
allowed it to run after the device had been destroyed, accessing freed
memory. However, simply canceling the work with cancel_work_sync() would
be insufficient, since other packets could get queued while the work
function was running. Stopping the queue with netif_tx_disable() doesn't
help, because the final action in dp_dev_do_xmit() is to re-enable the TX
queue.
This issue led me to re-examine why the dp_dev needs to use a work_struct
at all. This was implemented in commit
71f13ed0b "Send of0 packets from
workqueue, to avoid recursive locking of ofN device" due to a complaint
from lockdep about recursive locking.
However, there's no actual reason that we need any locking around
dp_dev_xmit(). Until now, it has accepted the standard locking provided
by the network stack. But looking at the other software devices (veth,
loopback), those use NETIF_F_LLTX, which disables this locking, and
presumably do so for this very reason. In fact, the lwn article at
http://lwn.net/Articles/121566/ hints that NETIF_F_LLTX, which is otherwise
discouraged in the kernel, is acceptable for "certain types of software
device."
So this commit switches to using NETIF_F_LLTX for dp_dev and gets rid
of the work_struct.
In the process, I noticed that veth and loopback also take advantage of
a network device destruction "hook" using the net_device "destructor"
member. Using this we can automatically get called on network device
destruction at the point where rtnl_unlock() is called. This allows us
to stop stringing the dp_devs that are being destroyed onto a list so
that we can free them, and thus simplifies the code along all the paths
that call dp_dev_destroy().
This commit gets rid of a call to synchronize_rcu() (disguised as a call
to synchronize_net(), which is a macro that expands to synchronize_rcu()),
so it probably speeds up deleting ports, too.
Ben Pfaff [Wed, 8 Jul 2009 17:53:18 +0000 (10:53 -0700)]
datapath: Remove declarations of functions that are never defined or used.
Ben Pfaff [Fri, 26 Jun 2009 21:15:04 +0000 (14:15 -0700)]
datapath: Fix use-after-free error in datapath destruction.
When we create a datapath we do this:
1. Create local port.
2. Call add_dp hook.
3. Allow userspace to add more ports.
When we deleted a datapath we were doing this:
1. Call del_dp hook
2. Delete all the ports.
Unfortunately step 1 destroys dp->ifobj, then dp_del_port on any port other
than the local port in step 2 tries to reference dp->ifobj through a call
to sysfs_remove_link().
This commit fixes the problem by changing datapath deletion to mirror
creation:
1. Delete all the ports but the local port.
2. Call dp_del hook.
3. Delete local port.
Commit
010082639 "datapath: Add sysfs support for all (otherwise supported)
Linux versions" makes this problem obvious on a 2.6.25+ kernel configured
with slab debugging, because on such kernels the ifobj is a pointer to a
slab object that is freed by the del_dp hook function (when brcompat_mod
is loaded). This bug may be just as present on older kernels, but there
the ifobj is part of struct datapath, not a pointer, and thus it is much
harder to trigger.
Bug #1465.
Ben Pfaff [Fri, 26 Jun 2009 19:20:02 +0000 (12:20 -0700)]
datapath: Remove redundant synchronize_rcu() call.
There is no benefit to synchronizing twice, and it might cost us a lot of
time.
Justin Pettit [Wed, 8 Jul 2009 17:40:55 +0000 (10:40 -0700)]
secchan: Various fixes to run in-band on non-"local" port
The in-band control code assumed that we would connect to the controller
over the datapath's "local" port. If the switch had multiple datapaths,
and the controller was only available through one of them, the other
datapaths would fail to connect. This is addressed by the following
changes:
- The controller's MAC address is looked up through the connection's
interface instead of the datapath's local one.
- We allow ARP traffic to be sent by the connection's interface.
- We allow ARP traffic to be sent to the controller's MAC address.
This is necessary if the controller is running locally (e.g. in a VM).
Bug #1466
Justin Pettit [Mon, 6 Jul 2009 22:37:19 +0000 (15:37 -0700)]
Provide method to locate device by IP and add more nodev functions to netdev
In some cases we need to be able to locate a device by its IPv4 address.
There doesn't seem to be an easy way to do this on Linux, so we iterate
through all devices until it's found. The caller can provide a hint as
to the device, so subsequent checks can be quicker.
This checkin also adds nodev versions of functions to lookup ARP entries
and the IPv4 address of a device.
Justin Pettit [Thu, 2 Jul 2009 20:40:20 +0000 (13:40 -0700)]
Show more information about connection when querying status.
It is often useful in debugging to know the ports and IP addresses being
used in an OpenFlow connection. This commit adds the remote and local
IP addresses and ports used for a connection to the "status" information
returned by ovs-ofctl.
Feature #1484.
Justin Pettit [Mon, 6 Jul 2009 22:15:11 +0000 (15:15 -0700)]
Have rconn and vconn export information about IPs and ports
Previously, rconn and vconn only allowed users to find out about the
remote IP address. This set of changes allows users to retrieve the
remote port, local IP, and local port used for the connection.
Justin Pettit [Thu, 2 Jul 2009 19:49:44 +0000 (12:49 -0700)]
Include "inttypes.h" to pickup definition of PRIu8.
Ben Pfaff [Wed, 8 Jul 2009 17:30:42 +0000 (10:30 -0700)]
Rename "secchan" to "ofproto" (library) and "ovs-openflowd" (program).
These names are more meaningful, so we prefer them.
Justin Pettit [Tue, 7 Jul 2009 16:34:37 +0000 (09:34 -0700)]
secchan: Display mgmt and datapath id in status messages
Since it's not always easy to determine the management id, this adds the
ability to see it (and the datapath id) with the "ovs-ofctl status"
command.
Feature #1533
Justin Pettit [Tue, 7 Jul 2009 05:12:53 +0000 (22:12 -0700)]
vswitchd: Add missing argument to check for update-resolv.conf config
Ben Pfaff [Mon, 6 Jul 2009 23:20:46 +0000 (16:20 -0700)]
vswitch: Don't pass null pointer to stat().
If no CA certificate is defined then cacert_file is null. The kernel
kindly tolerates this but we should not do it anyhow.
Found with valgrind.
Ben Pfaff [Mon, 6 Jul 2009 18:06:36 +0000 (11:06 -0700)]
vswitch: Avoid knowledge of details specific to Linux datapaths.
At startup, the vswitch needs to delete datapaths that are not configured
by the administrator. Until now this was done by knowing the possible
names of Linux datapaths. This commit cleans up by allowing each
datapath class to enumerate its existing datapaths and their names.
Ben Pfaff [Mon, 6 Jul 2009 18:02:57 +0000 (11:02 -0700)]
dpif-linux: Don't allow arbitrary internal ports to identify a datapath.
The userspace tools were allowing the name of any internal port to be used
to identify a datapath. This, however, makes it hard to enumerate all the
names by which a datapath can be known, and it was never documented or
intentional behavior, so this commit disables it.
Ben Pfaff [Mon, 6 Jul 2009 17:17:54 +0000 (10:17 -0700)]
vswitch: Remove restriction on datapath names.
Commit
f4b96c92c "vswitch: Disallow bridges named "dpN" or "nl:N"" disabled
naming bridges "dpN" because the vswitchd code made the bad assumption that
the bridge's local port has the same name as the bridge, which was not
true (at the time) for bridges named dpN. Now that assumption has been
eliminated, so this commit eliminates the restriction too.
This change is also a cleanup in that it eliminates one form of the
vswitch's dependence on specifics of the dpif implementation.
Ben Pfaff [Fri, 19 Jun 2009 21:09:39 +0000 (14:09 -0700)]
New implementation of userspace datapath, based on the netdev library.
Ben Pfaff [Wed, 24 Jun 2009 17:24:09 +0000 (10:24 -0700)]
Introduce general-purpose ways to wait for dpif and netdev changes.
The dpif and netdev code has had various ways to check for changes to
dpifs and netdevs over the course of Open vSwitch development. All of
these have been thus far fairly specific to the Linux implementation. This
commit is the start of a more general API for watching for such changes.
The dpif-related parts seem fairly mature and so they are documented,
the netdev parts will probably need to change somewhat and so they are
not documented yet.
Ben Pfaff [Fri, 19 Jun 2009 21:09:09 +0000 (14:09 -0700)]
dpif: Add new functions dp_run() and dp_wait().
The upcoming netdev-based dpif needs a hook where it can process packets
and throw them against the flow table, and this provides a suitable place.
Ben Pfaff [Wed, 17 Jun 2009 21:35:35 +0000 (14:35 -0700)]
dpif: Make dpifs abstract, to allow multiple datapath implementations.
This commit initially introduces only a single datapath implementation,
which is the same as the original one, but it paves the way for
additional implementations, such as the upcoming userspace datapath.
Ben Pfaff [Fri, 19 Jun 2009 21:03:12 +0000 (14:03 -0700)]
datapath: Drop unneeded local variable initialization.
Ben Pfaff [Wed, 17 Jun 2009 21:28:07 +0000 (14:28 -0700)]
datapath: Change ODP_PORT_LIST semantics.
Until now, ODP_PORT_LIST has reported the number of ports actually copied
out. It's better for the caller, however, if it reports the number of
ports that were available to be copied out.
Ben Pfaff [Wed, 17 Jun 2009 18:51:55 +0000 (11:51 -0700)]
datapath: Make openvswitch_ioctl() have a single point of exit.
This makes it easier to insert debug printk() calls in a single place if
necessary, and conforms at least as well with Linux kernel style.
Ben Pfaff [Wed, 17 Jun 2009 18:50:46 +0000 (11:50 -0700)]
datapath: Fix ODP_PORT_DEL handling of bad user memory read.
Ben Pfaff [Wed, 17 Jun 2009 18:49:01 +0000 (11:49 -0700)]
datapath: Style fix.
Ben Pfaff [Wed, 17 Jun 2009 19:41:30 +0000 (12:41 -0700)]
datapath: Get rid of query operations for single flows.
Ben Pfaff [Wed, 17 Jun 2009 21:26:19 +0000 (14:26 -0700)]
datapath: Make the datapath responsible for choosing port numbers.
Soon we will allow for multiple datapath implementations. By allowing
the datapath to choose the port numbers, we possibly simplify some datapath
implementations, and the datapath's clients don't have to guess (or to
check) what port numbers are free, so this seems like a better way to go.
Ben Pfaff [Tue, 16 Jun 2009 21:16:14 +0000 (14:16 -0700)]
datapath: Remove unnecessary range check from put_actions().
This code checked that the number of actions in a flow query did not
exceed the maximum number of actions that are allowed on a given flow.
But this check is unnecessary, since the code will never copy out any
more actions than actually exist in a flow. It would be a shame to refuse
a flow query simply on the basis that the caller allocated more memory
than necessary, so eliminate the check.
Ben Pfaff [Wed, 17 Jun 2009 21:18:10 +0000 (14:18 -0700)]
dpif: Rename odp_msg related functions for more consistency.
This seems like a more consistent naming scheme, since all of these
functions are related but none of them were named similarly or grouped
together.
Ben Pfaff [Wed, 17 Jun 2009 21:22:57 +0000 (14:22 -0700)]
dpif: Change dpif_port_group_get() semantics.
This function is easier for callers to use if they do not have to guess
how many ports are in the group. Since it's not performance critical at
all, introduce these easier semantics.
Ben Pfaff [Tue, 16 Jun 2009 18:05:00 +0000 (11:05 -0700)]
dpif: Remove obsolete support for datapaths whose names begin with "nl:".
The use of "nl:" as a prefix for datapath names has been deprecated for
months. That should be long enough for users to update their scripts.
Ben Pfaff [Tue, 16 Jun 2009 17:09:10 +0000 (10:09 -0700)]
dpif: Hide the contents of struct dpif.
This helps prepare for multiple dpif implementations, and ensures that
code outside dpif.c does not depend on its internals.
Ben Pfaff [Tue, 16 Jun 2009 17:01:04 +0000 (10:01 -0700)]
dpif: Make dpif_port_query_by_name() more useful by logging less on failure.
One potential user of dpif_port_query_by_name() actually open-coded the
function because it didn't want logging on failure. There was only one
actual caller of the function, which didn't want logging on failure either.
So, clean up by reducing the failure log level to DBG and making the
open-coded version an actual caller.
Ben Pfaff [Tue, 16 Jun 2009 18:00:22 +0000 (11:00 -0700)]
dpif: Replace dpif_id() by dpif_name().
dpif_id() is often used in error messages, e.g. "dp%u: screwed up". But
soon we will be generalizing the concept of a datapath, so it is better
to have a function that returns a full name, e.g. "%s: screwed up".
Accordingly, this commit replaces dpif_id() by a new function dpif_name()
that does so.
Ben Pfaff [Tue, 16 Jun 2009 17:59:43 +0000 (10:59 -0700)]
dpif: New function dpif_get_netflow_ids().
The 'minor' member of struct dpif is used for two different purposes:
for printing in log messages and for encapsulating in NetFlow messages.
The needs in each case are different, so we should break up these uses.
This commit does half of that, by introducing a new function to retrieve
NetFlow ids and using it where appropriate.
Ben Pfaff [Mon, 15 Jun 2009 23:51:46 +0000 (16:51 -0700)]
dpif: Rename dpif_get_name() to dpif_port_get_name(), update interface.
With multiple kinds of datapaths, code should not just use
"dp%u" along with dpif_minor() to print a datapath name, because not all
datapaths can sensibly be named that way. We want to use a function
with a name like dpif_get_name() to retrieve a datapath name for printing
to the user, in which case the existing dpif_get_name() function would be
confusing. So rename the existing one to something more explicit.
Ben Pfaff [Wed, 24 Jun 2009 17:21:39 +0000 (10:21 -0700)]
shash: New function shash_first().
Ben Pfaff [Wed, 24 Jun 2009 17:21:25 +0000 (10:21 -0700)]
shash: New function shash_is_empty().
Justin Pettit [Wed, 1 Jul 2009 20:58:19 +0000 (13:58 -0700)]
vswitchd: Enable updating resolv.conf by default when using discovery
When vSwitch does discovery, it is supposed to update resolv.conf by
default. The way configuration parameters were being read, it would
disable this update by default.
Justin Pettit [Wed, 1 Jul 2009 19:41:46 +0000 (12:41 -0700)]
Increase version number to 0.90.2.
Justin Pettit [Wed, 1 Jul 2009 18:31:37 +0000 (11:31 -0700)]
Merge commit 'origin/citrix'
Justin Pettit [Tue, 30 Jun 2009 22:24:54 +0000 (15:24 -0700)]
vswitch: Set minimum probe interval to 5 seconds
In vSwitch, the minimum probe interval is supposed to be 5 seconds, but
that was not enforced. If no interval was specified in the config file,
a value of 0 was being used, which would cause probes to never be sent
and the rconn not to move out of its ACTIVE state.
Possible fix to Bug #1466.
Ben Pfaff [Fri, 26 Jun 2009 23:00:07 +0000 (16:00 -0700)]
Log more rconn status.
Ben Pfaff [Fri, 26 Jun 2009 21:15:04 +0000 (14:15 -0700)]
datapath: Fix use-after-free error in datapath destruction.
When we create a datapath we do this:
1. Create local port.
2. Call add_dp hook.
3. Allow userspace to add more ports.
When we deleted a datapath we were doing this:
1. Call del_dp hook
2. Delete all the ports.
Unfortunately step 1 destroys dp->ifobj, then dp_del_port on any port other
than the local port in step 2 tries to reference dp->ifobj through a call
to sysfs_remove_link().
This commit fixes the problem by changing datapath deletion to mirror
creation:
1. Delete all the ports but the local port.
2. Call dp_del hook.
3. Delete local port.
Commit
010082639 "datapath: Add sysfs support for all (otherwise supported)
Linux versions" makes this problem obvious on a 2.6.25+ kernel configured
with slab debugging, because on such kernels the ifobj is a pointer to a
slab object that is freed by the del_dp hook function (when brcompat_mod
is loaded). This bug may be just as present on older kernels, but there
the ifobj is part of struct datapath, not a pointer, and thus it is much
harder to trigger.
Bug #1465.
Justin Pettit [Fri, 26 Jun 2009 19:39:50 +0000 (12:39 -0700)]
xenserver: Remove cacert when user reconfigures the controller
If a user moves from one controller to another, we did not remove the
cacert. This prevents the switch from connecting to the new controller.
To ease confusion, we now delete the cacert when the user changes or
removes the controller in xsconsole.
Note: This commit has a minor security issue, since we do not remove
trust for the old certificate until the switch is restarted. In
general, users should only be connected to trusted servers, so the
impact should be low. Fixes this would require larger changes to the
vconn-ssl code, which we don't want to do so late in the release cycle.
Bug #1457
Ben Pfaff [Fri, 26 Jun 2009 19:20:02 +0000 (12:20 -0700)]
datapath: Remove redundant synchronize_rcu() call.
There is no benefit to synchronizing twice, and it might cost us a lot of
time.
Justin Pettit [Thu, 25 Jun 2009 07:36:42 +0000 (00:36 -0700)]
Adjust Open vSwitch mailing lists to reflect reality
We've gone through a couple of iterations for names of these mailing
lists. Currently, there are three: announce, discuss, and git. There
are aliases that point "bugs" and "dev" to the "discuss" mailing list.
This commit drops the "ovs-" prefix to mailing lists, since we're not
using them.
Justin Pettit [Thu, 25 Jun 2009 04:52:34 +0000 (21:52 -0700)]
xenserver: Validate controller IP address in xsconsole
When a switch is using in-band control, the controller must be specified
in dotted quad format, since DNS names cannot be resolved until a
connection to the controller has been established. This commit
validates the user input in the xsconsole plugin.
Justin Pettit [Thu, 25 Jun 2009 01:03:44 +0000 (18:03 -0700)]
vswitchd: Adding and removing mgmt interface breaks connection
When a managment connection is configured and then removed, putting it
back causes the management connection to never be reestablished. The
management code checks whether the configuration file has changed before
it attempts to reconfigure itself. If the only thing that changed was
the lack of a management connection, then it tore down the connection
but didn't update its view of the configuration. When the same
manager IP is configured, the cached version matches the new version, so
no changes are made. This commit clears the cached version, so that a
removing and then adding the manager will be detected as a change.
Bug #1448
Ben Pfaff [Wed, 24 Jun 2009 21:58:57 +0000 (14:58 -0700)]
datapath: Ignore return value from rtnl_notify().
In Linux 2.6.30, the rtnl_notify() return type was changed from int to
void along with the following commit message:
This patch also modifies the rtnetlink code to ignore the return
value of rtnl_notify() in all callers. The function rtnl_notify()
(before this patch) returned the error of the unicast notification
which makes rtnl_set_sk_err() reports errors to all listeners. This
is not of any help since the origin of the change (the socket that
requested the echoing) notices the ENOBUFS error if the notification
fails and should resync itself.
Thus there's no point in checking the return value, even in older versions
of the kernel, and so this commit changes our code to ignore it, even
on older kernel versions. We also update the rtnl_notify() wrapper macros
to make the return type void on older kernel versions.
This has not been tested, just built.
Thanks to Mikio for spurring me to try building with Linux 2.6.29 and
2.6.30.
Justin Pettit [Tue, 23 Jun 2009 21:18:43 +0000 (14:18 -0700)]
Remove references to Open vSwitch being a "virtual" switch
The Open vSwitch system is not limted to being a virtual switch. This
commit removes these references. We are now a "versatile" switch!
Ben Pfaff [Tue, 23 Jun 2009 18:03:52 +0000 (11:03 -0700)]
xenserver: Also log ovs-brcompatd messages at INFO level to syslog.
INFO level messages are meant to be logged in the ordinary case, and they
are useful for debugging problems, so turn them on by default.
It would be a good idea to do so for ovs-vswitchd also, but we have not
tested how much this would increase the log volume.
Ben Pfaff [Tue, 23 Jun 2009 18:02:30 +0000 (11:02 -0700)]
ovs-brcompatd: Turn up log level of port removal messages.
These messages proved useful during debugging, and they should not be too
common, so log them at a higher level.
Ben Pfaff [Tue, 23 Jun 2009 18:00:43 +0000 (11:00 -0700)]
ovs-brcompatd: Handle XS Tools 5.0.0 destroying and recreating devices
XenServer Tools version 5.0.0 destroys and recreates network devices with
the same name on boot of (at least) Windows VMs. We had a race such that
ovs-brcompatd would delete the new device from the vswitchd configuration
file (not the old one). This commit fixes that problem.
Bug #1429.
Justin Pettit [Tue, 23 Jun 2009 02:01:34 +0000 (19:01 -0700)]
Add some comments to description to netdev functions.
A few of the netdev functions lacked descriptions, so this adds them.
Justin Pettit [Sat, 20 Jun 2009 00:41:42 +0000 (17:41 -0700)]
vswitchd: Reduce number of calls to reconfigure() during mgmt updates
When we receive an OpenFlow management protocol Config Update, we
immediately force the switch to reconfigure itself. This is
functionally correct, but it can cause long delays before return control
back to the switch. We now keep track of whether there were any changes
and then only force a reconfigure once per management run.
Ben Pfaff [Sat, 20 Jun 2009 00:13:57 +0000 (17:13 -0700)]
cfg: Log accurate waiting times in cfg_lock().
When cfg_lock() has to block for some time to obtain the configuration file
lock, it logs the amount of time that it waited. However, it did not
refresh the current time before it began waiting, so the time that it
logged could be off by a significant amount, which make interpreting the
log file more challenging than it should have been.
This change should mainly affect log output. It should have little or no
effect on Open vSwitch operation because the factor by which the timeouts
were off is an order of magnitude smaller than the actual timeouts that we
pass into the function.
This is related to bug #1426, but it is not a fix for this bug, which will
be committed separately.
Justin Pettit [Thu, 18 Jun 2009 21:17:32 +0000 (14:17 -0700)]
xenserver: xsconsole plugin doesn't need execute permissions
When the vSwitch xsconsole plugin is installed, it doesn't need execute
permissions. This commit changes the permissions from 755 to 644 to
match the other plugins.
Justin Pettit [Thu, 18 Jun 2009 21:13:00 +0000 (14:13 -0700)]
xenserver: Handle slave disconnection more gracefully in xsconsole plugin
When a slave cannot connect to the master, the vSwitch xsconsole plugin
complained with some Python style errors on the main display. This
commit cleans up that behavior.
Bug #1341
Justin Pettit [Tue, 16 Jun 2009 19:57:25 +0000 (12:57 -0700)]
xenserver: Force reload of config file after VIF deleted
When a VIF is deleted, the "vif" script modifies "/etc/ovs-vswitchd.conf".
After changes are made to the config file, ovs-vswitchd should be told
to reload it, but this wasn't happening. Now it does.
Thanks to Natasha for catching this.
Justin Pettit [Mon, 15 Jun 2009 23:19:08 +0000 (16:19 -0700)]
Increase version number to v0.90.1.
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.
Ben Pfaff [Mon, 15 Jun 2009 23:04:54 +0000 (16:04 -0700)]
Merge changes from citrix branch into master.
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.
Ben Pfaff [Mon, 15 Jun 2009 22:11:30 +0000 (15:11 -0700)]
Update primary code license to Apache 2.0.
Ben Pfaff [Mon, 15 Jun 2009 20:40:41 +0000 (13:40 -0700)]
xenserver: Fix stupid typo in previous commit (s/modudules/modules/).
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.)
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.
Ben Pfaff [Sat, 13 Jun 2009 00:10:09 +0000 (17:10 -0700)]
vconn: Add unit test for tcp and unix 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Ben Pfaff [Wed, 10 Jun 2009 23:45:28 +0000 (16:45 -0700)]
Add unit test for SHA-1 library.
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.
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.
Ben Pfaff [Wed, 10 Jun 2009 22:13:21 +0000 (15:13 -0700)]
vswitch: Add ovs-appctl commands for debugging and managing bonds.
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.
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.
Justin Pettit [Wed, 10 Jun 2009 01:40:15 +0000 (18:40 -0700)]
xenserver: Add dump-vif-details to automake
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
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.
Justin Pettit [Tue, 9 Jun 2009 00:29:37 +0000 (17:29 -0700)]
Fix url in RPM spec.
Ben Pfaff [Wed, 10 Jun 2009 00:10:18 +0000 (17:10 -0700)]
Add unit test for TCP/IP checksumming code.