Ben Pfaff [Thu, 4 Jun 2009 18:15:39 +0000 (11:15 -0700)]
Merge citrix branch into master.
Ben Pfaff [Thu, 4 Jun 2009 18:04:24 +0000 (11:04 -0700)]
vswitch: Remove development debug logging code that escaped.
Justin Pettit [Wed, 3 Jun 2009 20:44:46 +0000 (13:44 -0700)]
vswitch: Send NACK for bad cookie on update attempt.
When the controller sends an update to the switch through the management
channel, a cookie is used to detect changes. If the controller's idea
of the state of the config file differed from the switch's, the switch
would send an error message. This commit changes to behavior to not send
an error message, and instead send a negative acknowledgement for the
request.
Ben Pfaff [Wed, 3 Jun 2009 16:36:06 +0000 (09:36 -0700)]
vswitch: Don't push bad flows to datapath during reconfiguration.
When reconfiguration adds a new port to a bridge, it initially has
dp_ifidx of -1, indicating that the datapath port number is unknown. (It
can't be known because ports are added to the datapath later on.) But
during configuration of the controller we may add or modify flows using
ofproto_add_flow(), which can update flows in the datapath. The -1
dp_ifidx will then get converted to uint16_t as 65535, which the datapath
will reject as a bad port number.
This commit solves the problem by configuring the controller later, after
datapath port numbers have been assigned.
Ben Pfaff [Tue, 2 Jun 2009 20:56:53 +0000 (13:56 -0700)]
timeval: Log additional statistics along with wall-clock time.
It's sometimes unclear whether a process was simply descheduled during its
run for an extended interval, or whether it actually did a lot of work. By
also logging system and user times, number of context switches, etc., we
can help out with debugging.
Ben Pfaff [Tue, 2 Jun 2009 21:30:12 +0000 (14:30 -0700)]
timeval: Refresh current time after every wakeup, not just false wakeups.
This failure to update the current time in some cases may have contributed
to false complaints about long poll delays, since this could leave up to
100 ms of time blocked in the poll system call accounted to the next
inter-poll interval instead of to the poll system call itself.
This commit makes vswitch's claimed average poll interval to drop by a
large amount, from ~20 ms to ~2 ms.
Ben Pfaff [Mon, 1 Jun 2009 22:30:27 +0000 (15:30 -0700)]
coverage: Don't output similar event coverage more than once.
Too often, the system log was getting filled with event coverage
information that was similar or identical to that logged previously by the
same process. This commit introduces a hashing mechanism that should
give similar output the same hash value and prevent logging it more than
once per process run.
Ben Pfaff [Mon, 1 Jun 2009 22:19:22 +0000 (15:19 -0700)]
hash: New function hash_int() for hashing a single 32-bit integer value.
Ben Pfaff [Mon, 1 Jun 2009 22:05:33 +0000 (15:05 -0700)]
hash: New convenience function hash_string() for hashing a string.
Ben Pfaff [Mon, 1 Jun 2009 20:56:08 +0000 (13:56 -0700)]
ovs-cfg-mod: Add -T, --timeout option.
Ben Pfaff [Tue, 2 Jun 2009 21:09:03 +0000 (14:09 -0700)]
ovs-brcompatd: Don't bother to unlock the config file on fatal signal.
There's no need to do this any longer, because it will happen
automatically when the fd to it (if any) is closed by the kernel.
Ben Pfaff [Tue, 2 Jun 2009 21:08:04 +0000 (14:08 -0700)]
ovs-brcompatd: Log the time to reload vswitch, to aid with debugging.
Ben Pfaff [Tue, 2 Jun 2009 21:07:19 +0000 (14:07 -0700)]
cfg: Reimplement vswitchd config file locking reliably.
The lock file protocol used until now for the vswitchd configuration file
was intended for use with serial devices that are not opened very often
and stay open for a relatively long time (typically minutes or hours).
This protocol contains possible (though probably unimportant) races, e.g.
between one locker reading the contents of the lock file and another
writing to it; if the reader saw a write of a partial PID then it could
think that an nonexistent process owned it and thereby delete it. It is
probably possible to fix this race, by writing to a temporary file
and link()ing the temporary file to the lock file.
Also, cfg_unlock() had a race in its unlock order: the lock file should be
unlinked before it is closed; otherwise another process could race in and
unlink and replace the lock file, and then when the unlocking process
resumes it would unlink the other process's still-active lock file.
But the serial lock file protocol has other problems for our purposes, at
least:
* It is rather complicated, which makes it more difficult to implement
in other languages (such as Python, which the interface-reconfigure
script should be doing itself).
* There is no way to wait for the lock to become available without
polling.
This commit replaces the serial lock file protocol by one that does not
have any of these shortcomings. The primary difference is that it uses a
single long-lived lock file, to which the kernel's blocking F_SETLKW fcntl
operation can be applied, instead of a series of short-lived lock files,
for which there is no way to wait.
Ben Pfaff [Tue, 2 Jun 2009 18:22:58 +0000 (11:22 -0700)]
vswitch: Fix typo in manpage.
Thanks to Johan for reporting this.
Ben Pfaff [Sat, 30 May 2009 00:09:30 +0000 (17:09 -0700)]
Drop trailing white space from Makefile line that Automake warned about.
Ben Pfaff [Sat, 30 May 2009 00:09:11 +0000 (17:09 -0700)]
Rename COVERAGE_SOURCES to COVERAGE_FILES to avoid Automake warning.
<foo>_SOURCES ordinarily lists the source files for <foo>, but that wasn't
true in this case so Automake issued a warning.
Ben Pfaff [Sat, 30 May 2009 00:02:03 +0000 (17:02 -0700)]
Drop -Wno-syntax from Automake options, because we no longer need it.
Ben Pfaff [Fri, 29 May 2009 23:00:57 +0000 (16:00 -0700)]
Add coding style document.
This document is mainly a description of the rules of thumb that I have
followed while writing Open vSwitch userspace code. If you don't like
some of the rules, please talk to me.
Ben Pfaff [Fri, 29 May 2009 22:58:50 +0000 (15:58 -0700)]
xenserver: Load llc module at boot time.
Fixes boot failure due to previous commit, which made the openvswitch
module depend on llc without causing it to be loaded.
Ben Pfaff [Fri, 29 May 2009 22:32:59 +0000 (15:32 -0700)]
datapath: Prevent bridge module from loading along with openvswitch.
For some time, the openvswitch kernel module has checked whether the
bridge module is loaded and refused to start if so. However, the bridge
module doesn't check whether the openvswitch module is loaded, so it can
end up loaded at the same time if something goes wrong, and then generally
the system OOPSes sooner or later.
This commit adds proper mutual exclusion, by registering an LLC SAP for
the protocol used by spanning tree. This is the first thing that the
bridge module does at initialization time also, and since there can only
be one registration for a given protocol this prevents both modules from
being loaded at the same time.
This fixes an actual OOPS observed at boot time on a XenServer running the
debug kernel that we built based on Citrix's 5.5.0-beta1 kernel.
Ben Pfaff [Fri, 29 May 2009 22:15:53 +0000 (15:15 -0700)]
xenserver: Put XenServer network UUIDs into ovs-vswitchd.conf.
vNetManager needs the UUIDs of the XenServer networks represented by a
bridge. interface-reconfigure has all the necessary information to figure
this out, so make it add them to the configuration file.
Ben Pfaff [Thu, 28 May 2009 21:50:54 +0000 (14:50 -0700)]
xenserver: Keep Centos network config files up-to-date even with vswitch.
When the vswitch is running, it doesn't care about, doesn't need, and
doesn't use the files in /etc/sysconfig/network-scripts. But if you ever
remove the vswitch (e.g. "rpm -e vswitch") then the regular bridge code
does need them. There is no guarantee that we will be able to get access
to the xapi database at "rpm -e" time, so it is better to keep these
configuration files up-to-date after each operation. This commit does
that.
Given that we keep these files up-to-date after each operation now, there
is no need to call interface-reconfigure at RPM uninstall time, so this
commit also removes the script code that did that.
Ben Pfaff [Thu, 28 May 2009 21:38:17 +0000 (14:38 -0700)]
xenserver: Create xapi database cache in RPM preinstall step.
Until now, the RPM package for XenServer only attempted to save the xapi
database cache during the reboot process (from
/etc/init.d/management-interface), which happened well after the vswitch
was actually installed. This meant that if connectivity to xapi was busted
at reboot time, or even just if the machine was rebooted with the reset
button instead of through a graceful reboot sequence, then the machine
would fail to come up and there would be no way to fix it without removing
the vswitch.
This commit fixes the problem by writing out the xapi database cache before
package installation and aborting the install if the operation fails.
Ben Pfaff [Wed, 27 May 2009 18:46:20 +0000 (11:46 -0700)]
datapath: Avoid bad array reference for missing group in ODPAT_OUTPUT_GROUP.
When ODPAT_OUTPUT_GROUP referenced a group that hadn't been created,
output_group() would return a negative number other than -1.
execute_actions() would pass this later to do_output(), which would then
use it as a bogus array index, accessing invalid memory.
This commit fixes it by making it return -1 instead, which the caller
interprets correctly.
Thanks to Justin for leading me to scrutinize this code.
Ben Pfaff [Wed, 27 May 2009 18:37:08 +0000 (11:37 -0700)]
datapath: Avoid double-free on skb_clone failure in ODPAT_OUTPUT_GROUP.
output_group() has no business freeing the skb passed into it, but it was
doing so in case of allocation failure. Since execute_actions() would
also later free it, this was a serious error.
Thanks to Justin for pointing out the problem.
Ben Pfaff [Wed, 27 May 2009 16:09:54 +0000 (09:09 -0700)]
datapath: Fix read of uninitialized data.
Control jumps to the error_free_flow label to free a flow allocated with
kmem_cache_alloc(), but the sf_acts member of that flow has never been
initialized and thus flow_free() will pass uninitialized data to kfree().
Fix it by just freeing the flow itself.
Ben Pfaff [Tue, 26 May 2009 17:44:43 +0000 (10:44 -0700)]
secchan: Disallow port numbers not supported by datapath.
The OpenFlow protocol supports port numbers from 0 to 0xff00.
The datapath protocol supports port numbers from 0 to 0x100.
The datapath will reject port numbers in the range 0x100 to 0xff00, but the
secchan was not screening these out. Thus, attempting to add a flow or
send a packet to one of these ports would result in a kernel EINVAL error,
instead of a more sensible OpenFlow error. This commit remedies the
situation.
Thanks to Justin for pointing out the issue.
Ben Pfaff [Tue, 26 May 2009 17:40:09 +0000 (10:40 -0700)]
datapath: Fix return value when ODP_FLOW_PUT fails to allocate a flow.
Noticed by Justin.
Ben Pfaff [Tue, 26 May 2009 17:36:53 +0000 (10:36 -0700)]
secchan: Do not refresh datapath indexes from bridge_get_ifaces().
bridge_get_ifaces() called bridge_fetch_dp_ifaces(), which in turn would
set dp_ifidx members of struct iface to -1 if we were racing with a port
being deleted from a datapath. When this happen it would cause
ODPAT_OUTPUT actions with the port number set to UINT16_MAX to be pushed
to the datapath on OFPP_NORMAL actions, which the datapath would choke
on with EINVAL errors.
Thanks to Justin for pointing out the bad actions being pushed to the
datapath.
Ben Pfaff [Thu, 21 May 2009 20:25:40 +0000 (13:25 -0700)]
xenserver: Remove bridge configuration files when they become stale.
interface-reconfigure communicates with the vif script using files in
/etc/openvswitch, but it didn't delete them when they were stale. This
commit fixes the problem.
Ben Pfaff [Thu, 21 May 2009 20:17:49 +0000 (13:17 -0700)]
xenserver: Fix file name conflict.
Our xenserver scripts were attempting to use /etc/sysconfig/vswitch for
two different purposes: as both a file and a directory. Move one of them.
Ben Pfaff [Thu, 21 May 2009 19:49:04 +0000 (12:49 -0700)]
cfg: Fix typo in comment.
Ben Pfaff [Mon, 18 May 2009 22:31:59 +0000 (15:31 -0700)]
xenserver: Delete port ingress policing settings when adding vif.
When we add a new vif, we should not retain any prior ingress policing
settings from previous incarnations of a vif with the given name.
Bug #1328.
Ben Pfaff [Mon, 18 May 2009 22:29:45 +0000 (15:29 -0700)]
xenserver: Only require confirmation for "vswitch restart" if interactive.
When /etc/init.d/vswitch restart is invoked non-interactively (e.g. from
a cron job), don't require interactive confirmation. Not that we should
encourage such behavior, but this approach seems closer to what most Unix
utilities do in similar situations.
Ben Pfaff [Mon, 18 May 2009 22:32:20 +0000 (15:32 -0700)]
xenserver: Remove now-unsupported commands from /etc/init.d/vswitch.
The "unload" and "update-modules" commands for /etc/init.d/vswitch were
based on the files in /etc/sysconfig/network-scripts. The current
implementation of interface-reconfigure no longer updates those files, so
these commands would no longer work reliably. Worse, they would work
*sometimes* but not other times, so it's better not to offer them at all.
It might make sense to reimplement these, if they are useful enough.
Ben Pfaff [Thu, 21 May 2009 19:40:05 +0000 (12:40 -0700)]
Rename vswitchd to ovs-vswitchd, for consistency.
Ben Pfaff [Sat, 16 May 2009 00:19:35 +0000 (17:19 -0700)]
Rename brcompatd to ovs-brcompatd, for consistency.
Ben Pfaff [Thu, 21 May 2009 18:18:34 +0000 (11:18 -0700)]
datapath: Disable TX on internal ports before removing.
This is a partial fix for a more pervasive problem, that destroying a
dp_dev races with its transmit work function (dp_dev_do_xmit) running.
A "better" and "correct" fix has been written, but unfortunately it seems
to be buggy and crash the system so far.
Ben Pfaff [Thu, 21 May 2009 18:11:08 +0000 (11:11 -0700)]
xenserver: Make vif script log its changes to vswitchd.conf.
This makes debugging easier.
Ben Pfaff [Thu, 21 May 2009 18:10:19 +0000 (11:10 -0700)]
brcompat refactoring fixes
Ben Pfaff [Wed, 20 May 2009 23:18:45 +0000 (16:18 -0700)]
xenserver: Fix VLANs on virtual interfaces.
Ben Pfaff [Wed, 20 May 2009 21:57:06 +0000 (14:57 -0700)]
xenserver: Fix use of VLAN as primary management interface.
xapi insists that the device that carries the IP address for a VLAN is
the bridge that it thinks the VLAN is on. This commit makes it so.
xapi also will do the ioctl equivalent of "brctl addbr xapi#" if that
bridge appears to be missing when it reconfigures the interface. If we
return EEXIST or any other error, then it gives up at that point. So we
have to return "success" to that attempt regardless of whether we really
want to do so.
Ben Pfaff [Tue, 19 May 2009 16:45:41 +0000 (09:45 -0700)]
Revert "xenserver: Make primary management interface on VLAN possible."
This reverts commit
d71cb7eb3e52fbf521abe6d0cb19cc8b7aea80dc.
The strategy used in that commit for making the primary management
interface on a VLAN possible did not work reliably. Sometimes it would
work for a time, but eventually xapi would start listening only on the IP
address attached to the fake VLAN bridge. Since this is not a real IP
address that can be used to talk to the outside world (and in any case it
isn't the IP address requested by the administrator) xapi would become
unreachable at this point.
Ben Pfaff [Thu, 21 May 2009 16:31:11 +0000 (09:31 -0700)]
brcompat: Move more brcompat implementation into userspace.
Until now, the brcompat kernel module has had to do more of the work of
simulating a bridge than is ideal, because brcompatd was not able to find
out when the vswitchd had finished reloading. It is important that the
bridge reconfiguration be complete by the time that the bridge ioctl
returns, so this had to be done from the kernel.
Now it is possible for brcompatd to wait for the reload to finish (by
using the equivalent of "ovs-appctl -e vswitchd/reload") so this part of
the work can be done in userspace. This commit moves it there.
This commit also moves to userspace some error-checking work, in particular
checking whether a bridge or a port operation is correct. This is
important for an upcoming commit, where brcompatd wishes to send a fake
success return value for an operation that must be ignored. When the error
checking is done in the kernel, it defeats this purpose.
Ben Pfaff [Wed, 20 May 2009 21:43:49 +0000 (14:43 -0700)]
dirs: Add variable for bindir.
brcompatd wants to use this in an upcoming commit.
Ben Pfaff [Wed, 20 May 2009 21:32:42 +0000 (14:32 -0700)]
cfg: Add new function cfg_is_dirty().
Justin Pettit [Thu, 21 May 2009 05:46:29 +0000 (22:46 -0700)]
Change project name to "Open vSwitch"
The project was most recently called "OpenVSwitch". This commit changes
the name to "Open vSwitch", which should be the official name (and
capitalization) going forward.
Justin Pettit [Thu, 21 May 2009 05:18:37 +0000 (22:18 -0700)]
Modify version string for various binaries.
For applications that understand OpenFlow, print the versions they
support. This change also adds that the program is part of the Open
vSwitch project.
Add support for the "--version" argument to some programs that were
missing it.
Justin Pettit [Thu, 21 May 2009 03:57:47 +0000 (20:57 -0700)]
xenserver: Fix typo in description of RPM spec file
Corrects the spelling of "bridging" in the description of the RPM spec
file.
Ben Pfaff [Tue, 19 May 2009 22:37:10 +0000 (15:37 -0700)]
Remove vestigial SNAT support.
Ben Pfaff [Tue, 19 May 2009 21:01:55 +0000 (14:01 -0700)]
brcompatd: Improve error message.
When there are no non-option arguments, "config file is only non-option
argument" is a confusing message, so make it more generic.
Ben Pfaff [Wed, 20 May 2009 19:34:41 +0000 (12:34 -0700)]
lib/automake.mk: Fix odd typo that apparently did no damage.
$(pkgdatadir$) apparently expands exactly the same way as $(pkgdatadir),
at least under GNU make, but it's obviously wrong.
Ben Pfaff [Tue, 19 May 2009 00:02:58 +0000 (17:02 -0700)]
hash: Add unit test.
Ben Pfaff [Tue, 19 May 2009 00:04:27 +0000 (17:04 -0700)]
tests: Ignore test binaries.
Ben Pfaff [Wed, 20 May 2009 16:17:04 +0000 (09:17 -0700)]
ovs-pki: Fix bashism.
Thanks to Nicolas Perrenoud <nicolape@ee.ethz.ch> for reporting the
problem.
Justin Pettit [Wed, 20 May 2009 01:01:49 +0000 (18:01 -0700)]
xenserver: Fix setting pool-wide controller setting
The latest set of changes left out pushing the controller configuration
changes out to members of the pool. This patch adds back the call to do
that.
Justin Pettit [Tue, 19 May 2009 00:08:47 +0000 (17:08 -0700)]
xen: Fix a missed xapi plugin from the Nicira brand stripping
Missed a xapi plugin during the rebranding. This adds that and fixes a
couple of case-senstive variable issues. Ugh, need to figure out how to
make local Xen RPM builds...
Justin Pettit [Mon, 18 May 2009 23:31:27 +0000 (16:31 -0700)]
xen: Add missing change to Nicira brand removal commit
Also need to update the makefile!
Justin Pettit [Mon, 18 May 2009 23:22:40 +0000 (16:22 -0700)]
xen: Remove Nicira branding from vSwitch xsconsole plugin
Since the plan is to eventually integrate this code into the Xen
distribution, the Nicira tags have been removed. The copyright is still
held by Nicira until a better one is found.
Jesse Gross [Mon, 18 May 2009 22:41:11 +0000 (15:41 -0700)]
brcompatd: Fix type in brcompatd man page.
Ben Pfaff [Mon, 18 May 2009 20:43:45 +0000 (13:43 -0700)]
xenserver: Drop unused variable.
Ben Pfaff [Mon, 18 May 2009 20:31:00 +0000 (13:31 -0700)]
xenserver: Fix missing default route problem.
Taking down the vlan_slave's network device deletes any routes associated
with it, including the default route, and those routes are not restored
when the network device is brought up again later.
So don't take that device down at all. There's no reason to do so.
We still want to bring that device up after configuring the pif, just in
case it was down, so this commit only deletes the down_netdev, not the
corresponding up_netdev later on.
Second half of bug #1327.
Ben Pfaff [Mon, 18 May 2009 20:15:28 +0000 (13:15 -0700)]
xenserver: Choose correct management PIF even with --force.
The --force option was failing to choose the management PIF based on
the "management" PIF field. This commit fixes the problem.
This is a partial fix for bug #1327.
Ben Pfaff [Mon, 18 May 2009 19:23:39 +0000 (12:23 -0700)]
xenserver: Delete code unneeded for openvswitch.
openvswitch doesn't care about the ordering here.
Ben Pfaff [Mon, 18 May 2009 19:23:03 +0000 (12:23 -0700)]
xenserver: Make primary management interface on VLAN possible.
Before xapi puts the primary management interface on a new PIF, it verifies
that the PIF's network device exists and has an IP address. For physical
PIFs and for bonds, this works fine. For VLANs, the openvswitch does not
put the IP address on the network device that xapi expects, but on a
different network device (e.g. openvswitch puts it on eth0.X instead of on
xapiY), so this checks fails with the message "The specified interface
cannot be used because it has no IP address".
This commit makes interface-reconfigure "fake out" xapi by putting a
dummy IP address on the xapi# interface.
Bug #1325.
Justin Pettit [Mon, 18 May 2009 15:49:45 +0000 (08:49 -0700)]
xen: Fix permission on xsconsole plugin
Not sure why the file permissions on the xsconsole plugin changed, but
this reverts them back.
Justin Pettit [Mon, 18 May 2009 15:45:56 +0000 (08:45 -0700)]
xen: xsconsole plugin cleanup based on Citrix feedback
Various cleanups to the vSwitch plugin for xsconsole based on feedback
from Citrix. The changes include a cleaner way to pop-up temporary
messages, leaving a success or failure box after performing an action,
and safer subprocess calling.
Ben Pfaff [Fri, 15 May 2009 23:56:33 +0000 (16:56 -0700)]
ovs-dpctl: Rename commands for consistency.
Ben Pfaff [Fri, 15 May 2009 22:57:53 +0000 (15:57 -0700)]
ovs-dpctl: Remove get-idx and get-name commands.
These commands made some sense when dpctl only accepted numerical datapath
identifiers, but now it accepts names as well as numbers. These commands
were never really used much, so delete them.
Ben Pfaff [Fri, 15 May 2009 22:48:58 +0000 (15:48 -0700)]
Break dpctl into two programs: ovs-ofctl and ovs-dpctl.
The datapath and OpenFlow are fairly different and it seems wrong
conceptually to work with both in a single program. So this commit breaks
them up into two programs.
Ben Pfaff [Fri, 15 May 2009 20:18:46 +0000 (13:18 -0700)]
xenserver: Fix package build.
Ben Pfaff [Fri, 15 May 2009 19:59:35 +0000 (12:59 -0700)]
ovs-cfg-mod: Accept -v option before any targets are specified.
Setting the log levels should be allowed before specifying targets, but it
wasn't. This fixes it.
This fixes a failure to bring up network interfaces at boot (and at any
other time too).
Ben Pfaff [Fri, 15 May 2009 19:40:05 +0000 (12:40 -0700)]
Rename vlogconf to ovs-appctl, for consistency and as a better name.
The vlogconf program at one time only affected log levels. Now, it can do
more, and probably will be expanded in the future, so appctl is a better
name.
Ben Pfaff [Fri, 15 May 2009 18:16:52 +0000 (11:16 -0700)]
Rename cfg-mod to ovs-cfg-mod, for consistency.
Ben Pfaff [Fri, 15 May 2009 18:14:39 +0000 (11:14 -0700)]
xenserver: Fix path to invoke cfg-mod utility when removing a vif.
It's possible that this fixes a real bug.
Ben Pfaff [Fri, 15 May 2009 18:08:03 +0000 (11:08 -0700)]
Drop stray references to udatapath, which doesn't exist any longer.
Ben Pfaff [Fri, 15 May 2009 18:02:08 +0000 (11:02 -0700)]
Rename "controller" to "ovs-controller" and move to utilities.
The controller is unimportant and we don't want people thinking that it is
important. (They should be using NOX, not the OpenVSwitch controller.)
So kill off its top-level directory.
Justin Pettit [Fri, 15 May 2009 01:11:57 +0000 (18:11 -0700)]
netflow: Set Engine and Add Alternate Port ID Flag
Allow the Engine Type and Engine ID to be configured in NetFlow
messages. Previously, they were always set to zero. Now, by default,
they are both set to the datapath index. These can be overridden with
the "netflow.bridge.engine-type" and "netflow.bridge.engine-id" keys,
respectively.
Add the ability to allow collectors to distinguish between virtual
switches sending message from the host. When the
"netflow.bridge.add-id-to-iface" flag is enabled, the least significant
7 bits of the engine id are placed into the most significant bits of
the ingress and egress interface fields of flow records. This
mimics the behavior of VMware ESX when the "-p" option is given to the
NetFlow configuration program.
(Addresses Bug #1222 and Bug #1223)
Justin Pettit [Thu, 14 May 2009 23:21:03 +0000 (16:21 -0700)]
netflow: Document 1400-byte packet length limit.
The NetFlow code accumulates records until the packet is 1400 bytes or
some amount of time has passed. This just adds a comment that NetFlow
messages are limited to 30 records, which places a ceiling on how large
the message can be (1400 is below that ceiling).
Justin Pettit [Thu, 14 May 2009 22:07:03 +0000 (15:07 -0700)]
vswitch: reduce passes through config loop
When vswitchd configures itself, it loops through the bridges to pull
relevant configuration information from vswitchd.conf. Configuration
for determining the dpid, controller, and NetFlow was inside a loop for
configuring a bridge's interfaces. This meant that these configuration
parameters were being re-set for each interface in the bridge as opposed
to just once for the bridge. This change pushes this configuration
outside of that interface loop. The LIST_FOR_EACH_SAFE macro to loop
through the bridges is switched to LIST_FOR_EACH, since bridges are not
deleted in this loop.
Ben Pfaff [Thu, 14 May 2009 23:25:12 +0000 (16:25 -0700)]
netflow: Report largest possible value when counters exceed 32 bits.
secchan tracks packets and bytes using 64-bit counters, but the
corresponding NetFlow v5 fields are only 32 bits wide. Until now we would
just report the lower 32 bits on overflow; this commit changes the
behavior to reporting 0xffffffff instead.
Bug #1316.
Ben Pfaff [Thu, 14 May 2009 23:13:30 +0000 (16:13 -0700)]
xenserver: Avoid printing log messages to the console from scripts.
Log messages from cfg-mode tended to overwrite random bits of the xsconsole
screen.
Bug #1315.
Ben Pfaff [Thu, 14 May 2009 22:35:47 +0000 (15:35 -0700)]
brcompatd: Fix typo in previous commit.
Ben Pfaff [Thu, 14 May 2009 22:31:15 +0000 (15:31 -0700)]
brcompatd: Don't remove nonexistent ports if vswitchd will create them.
There is a race between brcompatd and vswitchd for internal ports, e.g.
in this scenario:
1. cfg-mod adds "bridge.xenbr0.port=xenbr0".
2. vswitchd creates xenbr0.
we can have brcompatd slip in between them:
2.5. brcompatd notices that there is no network device xenbr0
and deletes the new line from the config file.
For the local port and other internal ports we don't want brcompatd
interfering, so this commit makes it ignore them.
Bug #1314.
Ben Pfaff [Thu, 14 May 2009 21:06:08 +0000 (14:06 -0700)]
Get rid of vswitchext entirely.
Ben Pfaff [Thu, 14 May 2009 20:39:12 +0000 (13:39 -0700)]
Move watchdog timer utility from vswitchext to openvswitch.
Ben Pfaff [Thu, 14 May 2009 20:19:58 +0000 (13:19 -0700)]
Move ovs-monitor script from vswitchext to openvswitch.
Ben Pfaff [Thu, 14 May 2009 19:53:10 +0000 (12:53 -0700)]
Add configure option --disable-userspace for building kernel modules only.
Ben Pfaff [Thu, 14 May 2009 19:33:34 +0000 (12:33 -0700)]
vswitch: Give up hope that the config file delimiter will be changed.
This code originally assumed that it could iterate over all the subsections
of "port" in the configuration file to obtain the names of network devices,
but this didn't work because "." is both the configuration file section
delimiter and a valid (and fairly common) character in network device
names. So it was changed to use a different technique with the hope that
the original code could be restored when the configuration file syntax was
changed.
Now we've agreed that the configuration file syntax is not going to change
before we change to a different configuration model entirely, so this
commit deletes the original code (which was #if'd out, not deleted).
Another reason to do this is to kill off some warnings due to unused
functions and variables.
Ben Pfaff [Thu, 14 May 2009 19:25:26 +0000 (12:25 -0700)]
Delete OpenFlow management spec.
Although this spec was canonical, it was inaccurate and we plan to replace
it by netconf anyhow.
Ben Pfaff [Thu, 14 May 2009 19:24:43 +0000 (12:24 -0700)]
Delete OpenFlow spec.
The openvswitch tree is not the canonical source of the OpenFlow spec.
Get it from openflowswitch.org instead.
Ben Pfaff [Thu, 14 May 2009 18:22:01 +0000 (11:22 -0700)]
Revert "Apply temporary band-aid to VLAN-related OOPS on XenServer."
This reverts commit
ef4a656e73b3bf157519a8f6e239c0e5f54600a3,
since the need for it was eliminated (I hope).
Ben Pfaff [Thu, 14 May 2009 18:20:10 +0000 (11:20 -0700)]
datapath: Fix VLAN-related kernel OOPS on XenServer.
In deleting internal ports (other than the local port) we were failing to
call dp_del_if_hook even though we had called dp_add_if_hook when we added
it. This prevented the sysfs kobject from being released and caused the
wrong address to be passed to kfree. The former could cause random
memory corruption; the latter may be benign since the address was still in
the same slab object.
Ben Pfaff [Thu, 14 May 2009 16:08:20 +0000 (09:08 -0700)]
Apply temporary band-aid to VLAN-related OOPS on XenServer.
Now, VLAN devices will be disabled by default. To enable them, create a
file named /etc/vswitchd.enable-vlans.
This commit will be reverted when a real fix is available.
Ben Pfaff [Wed, 13 May 2009 22:11:37 +0000 (15:11 -0700)]
Move EZIO utilities from vswitchext into openvswitch.
Keith Amidon [Wed, 13 May 2009 21:48:42 +0000 (14:48 -0700)]
Fix for typo in warning message.
Ben Pfaff [Wed, 13 May 2009 21:17:09 +0000 (14:17 -0700)]
xenserver: Add comments describing open issues for interface-reconfigure.
Ben Pfaff [Wed, 13 May 2009 21:15:58 +0000 (14:15 -0700)]
xenserver: Fix --force up/down behavior in a resource pool.
The PIFs key of a network lists one PIF for each member of the pool, not
one PIF per bond or whatever I had in mind. So we need to iterate over
all the PIFs in the network and find the one for our current host.
Ben Pfaff [Wed, 13 May 2009 21:01:32 +0000 (14:01 -0700)]
Add support for Citrix XenServer.
This was previously in openflowext. Now we are adding it to openvswitch.
Ben Pfaff [Wed, 13 May 2009 19:14:46 +0000 (12:14 -0700)]
datapath: Fix build warnings and errors on Linux 2.6.15, 2.6.16, 2.6.17.