Ben Pfaff [Fri, 16 Oct 2009 16:49:59 +0000 (09:49 -0700)]
ovs-vsctl: Add tests that adding duplicate bridges or ports fails.
Suggested-by: Reid Price <reid@nicira.com>
Ben Pfaff [Fri, 16 Oct 2009 16:42:21 +0000 (09:42 -0700)]
ovs-vsctl: Add the ability to perform multiple operations in a single run.
CC: Ian Campbell <Ian.Campbell@citrix.com>
Ben Pfaff [Fri, 16 Oct 2009 16:36:25 +0000 (09:36 -0700)]
ovs-vsctl: Refactor internals to increase flexibility.
This changes the interface of each of the command implementations, making
them take the configuration as an argument and return the output. This
will make it easier to support alternate output formats and to execute more
than one command per invocation (both happening in upcoming commits).
Ben Pfaff [Thu, 15 Oct 2009 19:47:05 +0000 (12:47 -0700)]
ovs-vsctl: Allow bridge name to be omitted from del-port command.
The 'bridge' argument to ovs-vsctl's del-port command is only supplied as
a form of error checking. Sometimes the name of the bridge isn't readily
available, so for such situations this commit allows the user to omit the
name of the bridge entirely.
CC: Ian Campbell <Ian.Campbell@citrix.com>
Ben Pfaff [Fri, 16 Oct 2009 16:26:20 +0000 (09:26 -0700)]
ovs-vsctl: Log changes to configuration file to syslog.
This feature, which has been in ovs-cfg-mod for some time as the "-c"
option, makes it much easier to see what changes ovs-vsctl actually makes
to ovs-vswitchd.conf.
CC: <Ian.Campbell@citrix.com>
Ben Pfaff [Wed, 7 Oct 2009 17:19:31 +0000 (10:19 -0700)]
xenserver: Fix ovs-vsctl in built RPM by defining /etc as sysconfdir.
By default, the "configure" script picks a sysconfdir of $prefix/etc,
which works out to /usr/etc in our case. That's wrong, of course--it
should be /etc--but we didn't notice until now because sysconfdir was
only used in ovs-vsctl, which in turn wasn't used at all on a XenServer
system until recently.
This bug is present on all branches, but it is only potentially visible
on "master" and "xs5.7", since only those have ovs-vsctl. It is only
actually visible on "xs5.7", since that is the only branch where the
system uses ovs-vsctl itself (from /etc/xensource/scripts/vif), but this
is being committed to master in case we start using ovs-vsctl there too.
Reported-by: Henrik Amren <henrik@nicira.com>
Justin Pettit [Tue, 6 Oct 2009 18:38:57 +0000 (11:38 -0700)]
xenserver: Fix dbcache location for xen-bugtool
I forgot to add my local changes to xen-bugtool that reflected the new
location for dbcache.
Justin Pettit [Tue, 6 Oct 2009 18:08:31 +0000 (11:08 -0700)]
Merge commit 'origin/citrix'
Justin Pettit [Tue, 6 Oct 2009 00:32:36 +0000 (17:32 -0700)]
xenserver: Include dbcache in xen-bugtool output
It has been pointed out that it would be useful to have a copy of the
dbcache file in the bug report. This adds that.
Bug #2106
Jesse Gross [Mon, 5 Oct 2009 20:25:19 +0000 (13:25 -0700)]
netflow: Increase maximum number of NetFlow records to 30.
NetFlow v5 allows up to 30 records per packet but we were incorrectly
limiting to 29. This corrects that and also uses the count of the
number of records in the header rather than the packet size since
it is easier to reason about.
Bug #2103
Ben Pfaff [Mon, 5 Oct 2009 17:29:07 +0000 (10:29 -0700)]
Merge "citrix" branch into "master.
Jesse Gross [Sat, 3 Oct 2009 01:08:05 +0000 (18:08 -0700)]
bonding: Update the link status on the bond fake interface.
Brings the fake bond interface up and down to match our notion of
whether the bond is currently active. This solves an issue where
XenCenter would always show the bond as disconnected.
Bug #1703
Ian Campbell [Mon, 5 Oct 2009 15:32:53 +0000 (16:32 +0100)]
xenserver: use ovs-vsctl for VIF VLANs instead of separate state files
ovs-vsctl did not exist when this code was originally written, but it
provides exactly what is needed to get rid of those separate state
files.
The vif hotplug script diff is against the xs5.7 branch but I think is
applicable to master and/or citrix with just context changes.
I was thinking of using ovs-vsctl exclusively for configuration
modifications from the vif hotplug script but that would need a
mechanism to pass the additional vif details to ovs-vsctl add-port as
well as perhaps making the bridge optional to del-port. The other option
would be to use the --no-reload option and split the config mods into
two parts, but I don't like that idea much.
Ian Campbell [Mon, 5 Oct 2009 15:27:01 +0000 (16:27 +0100)]
xenserver: Include bridge.*.xs-network-uuids for all networks
Previously I advised that only networks which were currently attached to
the host be listed in /etc/ovs-vswitchd.conf. However I've just realised
that this interacts badly with the slightly ugly special case used for
PIF.currently-attached when reading from dbcache instead of talking to
Xapi. This bites on boot when /etc/init.d/management-interface tries to
plug a selection of PIFs which are deemed to be somehow required by
xapi. (not helped by a bug in XenServer 5.7.0 which can cause this list
to be larger than it should be and not internally consistent).
For now I think it prudent to simply list all networks which could
potentially be attached to a given datapath, until I can figure out what
the sane fix is on the XenServer end.
(I think there are two options for a proper fix, either inspect the
current state of the network devices or assume dbcache represents the
desired final state after devices are plugged on boot. I'm leaning
towards the later since the dbcache should indicate the set of PIFs
which were attached on shutdown, which xapi will likely be trying to
replug on boot... Needs more thought though).
Ben Pfaff [Fri, 2 Oct 2009 20:29:01 +0000 (13:29 -0700)]
vswitch: Allow user to set Ethernet address of any internal interface.
Until now the vswitch configuration file has allowed the user to configure
the MAC address on bridge local ports only. This commit adds the ability
to configure them on any internal interface.
It would be logical to extend this to any bridge port, period, but many
network devices must be brought down before their Ethernet addresses may be
changed. Bringing a network interface down and then back up can reset a
lot of state, so as we don't actually need the ability to change any bridge
port's MAC address yet this commit does not implement it.
CC: Ian Campbell <Ian.Campbell@citrix.com>
Ben Pfaff [Fri, 2 Oct 2009 17:41:05 +0000 (10:41 -0700)]
vswitch: Factor out detection of internal interfaces into a new function.
The following commit needs to use this same logic, so break it out into
a function to avoid redundancy.
Ben Pfaff [Fri, 2 Oct 2009 23:01:36 +0000 (16:01 -0700)]
secchan: Clarify logic in add_output_action().
The code and the logic here was too terse for anyone to reasonably
understand it. Add some comments.
This should not cause any behavioral change.
CC: Jean Tourrilhes <jt@hpl.hp.com>
Justin Pettit [Fri, 2 Oct 2009 23:59:28 +0000 (16:59 -0700)]
dpif-linux: Clarify bad device warning message
The message warning that the device number is wrong for the Open vSwitch
devices could have been clearer.
Thanks to Ben Pfaff for the suggested wording.
Justin Pettit [Fri, 2 Oct 2009 22:20:12 +0000 (15:20 -0700)]
dpif-linux: Fail earlier if OVS kernel module isn't loaded
When the kernel module isn't loaded, the bridge tries to open all the
possible minor devices, regardless. This change first checks that there
is a major device number for Open vSwitch and only then tries to open the
minor devices.
This change also removes the assumption that there's a default Open vSwitch
major device number, since the kernel module always attempts to get a
dynamic one. Maybe one day we'll have one...
Bug #1179
Ian Campbell [Fri, 2 Oct 2009 18:35:42 +0000 (11:35 -0700)]
xenserver: Rework interface-reconfigure.
Substantially reworks interface-reconfigure, with the following fixes:
* Create and use ifcfg files only for ipdev, use vswitch
configuration for topology setup.
* Take care over moving from bond to slave and back to tear down
any residual sibling devices
* Take care to leave datapath present when manipulating VLANs to
avoid interrupting traffic on the slave PIF as well as other
VLANs.
* Lots of minor stuff
Ian Campbell [Fri, 2 Oct 2009 13:43:20 +0000 (14:43 +0100)]
xenserver: Clear vlan.* from /etc/ovs-vswitchd.conf on boot too
Ian Campbell [Fri, 2 Oct 2009 18:08:34 +0000 (11:08 -0700)]
Correct whitespace in xenserver/etc_init.d_vswitch
Ben Pfaff [Thu, 1 Oct 2009 20:27:47 +0000 (13:27 -0700)]
netdev-linux: Improve netdev_linux_set_etheraddr().
Fixes a bug whereby netdev_linux_set_etheraddr() would update the cached
Ethernet address but not mark it valid. (This potentially wasted a system
call later but wasn't harmful.)
As an added optimization, don't set the Ethernet address at all if the
new address is the same as the current address.
Jesse Gross [Fri, 2 Oct 2009 17:31:20 +0000 (10:31 -0700)]
netdev-linux: Return correct error codes on receive.
netdev_linux_receive was returning positive error codes while the
interface specifies that it should be returning negative errors.
This difference causes a huge increase in (non-existant) packet
processing with the userspace datapath.
Ben Pfaff [Thu, 1 Oct 2009 16:52:27 +0000 (09:52 -0700)]
xenserver: Clear stale configuration keys on boot, but not on later starts
Ian Campbell [Wed, 30 Sep 2009 10:57:23 +0000 (11:57 +0100)]
xenserver: Clear stale configuration keys on boot
Ben Pfaff [Thu, 1 Oct 2009 16:52:27 +0000 (09:52 -0700)]
xenserver: Clear stale configuration keys on boot, but not on later starts
Ian Campbell [Wed, 30 Sep 2009 10:57:23 +0000 (11:57 +0100)]
xenserver: Clear stale configuration keys on boot
Jesse Gross [Tue, 4 Aug 2009 00:04:43 +0000 (17:04 -0700)]
netdev: Add classes which don't require initialization.
If a class requires does not require initialization, still add it
to the list of netdev classes.
Jesse Gross [Mon, 3 Aug 2009 23:11:43 +0000 (16:11 -0700)]
netdev-linux: Fix tap device using wrong FD.
Tap devices were doing ioctls on the AF_INET socket, instead of the
FD opened on the tap device.
Jesse Gross [Mon, 3 Aug 2009 22:19:39 +0000 (15:19 -0700)]
netdev: Fix memory leak in netdev_open.
The name of the netdev is copied but is never freed.
Jesse Gross [Fri, 31 Jul 2009 22:43:08 +0000 (15:43 -0700)]
netdev: Fix typo in netdev provider enumerate.
Ben Pfaff [Wed, 30 Sep 2009 19:24:46 +0000 (12:24 -0700)]
xenserver: In xsconsole plugin, log via XSConsoleLog module.
Part of a patch from Ian Campbell <ian.campbell@citrix.com>.
Ian Campbell [Wed, 30 Sep 2009 10:57:21 +0000 (11:57 +0100)]
Drop separate vswitch-cfg-update.log.
xapi will log any error returned by the plugin.
Jesse Gross [Tue, 29 Sep 2009 18:02:04 +0000 (11:02 -0700)]
Document issues with RSPAN and MAC learning.
Bug #2118
Ben Pfaff [Wed, 23 Sep 2009 19:39:58 +0000 (12:39 -0700)]
Document per-port round-robin during controller rate limiting.
CC: Peter Balland <peter@nicira.com>
Bug #2072.
Ben Pfaff [Mon, 28 Sep 2009 17:15:22 +0000 (10:15 -0700)]
debian: Make dependencies on openvswitch packages specify exact version.
NOX packages depend on a particular version of openvswitch-pki, which
depends on openvswitch-common without specifying a version. This meant
that the installed versions of openvswitch-pki and openvswitch-common
could easily get out of sync. This commit makes all of the dependencies
among openvswitch packages specify an explicit version, which should fix
this problem.
CC: Dan Wendlandt <dan@nicira.com>
Ben Pfaff [Wed, 23 Sep 2009 22:33:00 +0000 (15:33 -0700)]
shash: Fix memory leak in shash_destroy().
hmap_destroy() has to be called so that sh->map.buckets gets freed.
Ben Pfaff [Tue, 22 Sep 2009 17:17:44 +0000 (10:17 -0700)]
Merge citrix branch into master.
Ben Pfaff [Mon, 21 Sep 2009 22:34:27 +0000 (15:34 -0700)]
brcompatd: Delete VLAN tags only for the correct port in del_port().
vlan.%s.* will match e.g. eth0.123 if the %s expands to eth0. We only
want it to match eth0 in that case.
This is based on code inspection. It may or may not fix a real problem.
Justin Pettit [Mon, 21 Sep 2009 20:08:27 +0000 (13:08 -0700)]
Get ready to tag 0.90.5 release.
Justin Pettit [Mon, 21 Sep 2009 20:08:12 +0000 (13:08 -0700)]
Add ChangeLog to track changes
Ben Pfaff [Mon, 21 Sep 2009 23:56:37 +0000 (16:56 -0700)]
fatal-signal: Add clarifying comments.
Suggested by Justin Pettit.
Ben Pfaff [Mon, 21 Sep 2009 20:07:10 +0000 (13:07 -0700)]
vconn-unix: Unlink Unix sockets for vconns at close and free memory.
The make_unix_socket() function that Unix vconns use to create their
bindings calls fatal_signal_add_file_to_unlink() to make sure that the
binding socket gets unlinked from the file system if the process is killed
by a fatal signal. However, this doesn't happen until the process is
actually killed, even if the vconn that owns the socket is actually closed.
This wasn't a problem when the vconn-unix code was written, because all
of the unix vconns were created at process start time and never destroyed
during the normal process runtime. However, these days the vswitch can
create and destroy unix vconns at runtime depending on the contents of its
configuration file, so it's better to clean up the file system and free
the memory required to keep track of these sockets.
This commit makes unix vconns and pvconns delete their files and free
the memory used to track them when the (p)vconns are closed.
This is only a very minor leak most of the time.
Bug #1817.
Ben Pfaff [Mon, 21 Sep 2009 19:37:20 +0000 (12:37 -0700)]
fatal-signal: New function fatal_signal_unlink_file_now().
This is a helper function that combines two actions that callers commonly
wanted. It will have an additional user in an upcoming commit.
Ben Pfaff [Mon, 21 Sep 2009 19:38:58 +0000 (12:38 -0700)]
fatal-signal: Clean up code by using shash.
This simplifies the code here and should speed it up, too, when there are
lots of files to unlink on a fatal signal.
Ben Pfaff [Mon, 21 Sep 2009 19:33:30 +0000 (12:33 -0700)]
vconn: Remove unused "reconnectable" member from vconn.
This member is initialized, but nothing ever reads it, so get rid of it.
Ben Pfaff [Mon, 21 Sep 2009 20:06:47 +0000 (13:06 -0700)]
vswitchd: Fix memory leak in bridge_reconfigure().
Bug #1817.
Ben Pfaff [Mon, 21 Sep 2009 23:10:42 +0000 (16:10 -0700)]
netdev: Fix memory leak in get_stats_via_netlink().
Bug #1817.
Justin Pettit [Tue, 15 Sep 2009 09:08:08 +0000 (02:08 -0700)]
vswitch: More accurately identify slave status for compatibility
Ben Pfaff dug through the kernel sources and reported that
bond_miimon_inspect() supports four BOND_LINK_* states:
* BOND_LINK_UP: carrier detected, updelay has passed.
* BOND_LINK_FAIL: carrier lost, downdelay in progress.
* BOND_LINK_DOWN: carrier lost, downdelay has passed.
* BOND_LINK_BACK: carrier detected, updelay in progress.
And that bond_info_show_slave() only considers BOND_LINK_UP to be "up"
and anything else to be "down".
Thanks for doing this and suggesting a fix, Ben!
Ben Pfaff [Thu, 17 Sep 2009 22:12:34 +0000 (15:12 -0700)]
util: Add comments.
Ben Pfaff [Thu, 17 Sep 2009 21:46:18 +0000 (14:46 -0700)]
vswitchd: Fix unimportant memory leak.
Free dpif_names when we're done with it.
This memory leak is not a big deal since bridge_init() is only ever called
once in a given ovs-vswitchd execution.
Ben Pfaff [Thu, 17 Sep 2009 21:45:18 +0000 (14:45 -0700)]
bitmap: Don't allocate excessive memory.
ROUND_UP rounds up to a multiple of a given value. That means that
bitmap_allocate() was allocating one byte for each bit in the bitmap,
which is clearly excessive.
Instead, just allocate one bit for every bit in the bitmap.
Justin Pettit [Tue, 8 Sep 2009 03:50:06 +0000 (20:50 -0700)]
in-band: Document logic behind in-band's design.
There have been numerous attempts at getting in-band correct. If
history is at all an example, it probably still isn't. However, this is
an attempt to document its current design, so that we can understand
what our current thinking is.
Justin Pettit [Tue, 8 Sep 2009 03:44:25 +0000 (20:44 -0700)]
Add ChangeLog to track changes
Justin Pettit [Wed, 16 Sep 2009 14:45:49 +0000 (07:45 -0700)]
ovs-appctl: Correct "target" option synopsis in man page
The synopsis section of the man page for ovs-appctl incorrectly stated
that the target option takes "pid" as an argument. This commit corrects
that to say "socket".
Ian Campbell [Thu, 17 Sep 2009 18:32:54 +0000 (11:32 -0700)]
xenserver: Synchronize interface-reconfigure from Citrix.
* Drop "--test-mode" option -- it was never wired up to anything.
* Add some additional checks for valid parameter combinations
* Raise some errors for unimplemented (but not currently used in
XenServer) options.
Ben Pfaff [Thu, 17 Sep 2009 16:32:21 +0000 (09:32 -0700)]
ovs-vswitchd: Define missing .IQ macro in manpage.
This manpage was using a nonstandard macro that it did not define. Fix
the problem by adding the definition.
Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Ian Campbell [Thu, 17 Sep 2009 12:37:25 +0000 (13:37 +0100)]
vswitchd: implement bond/hash unixctl
Our test case automation has a requirement to know which hash value a
given MAC address hashes to, in order to validate that balancing is
happening as expect etc.. Rather than attempt to reimplement the hash
algorithm used by vswitchd in python instead expose an appctl which
returns this information.
Ben Pfaff [Thu, 17 Sep 2009 16:26:55 +0000 (09:26 -0700)]
xenserver: Remove vswitch dbcache file during RPM uninstall.
It's good to clean up.
Ported from "citrix" to "master" branch with file name updated.
CC: Keith Amidon <keith@nicira.com>
CC: Henrik Amren <henrik@nicira.com>
Ben Pfaff [Tue, 15 Sep 2009 17:07:23 +0000 (10:07 -0700)]
xenserver: Drop "init-dbcache" by making PIF optional for "rewrite".
Commit
ac9634f0af "xenserver: Make RPM install work again" introduced a
new command "init-dbcache" for the interface-reconfigure script. However
it is cleaner to simply make the PIF argument to the "rewrite" command
optional.
CC: Ian Campbell <Ian.Campbell@citrix.com>
Ben Pfaff [Wed, 16 Sep 2009 23:03:55 +0000 (16:03 -0700)]
xenserver: Remove vswitch dbcache file during RPM uninstall.
It's good to clean up.
CC: Keith Amidon <keith@nicira.com>
CC: Henrik Amren <henrik@nicira.com>
Ben Pfaff [Wed, 16 Sep 2009 22:12:19 +0000 (15:12 -0700)]
secchan: Better tolerate failing controller admission control in fail-open.
When the switch is configured to connect to a controller that accepts
connections, waits a few seconds, and then disconnects without setting up
flows, currently this causes "fail-open" to flush the flow table and
stop setting up new flows during the connection duration. This is OK if
it happens once, but it can easily happen every 8 seconds with typical
backoff settings, and that isn't so great.
This commit changes fail-open to only flush the flow table once the switch
appears to have been admitted by the controller, which prevents these
frequent network interruptions.
Thanks to Jesse Gross for especially valuable feedback.
QA notes: Behavior in fail-open and especially behavior with a controller
that rejects the switch after it connects needs to be re-tested. The
ovs-controller --mute switch added by this commit is one simple way to
create such a controller.
CC: Peter Balland <peter@nicira.com>
Bug #1695. Bug #2055.
Ben Pfaff [Tue, 15 Sep 2009 22:23:45 +0000 (15:23 -0700)]
Factor out code for composing OFPT_PACKET_IN messages.
Currently only ofproto.c ever composes OFPT_PACKET_IN messages, but some
upcoming code wants to do the same thing, so factor this out into a new
function to avoid code duplication.
Ben Pfaff [Tue, 15 Sep 2009 22:22:17 +0000 (15:22 -0700)]
Factor out code for composing benign packets.
The bonding code in vswitch sends out gratuitous learning packets that
are supposed to teach switches but not cause anything else to happen on
the network. Some upcoming code wants to synthesize packets with similar
properties, so factor this code into a new function so that it can be
used in both places.
Ben Pfaff [Wed, 16 Sep 2009 21:09:29 +0000 (14:09 -0700)]
ovs-pki: Extend validity of generated CA certificates from 3 to 6 years.
Dan requested this change to make it less likely that a user encounter a
CA certificate expiring.
For the "citrix" branch instead of "master" in case a customer upgrades
(without generating new CA certificates) away from the beta.
CC: Dan Wendlandt <dan@nicira.com>
Jesse Gross [Wed, 16 Sep 2009 18:03:42 +0000 (11:03 -0700)]
netdev-linux: Set missing cache validity bit.
Whether a port is internal is cached to avoid requerying the kernel
every time stats are requested. However, the cache vality bit was
never being set so the cache wasn't used. This corrects that
oversight.
Thanks to Ben Pfaff for noticing.
Ian Campbell [Wed, 16 Sep 2009 14:56:00 +0000 (15:56 +0100)]
create/remove /var/lock/subsys/vswitch on initscript start/stop
A lock file in /var/lock/subsys must be created with the same name as
the initscript in order for the stop action to be automatically called
on runlevel change. This is true at least on Red Hat derived systems
such as XenServer where /etc/rcS contains:
# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do
check_runlevel "$i" || continue
# Check if the subsystem is already up.
subsys=${i#/etc/rc$runlevel.d/K??}
[ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ] \
|| continue
...
(This could potentially expose bugs e.g. in the stop priority for the
script since I think it is likely that the stop action hasn't been
running to now. I haven't closely considered this case yet but vswitch
is currently scheduled at K91vswitch vs K90network which seems correct
at first glance)
Ben Pfaff [Fri, 11 Sep 2009 22:49:37 +0000 (15:49 -0700)]
datapath: Fix mutual exclusion with bridge on Linux 2.6.27+.
Linux 2.6.27 introduces a new mechanism for sharing STP packets among
kernel modules, which means that the code in datapath.c to avoid loading
when the Linux bridging module is also loaded has false positives. So
fall back on these newer kernels to a less reliable way of avoiding the
bridge module, but one that does not have false positives.
CC: Jean Tourrihles <jt@hpl.hp.com>
Ben Pfaff [Tue, 15 Sep 2009 21:21:00 +0000 (14:21 -0700)]
xenserver: Fix detection of xs-network-uuids in interface-reconfigure.
Commit
c798b21c6a "xenserver: Only consider the host we are running on in
interface-reconfigure" dropped the get_pifs_by_record function in favor
of get_pifs_by_device, but didn't adapt callers properly, so that the
XenServer network PIFs weren't properly found and thus the xs-network-uuids
keys weren't set correctly.
This fixes the caller.
Bug #2043.
Ian Campbell [Tue, 15 Sep 2009 16:24:46 +0000 (09:24 -0700)]
ovs-vsctl: /var/run/ovs-vswitchd.*.ctl is a Unix domain socket
Currently ov-vsctl tries to treat /var/run/ovs-vswitchd.*.ctl as a
file/pipe when it is actually a Unix domain socket:
# ovs-vsctl add-br TEST
Traceback (most recent call last):
File "/usr/bin/ovs-vsctl", line 498, in ?
main()
File "/usr/bin/ovs-vsctl", line 493, in main
function(*args)
File "/usr/bin/ovs-vsctl", line 345, in cmd_add_br
cfg_save(cfg, VSWITCHD_CONF)
File "/usr/bin/ovs-vsctl", line 142, in cfg_save
cfg_reload()
File "/usr/bin/ovs-vsctl", line 126, in cfg_reload
f = open(target, "r+")
IOError: [Errno 6] No such device or address: ' '
# ls -l /var/run/ovs-vswitchd.4173.ctl
srw------- 1 root root 0 Sep 14 12:25 /var/run/ovs-vswitchd.4173.ctl
From strace:
open("/var/run/ovs-vswitchd.4173.ctl", O_RDWR|O_LARGEFILE) = -1 ENXIO (No such device or address)
Ben Pfaff [Mon, 14 Sep 2009 18:28:57 +0000 (11:28 -0700)]
ovs-vsctl: Add test suite, documentation for br-to-vlan, br-to-parent.
CC: Ian Campbell <Ian.Campbell@citrix.com>
Jesse Gross [Mon, 14 Sep 2009 21:12:23 +0000 (14:12 -0700)]
netdev: Swap transmit and receive stats on internal ports.
Internal ports appear to have their transmit and receive stats swapped
because from the kernel's point of view these ports are acting like
the machine connected to the switch, not the switch itself. This swaps
the stats for consistency with other ports.
Ben Pfaff [Mon, 14 Sep 2009 20:37:00 +0000 (13:37 -0700)]
secchan: Fix bad pointer dereference sending flow expirations.
Ben Pfaff [Mon, 14 Sep 2009 16:20:58 +0000 (09:20 -0700)]
datapath: Fix WARN_ON sending GSO packets to userspace in Linux 2.6.22+.
Until now, when dp_output_control() queued a GSO packet to userspace, it
would first compute the checksum for the whole GSO packet, then break the
packet into segments. However this had two drawbacks:
1. The checksum had to be recomputed for each segment, wasting time.
2. Linux 2.6.22 and later would emit a warning in skb_gso_segment()
because the checksum was precomputed.
This commit changes dp_output_control() to instead break the packet into
segments, then compute the checksum across each of the segments
individually. This fixes both drawbacks.
This commit has seen light testing on Xen's 2.6.27. It has been build
tested on a few different kernel versions.
Ben Pfaff [Fri, 11 Sep 2009 17:51:36 +0000 (10:51 -0700)]
datapath: Fix comments.
Ian Campbell [Mon, 14 Sep 2009 18:27:39 +0000 (11:27 -0700)]
ovs-vsctl: additional commands for querying VLAN fake bridges.
Our test automation needs to be able to validate that a VLAN bridge and
for this I needed two new operations in ovs-vsctl:
* The ability to query the VLAN tag for a bridge.
* The ability to query the 'parent' of a bridge. The parent is the
non-VLAN/untagged bridge with the same physical devices and
could be a bond.
So given xenbr0 (containing eth0) + xapi2 (VLAN 42 on eth0) and xapi1
(containing bond0 == eth2+eth3) + xapi3 (VLAN 23 on the bonded
interface):
[root@warlock ~]# ovs-vsctl br-to-vlan xapi2
42
[root@warlock ~]# ovs-vsctl br-to-vlan xapi3
23
[root@warlock ~]# ovs-vsctl br-to-parent xapi2
xenbr0
[root@warlock ~]# ovs-vsctl br-to-parent xapi3
xapi1
Ben Pfaff [Mon, 14 Sep 2009 17:05:13 +0000 (10:05 -0700)]
New utility ovs-vsctl.
Justin Pettit [Mon, 14 Sep 2009 11:07:53 +0000 (04:07 -0700)]
vswitch: Correctly identify slave status in /proc compatibility layer
In the /proc compatibility layer, the bond member was reported as up
immediately after link recovery, regardless of the updelay. I believe
the compatibility code was correct if the check had been done with carrier,
but since 'iface->enabled' already does that calculation, we can use it
directly.
Additinally, when a bond slave was enabled or disabled, the bond
compatibility code was not being told to update its state. This commit
makes that call.
NIC-39
Ben Pfaff [Fri, 11 Sep 2009 21:40:02 +0000 (14:40 -0700)]
Raise MAC learning table capacity from 1,024 to 2,048 entries per bridge.
Given a possible 1,024 ports on a bridge the previous limit of 2,048
entries seems low.
If we want to increase this further we should introduce dynamic allocation
of table entries to avoid wasting memory in the common case.
CC: Keith Amidon <keith@nicira.com>
Ben Pfaff [Fri, 11 Sep 2009 21:32:50 +0000 (14:32 -0700)]
datapath: Raise maximum ports per datapath from 256 to 1024.
This makes the datapath port limit the same as the Linux bridge module
port limit.
CC: Keith Amidon <keith@nicira.com>
Justin Pettit [Sat, 12 Sep 2009 23:40:03 +0000 (16:40 -0700)]
xenserver: Have xen-bugtool collect OVS logs
The original xen-bugtool did not collect any OVS logs. Now that more
logging is moving from /var/log/messages to ovs-vswitchd's and
ovs-brcompatd's private log files, we should include them in the
information collected for bug reports.
Justin Pettit [Sat, 12 Sep 2009 07:49:30 +0000 (00:49 -0700)]
Merge commit 'origin/citrix'
Conflicts:
vswitchd/ovs-vswitchd.8.in
vswitchd/ovs-vswitchd.conf.5.in
xenserver/etc_init.d_vswitch
Justin Pettit [Sat, 12 Sep 2009 01:40:38 +0000 (18:40 -0700)]
Merge commit 'origin/ctrix' into k
Justin Pettit [Fri, 11 Sep 2009 15:15:49 +0000 (08:15 -0700)]
xenserver: Have ovs-brcompatd's log file rotated
Suggested by Ian Campbell.
Jean Tourrihles [Fri, 11 Sep 2009 22:19:15 +0000 (15:19 -0700)]
vconn: Fix byte-swapping of message type when validating OpenFlow actions.
It seems really strange that this one slipped through. Perhaps this
means that we have never tested with any action other than OFPAT_OUTPUT
(which has value 0 and thus is not affected by byte-swapping).
Ben Pfaff [Thu, 27 Aug 2009 21:45:36 +0000 (14:45 -0700)]
xenserver: Install kernel modules in proper system locations.
This gets rid of the last files in /root/vswitch. With this change, the
Open vSwitch RPMs should now comply with FHS (http://www.pathname.com/fhs/).
Ben Pfaff [Fri, 11 Sep 2009 22:13:08 +0000 (15:13 -0700)]
xenserver: Install into /usr instead of /root/vswitch.
/usr is the standard location for installation, so use that instead of our
nonstandard location under /root.
This migrates everything except the kernel modules to /usr. The kernel
modules will be migrated in an upcoming commit.
One possibly surprising change is that the manpages listed in the %files
section of vswitch-xen.spec not only moved but added .gz extensions. This
seems to be because RPM automatically compresses manpages, but only if they
are installed in a standard system location.
Ben Pfaff [Fri, 11 Sep 2009 21:41:39 +0000 (14:41 -0700)]
xenserver: Make RPM install work again.
The RPM install was generating a database cache in Python pickle format in
/etc/ovs-vswitchd.conf, but interface-reconfigure was looking for it in
XML format in /var/lib/openvswitch/dbcache. This fixes the problem, by
adding an init-dbcache command to interface-reconfigure and then using that
at RPM install time.
This moves the database cache creation from %pre to %post. This is
necessary so that interface-reconfigure is available from the install
script.
Ben Pfaff [Fri, 11 Sep 2009 21:03:00 +0000 (14:03 -0700)]
xenserver: Remove dead store from interface-reconfigure.
No point in looking up pifrec if we're not going to use it.
Ben Pfaff [Fri, 11 Sep 2009 21:02:17 +0000 (14:02 -0700)]
xenserver: Remove unmaintained comments in interface-reconfigure.
I added these comments a long time ago and have not kept them up-to-date,
so it is probably better to delete them than to confuse people.
Ben Pfaff [Fri, 11 Sep 2009 20:13:37 +0000 (13:13 -0700)]
xenserver: Fix syntax error in vswitch-xen.spec %pre fragment.
Justin Pettit [Fri, 11 Sep 2009 17:52:40 +0000 (10:52 -0700)]
xenserver: Set default file log level and fix brcompatd file
Set the default log level for file logging to INFO for ovs-vswitchd and
ovs-brcompatd. This is done so that coverage messages are kept in the
log file, since we no longer log them through syslog due its synchronous
writing on Xen hosts. The issue is described in detail in commit
6bc995e.
Fix test for whether file logging should be enabled for ovs-brcompatd.
Reported by Ian Campbell.
Justin Pettit [Fri, 11 Sep 2009 14:15:24 +0000 (07:15 -0700)]
logging: Lower logging level for coverage messages due to slow poll loops
By default, many OVS processes keep track of their time through a poll
loop. If it takes an unusually long time (measured as some distance
from the mean), the processes will log stats it has been keeping about
coverage. It was doing this at level WARN.
On Xen systems, syslog messages written at level INFO and higher are
written to /var/log/messages synchronously. This would mean that there
would be dire messages that it took a few dozen milliseconds to go
through the loop, meanwhile, it would take up to 6(!) seconds writing
those. Meanwhile, the process would do no other processing, which could
be quite serious in the case of a process such as ovs-vswitchd.
This problem was somewhat masked because the time used by this logging
was not used in the calculations for determining how long it was taking
to get through the loop.
This commit lowers the default log level for those coverage messages to
INFO. On Xen systems, it raises the default level at which messages are
written to syslog to WARN.
Diagnosed and fixed with the help of Ian Campbell.
Ben Pfaff [Wed, 9 Sep 2009 18:16:55 +0000 (11:16 -0700)]
Document ovs-vswitchd's ovs-appctl commands and some ovs-vswitchd internals.
CC: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Wed, 9 Sep 2009 17:52:26 +0000 (10:52 -0700)]
Increase the default priority of vswitchd and brcompatd
Our hope is that this will resolve many of the issues we have seen
where temporary delays in the forwarding of packets have caused issues
of various types.
This is a crossport from master of commit
44cb492 by Ian Campbell.
Ben Pfaff [Wed, 9 Sep 2009 17:50:32 +0000 (10:50 -0700)]
Revert "xenserver: Renice netback process to priority 0 by default."
This reverts commit
641a0a4ed0a79d53a52d4e78ce1d90140a768798.
This is a crossport from master of commit
b2cdfea by Ian Campbell, with
the following commit message:
Do not renice the netback thread.
We should increase the vswitchd daemon's priority instead.
Ian Campbell [Wed, 9 Sep 2009 17:08:59 +0000 (18:08 +0100)]
Increase the default priority of vswitchd and brcompatd
Our hope is that this will resolve many of the issues we have seen
where temporary delays in the forwarding of packets have caused issues
of various types.
Ian Campbell [Wed, 9 Sep 2009 17:08:58 +0000 (18:08 +0100)]
Do not renice the netback thread.
We should increase the vswitchd daemon's priority instead.
Reverts
641a0a4ed
Ian Campbell [Wed, 9 Sep 2009 17:09:02 +0000 (18:09 +0100)]
Only write Network.PIF elements for this host to dbcache.