sliver-openvswitch.git
12 years agodebian: Bump standards-version to 3.9.3.
Thomas Goirand [Fri, 9 Mar 2012 21:53:12 +0000 (13:53 -0800)]
debian: Bump standards-version to 3.9.3.

No other changes necessary.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Remove some useless files from the dkms pacakge.
Thomas Goirand [Fri, 9 Mar 2012 21:49:36 +0000 (13:49 -0800)]
debian: Remove some useless files from the dkms pacakge.

This commit removes useless files from the dkms package that caused
lintian warnings.

(Many of the other files in the dkms package are also useless but do not
cause lintian warnings so they are less important.)

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Clean .pyc files in "clean" target.
Thomas Goirand [Fri, 9 Mar 2012 21:46:18 +0000 (13:46 -0800)]
debian: Clean .pyc files in "clean" target.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Remove po-debconf build dependency.
Thomas Goirand [Fri, 9 Mar 2012 21:45:02 +0000 (13:45 -0800)]
debian: Remove po-debconf build dependency.

Open vSwitch no longer uses Debconf at all, for some time now.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Build-depend on python-all to pull in all Python versions.
Thomas Goirand [Fri, 9 Mar 2012 21:44:10 +0000 (13:44 -0800)]
debian: Build-depend on python-all to pull in all Python versions.

Open vSwitch should support all Python versions in the distribution.  This
is the way to do it.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Add missing ${python:Depends} to openvswitch-test package.
Thomas Goirand [Fri, 9 Mar 2012 21:41:59 +0000 (13:41 -0800)]
debian: Add missing ${python:Depends} to openvswitch-test package.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Improve long descriptions so as to better describe the packages.
Thomas Goirand [Fri, 9 Mar 2012 21:39:59 +0000 (13:39 -0800)]
debian: Improve long descriptions so as to better describe the packages.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Bump debhelper compat level to 8 and make build-depends consistent.
Thomas Goirand [Fri, 9 Mar 2012 21:30:26 +0000 (13:30 -0800)]
debian: Bump debhelper compat level to 8 and make build-depends consistent.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agonetlink-socket: Increase Netlink socket receive buffer size.
Ben Pfaff [Fri, 16 Mar 2012 04:15:38 +0000 (21:15 -0700)]
netlink-socket: Increase Netlink socket receive buffer size.

Open vSwitch userspace can set up flows at a high rate, but it is somewhat
"bursty" in opportunities to set up flows, by which I mean that OVS sets up
a batch of flows, then goes off and does some other work for a while, then
sets up another batch of flows, and so on.  The result is that, if a large
number of packets that need flow setups come in all at once, then some of
them can overflow the relatively small kernel-to-user buffers.

This commit increases the kernel-to-user buffers from the default of
approximately 120 kB each to 1 MB each.  In one somewhat synthetic test
case that I ran based on an "hping3" that generated a load of about 20,000
new flows per second (including both requests and replies), this reduced
the packets dropped at the kernel-to-user interface from about 30% to none.
I expect that it will similarly improve packet loss in workloads where
flow arrival is not easily predictable.

(This has little effect on workloads generated by "ovs-benchmark rate"
because that benchmark is effectively "self-clocking", that is, a new flow
is triggered only by a reply to a request made earlier, which means that
the number of buffered packets at any given has a known, constant upper
limit.)

Bug #10210.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agotests: Skip "strings at least 2 characters long" test for narrow Python.
Ben Pfaff [Mon, 12 Mar 2012 21:46:56 +0000 (14:46 -0700)]
tests: Skip "strings at least 2 characters long" test for narrow Python.

Narrow Python can't handle Unicode characters outside the BMP, so skip the
test.

Reported-by: Michael Shigorin <mike@osdn.org.ua>
Tested-by: Michael Shigorin <mike@osdn.org.ua>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Fix code that keeps track of MTU.
Ben Pfaff [Mon, 12 Mar 2012 19:59:47 +0000 (12:59 -0700)]
ofproto: Fix code that keeps track of MTU.

ofport_install() should set the MTU that it finds into the ofport
before calling set_internal_devs_mtu(), because the latter function might
change the MTU and update ofport->mtu and the caller should not incorrectly
overwrite its changes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-monitor-ipsec: Detect correctly IPSEC configuration changes
Ansis Atteka [Fri, 9 Mar 2012 02:58:09 +0000 (18:58 -0800)]
ovs-monitor-ipsec: Detect correctly IPSEC configuration changes

If Open vSwitch has IPSEC tunnel (with certificates) and Interface
table was updated, then ovs-monitor-ipsec daemon would incorrectly
remove and readd all existing IPSEC tunnels.

The root cause for this issue was that "peer_cert_file" key was present in
interfaces dictionary, but it was missing in new_interfaces dictionary.

v2: Do not fail buildtests

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Reported-by: Niklas Andersson <nandersson@nicira.com>
12 years agoRevert "ovs-monitor-ipsec: Detect correctly IPSEC configuration changes"
Ansis Atteka [Fri, 9 Mar 2012 02:41:57 +0000 (18:41 -0800)]
Revert "ovs-monitor-ipsec: Detect correctly IPSEC configuration changes"

This reverts commit 5e2a9988bb7853cad67a36e869d532d9d2f4533a.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
12 years agoovs-monitor-ipsec: Detect correctly IPSEC configuration changes
Ansis Atteka [Fri, 9 Mar 2012 00:19:59 +0000 (16:19 -0800)]
ovs-monitor-ipsec: Detect correctly IPSEC configuration changes

If Open vSwitch has IPSEC tunnel (with certificates) and Interface
table was updated, then ovs-monitor-ipsec daemon would incorrectly
remove and readd all existing IPSEC tunnels.

The root cause for this issue was that "peer_cert_file" key was present in
interfaces dictionary, but it was missing in new_interfaces dictionary.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Reported-by: Niklas Andersson <nandersson@nicira.com>
12 years agobond: Incorrectly reported an error in appctl.
Ethan Jackson [Tue, 21 Feb 2012 05:57:20 +0000 (21:57 -0800)]
bond: Incorrectly reported an error in appctl.

The bond/enable-slave and bond/disable-slave ovs-appctl commands
incorrectly reported the 501 error code upon success.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoovs-xapi-sync: Rerun processing when a db update arrives during a commit.
Ben Pfaff [Thu, 8 Mar 2012 18:49:47 +0000 (10:49 -0800)]
ovs-xapi-sync: Rerun processing when a db update arrives during a commit.

The logic in ovs-xapi-sync didn't handle the case where ovsdb-server sends
a database update before it replies to a transaction that ovs-xapi-sync
sent, like this:

ovs-xapi-sync              ovsdb-server
-------------              ------------

                      .
                      .
                      .
transaction request  --->
                     <---  database contents update
                     <---  transaction reply
                      .
                      .
                      .

The update was not lost but ovs-xapi-sync would not process it until the
database changed again.

Bug #10082.
Reported-by: Krishna Miriyala <krishna@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agosocket-util: Unlink Unix domain sockets that bind but fail to connect.
Ben Pfaff [Mon, 27 Feb 2012 18:58:45 +0000 (10:58 -0800)]
socket-util: Unlink Unix domain sockets that bind but fail to connect.

The error handling path here failed to clean up bound sockets, by removing
them.  This fixes the problem.

It was easy to observe this bug by running "ovs-vsctl" without
"ovsdb-server" running.

Bug #9811.
Bug #9769.
Reported-by: Michael <mhu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agovswitchd: Document behavior of 802.1p priorities with VLAN splinters.
Ben Pfaff [Mon, 5 Mar 2012 17:52:36 +0000 (09:52 -0800)]
vswitchd: Document behavior of 802.1p priorities with VLAN splinters.

Reported-by: likunyun <kunyunli@hotmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agobridge: Remove unwanted ports at time of ofproto creation.
Ben Pfaff [Fri, 2 Mar 2012 21:26:35 +0000 (13:26 -0800)]
bridge: Remove unwanted ports at time of ofproto creation.

The reconfiguration code only deleted unwanted ports for bridges that had
been created in previous (re)configurations.  In fact, we should run this
step even for bridges that are newly added, e.g. to delete ports that
were added by a previous run of ovs-vswitchd and deleted from the database
between runs.

Before this commit, the following left "int" in datapath br0.  After this
commit, "int" is properly deleted:

1. With ovs-vswitchd running:
      # ovs-vsctl add-br br0
      # ovs-vsctl add-port br0 int -- set interface int type=internal
2. Kill ovs-vswitchd, then:
      # ovs-vsctl --no-wait -- del-port br0 int
3. Restart ovs-vswitchd.

Bug #9957.
Reported-by: Hiroshi Tanaka <htanaka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agonetdev: Fix typo in error message.
Ben Pfaff [Fri, 2 Mar 2012 22:18:21 +0000 (14:18 -0800)]
netdev: Fix typo in error message.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoINSTALL.Linux: minor typo
Chris Wright [Fri, 2 Mar 2012 05:14:56 +0000 (21:14 -0800)]
INSTALL.Linux: minor typo

s/ovsdmonitor/ovsdbmonitor/

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agotests: Prefer development Python files over installed ones.
Ethan Jackson [Fri, 2 Mar 2012 00:21:55 +0000 (16:21 -0800)]
tests: Prefer development Python files over installed ones.

A developer may have Open vSwitch installed, in which case many of
the Python files which are tested will be in both the development
tree and the system Python library.  When running unit tests, we
want to test the development tree, so it's better to prefer
importing those files.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoxenserver: Restart ovs-xapi-sync on kmod reload.
Ethan Jackson [Thu, 1 Mar 2012 02:54:05 +0000 (18:54 -0800)]
xenserver: Restart ovs-xapi-sync on kmod reload.

Some users never restart OVS, they just reload the kernel module on
each new version. Since ovs-xapi-sync is a daemon, a restart is
required to use the new code.  Therefore, without this patch, users
could unwittingly use stale versions of ovs-xapi-sync.

Bug #9919.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diagnosed-by: Ben Pfaff <blp@nicira.com>
12 years agoxenserver: Always update the bridge ID in ovs-xapi-sync.
Ethan Jackson [Thu, 1 Mar 2012 02:41:58 +0000 (18:41 -0800)]
xenserver: Always update the bridge ID in ovs-xapi-sync.

In some cases we were seeing this column get stale.

Bug #9929.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diagnosed-by: Justin Pettit <jpettit@nicira.com>
12 years agodebian: Fix exit status of openvswitch-switch init script "status" command.
Ben Pfaff [Wed, 29 Feb 2012 00:31:45 +0000 (16:31 -0800)]
debian: Fix exit status of openvswitch-switch init script "status" command.

The init script ends with an explicit "exit 0" so nonzero exit codes from
"ovs-ctl status" were being lost.

Bug #9714.
Reported-by: Paul Ingram <paul@nicira.com>
CC: Sujatha Shetty <sshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodpif-linux: Make dpif_linux_port_query_by_name() query only one datapath.
Ben Pfaff [Tue, 28 Feb 2012 02:42:17 +0000 (18:42 -0800)]
dpif-linux: Make dpif_linux_port_query_by_name() query only one datapath.

The kernel will report a vport with the given name in any datapath, but
userspace only wants a vport with the given name in a specific datapath.
Receiving information on a vport in an unexpected datapath yields bizarre
and hard-to-debug problems.

Bug #9889.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto-dpif: Cleanup STP on ports when disabled on their bridge.
Ethan Jackson [Sun, 19 Feb 2012 08:34:28 +0000 (00:34 -0800)]
ofproto-dpif: Cleanup STP on ports when disabled on their bridge.

When STP is enabled on a bridge, the STP module puts its ports in
an STP_LISTENING state until STP converges.  This causes all
traffic destined for these ports to be dropped.  If STP is disabled
on the bridge, but not explicitly disabled on its ports, the bridge
fails to remove the STP state from these ports.  Therefore, if a
port is in an STP_LISTENING state, it will remain in that state and
continue to drop all traffic indefinitely.  This patch fixes the
issue.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Bug #9157.

12 years agoconfigure: Try to extract kernel source directory from build Makefile.
Ben Pfaff [Thu, 16 Feb 2012 18:34:55 +0000 (10:34 -0800)]
configure: Try to extract kernel source directory from build Makefile.

OVS needs to inspect the headers in the kernel source directory at build
time.  Debian keeps moving the source directory relative to the build
directory and doesn't provide an obvious way to find the source directory,
so in the past we've used some name-based heuristics to essentially guess
where it is.

This commit introduces a new heuristic that I hope will be more reliable:
extracting the source directory from the Makefile in the build directory.
In Debian's case, it looks like the Makefile generally contains a line of
the form "MAKEARGS := -C <srcdir> O=<outdir>".  This commit extracts the
source directory from that line.

To avoid regressions this commit retains the older heuristics as fallbacks.

CC: 659685@bugs.debian.org
Reported-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agovswitchd: Always configure a default queue for QoS.
Ben Pfaff [Fri, 17 Feb 2012 00:33:14 +0000 (16:33 -0800)]
vswitchd: Always configure a default queue for QoS.

When an interface has QoS configured but no default queue (queue 0), OVS
has until now installed that QoS configuration literally, which causes all
packets destined for this default queue to be dropped.  This behavior is
usually both unexpected and undesirable.

This commit changes behavior so that, when no default queue is configured,
OVS uses a default "empty" configuration for the default queue.  This
behavior should be more acceptable when QoS is slightly misconfigured.

I tested that, without this patch, configuring only queue 1 causes "tc
class show" to show only queue 1 (handle 1:2) for linux-htb and linux-hfsc,
and that with this patch it shows configurations for both queue 0 (handle
1:1) and queue 1.

Bug #5583.
Feature #7413.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoxenserver: Fix iteration of dictionary.
Dominic Curran [Wed, 15 Feb 2012 17:17:25 +0000 (17:17 +0000)]
xenserver: Fix iteration of dictionary.

Fix bug in commit 3249bb907a1dab9b0, which incorrectly assumed that
get_all_records_where() returned a list.  It in fact returns a
dictionary and the list iteratory needs to change to account for this.

Thanks to Nicira for pointing this out.

NIC-454.

Reported-by: David Tsai <dtsai@nicira.com>
Acked-by: Rob Hoes <rob.hoes@citrix.com>
Signed-off-by: Dominic Curran <dominic.curran@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Update changelog for 1.4.0-2 upload
Simon Horman [Wed, 15 Feb 2012 02:10:39 +0000 (11:10 +0900)]
debian: Update changelog for 1.4.0-2 upload

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Use provided kernel source dir instead of host kernel version.
Ben Pfaff [Tue, 14 Feb 2012 17:17:13 +0000 (09:17 -0800)]
debian: Use provided kernel source dir instead of host kernel version.

DKMS passes in an explicit variable for the kernel source directory, so we
should use that instead of `uname -r`.

CC: 659685@bugs.debian.org
Reported-by: Thomas Goirand <thomas@goirand.fr>
Tested-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Do not run "make" if "configure" fails during DKMS build.
Ben Pfaff [Mon, 13 Feb 2012 18:09:09 +0000 (10:09 -0800)]
debian: Do not run "make" if "configure" fails during DKMS build.

There is no point in trying to run "make" if "configure" failed.  The
"make" will fail too and the log will be harder to read.

CC: Thomas Goirand <zigo@debian.org>
CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Look in /lib/modules instead of /usr/src for DKMS kernel sources.
Ben Pfaff [Tue, 10 Jan 2012 22:22:22 +0000 (14:22 -0800)]
debian: Look in /lib/modules instead of /usr/src for DKMS kernel sources.

DKMS packages usually look in /lib/modules for kernel sources, since that
is the "standard" location, but our packages was looking directly in
/usr/src.  This fixes the problem.

Reported-by: Alban Browaeys <prahal@yahoo.com>
Tested-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Fix dependencies for openvswitch-datapath-dkms package.
Ben Pfaff [Fri, 10 Feb 2012 19:00:54 +0000 (11:00 -0800)]
debian: Fix dependencies for openvswitch-datapath-dkms package.

The OVS kernel module, like other kernel modules, does not need a working
userspace build environment, but the OVS "configure" script and makefiles
don't support a kernel-only build, so "configure" fails if libc6-dev is
not installed.

It would be better to change the "configure" script and makefiles to handle
this special case, but that was more work than I initially expected it to
be.

Bug #8606.
Reported-by: Edwin Chiu <echiu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-xapi-sync: Always set iface-id, not just when xs-vif-uuid changes.
Ben Pfaff [Thu, 2 Feb 2012 01:18:52 +0000 (17:18 -0800)]
ovs-xapi-sync: Always set iface-id, not just when xs-vif-uuid changes.

When XAPI moves an interface from one bridge to another, the vif script
removes the vif from one bridge and adds it to (possibly) a different
bridge in a single transaction.  The new record does not have an iface-id
initially (because the vif script never adds the iface-id initially) but
it has the same name and xs-vif-uuid as the old one, so the caching logic
in ovs-xapi-sync failed to add a new iface-id.  This commit fixes the
caching logic.

Observed on XenServer 5.6.100.  It's possible that XAPI behavior changed in
later versions so the bug cannot be triggered there, but we have not
checked.

Bug #9414.
Reported-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto-dpif: Don't output to in_port even if in_port is OFPP_LOCAL.
Aaron Rosen [Wed, 8 Feb 2012 18:59:41 +0000 (10:59 -0800)]
ofproto-dpif: Don't output to in_port even if in_port is OFPP_LOCAL.

Signed-off-by: Aaron Rosen <arosen@clemson.edu>
[Ben Pfaff added the test.]
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Don't install Python modules for obsolete Python versions.
Ben Pfaff [Fri, 3 Feb 2012 21:30:50 +0000 (13:30 -0800)]
debian: Don't install Python modules for obsolete Python versions.

Python 2.4 is obsolete, not present in Debian squeeze or sid, so don't
install Python modules for it.

It would be better to just put the files directly into
/usr/share/pyshared/ovs/, instead of in site-packages for some specific
Python version, but this causes problems for builds on squeeze, as
documented in commit bc3aa0bf5 (debian: Make python-openvswitch packaging
work with squeeze dh_python2.):

    The dh_python2 helper in Debian squeeze has a limitation that is not
    mentioned anywhere, as far as I can tell: Python files must be in
    /usr/lib/python#.#/site-packages to be installed.  The version in Debian
    wheezy does not have the same limitation.

    This meant that building the Debian packages on squeeze silently produced
    a broken python-openvswitch package, whereas building the same thing on
    wheezy built a working package.

    This fixes the problem by putting the .py files where squeeze expects them.
    It works on wheezy too.

A before-and-after "debdiff" shows that the only significant effect of this
commit is to drop python2.4 symlinks.

CC: horms@debian.org
Reported-by: Luca Falavigna <ftpmaster@debian.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Add dependency on ${misc:Depends} to openvswitch-test
Simon Horman [Fri, 3 Feb 2012 08:34:17 +0000 (17:34 +0900)]
debian: Add dependency on ${misc:Depends} to openvswitch-test

This is necessary as openvswitch-test makes use of debhelper.

As reported by lintian.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agovswitchd: Make the MAC entry aging time configurable.
Ben Pfaff [Wed, 1 Feb 2012 23:04:51 +0000 (15:04 -0800)]
vswitchd: Make the MAC entry aging time configurable.

NICS-11.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agomac-learning: Increase MAC learning timeout to 300 seconds.
Ben Pfaff [Tue, 24 Jan 2012 18:38:04 +0000 (10:38 -0800)]
mac-learning: Increase MAC learning timeout to 300 seconds.

When Cisco (and other?) routers are configured in high-availability modes,
they use two different MAC addresses.  The router uses MAC 1 only for ARP
replies.  The router uses MAC 2 for forwarding IP packets to end hosts.
When a MAC learning switch is attached to the router, therefore, it will
only learn the location of MAC 1 from ARP replies.  If the end host's ARP
cache refresh timer is longer than the switch's MAC learning timeout, then
packets to the router will be flooded from the MAC learning timeout until
the next ARP reply.

This commit fixes the problem by increasing the MAC learning timeout from
60 seconds to 300 seconds.  According to research by Sanjay Sane, this is
always sufficient, even with operating systems that use ARP timeouts
longer than 300 seconds (such as FreeBSD and Mac OS, which have 1200
seconds ARP timeouts)  because the routers that cause this problem send
unsolicited ARP replies every 180 seconds.

This issue arises in any situation where traffic between two hosts flows
only in one direction.  The explanation above describes only one special
case.

NICS-11.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agosflow_agent: Use snprintf() in place of sprintf().
Ben Pfaff [Tue, 31 Jan 2012 17:39:28 +0000 (09:39 -0800)]
sflow_agent: Use snprintf() in place of sprintf().

These functions use sprintf() into a 1000-byte buffer.  It appears to me
that the strings they format are either short, fixed-length strings or the
output of strerror(), neither of which should ordinarily overflow.
However, using snprintf() cannot hurt.

Launchpad bug #914160.
Reported-by: Matthias Klose <doko@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Add comment about upstream Linux 3.3 support in "changelog". v1.4.0
Justin Pettit [Tue, 31 Jan 2012 08:10:58 +0000 (00:10 -0800)]
debian: Add comment about upstream Linux 3.3 support in "changelog".

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoSet dates for 1.4.0 release.
Justin Pettit [Tue, 31 Jan 2012 03:47:33 +0000 (19:47 -0800)]
Set dates for 1.4.0 release.

12 years agoNEWS: Point out userspace is compatible with Linux 3.3 OVS kernel module.
Justin Pettit [Tue, 31 Jan 2012 07:07:19 +0000 (23:07 -0800)]
NEWS: Point out userspace is compatible with Linux 3.3 OVS kernel module.

12 years agotable: Avoid segmentation fault when printing an empty cell in JSON format.
Ben Pfaff [Fri, 27 Jan 2012 20:37:45 +0000 (12:37 -0800)]
table: Avoid segmentation fault when printing an empty cell in JSON format.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-ctl: Restore ability to create 256 bridges.
Ben Pfaff [Fri, 27 Jan 2012 00:02:01 +0000 (16:02 -0800)]
ovs-ctl: Restore ability to create 256 bridges.

OVS is supposed to support at least 256 bridges simultaneously, but the
file descriptor count was a little too low for that.

Build tested only.

Bug #8218.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto: Optionally flush all learning tables with appctl.
Ethan Jackson [Tue, 24 Jan 2012 22:33:23 +0000 (14:33 -0800)]
ofproto: Optionally flush all learning tables with appctl.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agotests: Fix broken interface-reconfigure tests.
Ben Pfaff [Tue, 24 Jan 2012 22:49:11 +0000 (14:49 -0800)]
tests: Fix broken interface-reconfigure tests.

Commit acfb4e9597 updated the interface-reconfigure scripts without
updating the corresponding tests, causing false test failures.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Delete log files correctly when packages are purged.
Ben Pfaff [Thu, 19 Jan 2012 18:07:38 +0000 (10:07 -0800)]
debian: Delete log files correctly when packages are purged.

Debian Policy 10.8 says "Log files should be removed when the package is
purged (but not when it is only removed)," but the Open vSwitch packages
didn't properly implement this:

   - The openvswitch-brcompat and openvswitch-pki packages didn't delete
     their log files at purge time.

   - The openvswitch-switch package deleted all of the log files at purge
     time, even those owned by openvswitch-brcompat or openvswitch-pki.

This commit fixes both problems.

CC: 656448@bugs.debian.org
Reported-by: Andreas Beckmann <debian@abeckmann.de>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoxenserver: Only replace XenServer hosts scripts that we recognize.
Ben Pfaff [Tue, 24 Jan 2012 17:53:44 +0000 (09:53 -0800)]
xenserver: Only replace XenServer hosts scripts that we recognize.

Open vSwitch comes with slightly improved versions of upstream Citrix
XenSever host scripts.  Until now, the Open vSwitch RPMs have always
installed its own versions of the scripts over the Citrix versions.  This
commit changes behavior to replace the scripts only if we recognize the
exact versions being replaced.  This approach seems safer given that the
benefits of the OVS changes are minor and we don't want to break any
upstream changes inadvertently.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoxenserver: Synchronize scripts with XenServer 6.0.0.
Ben Pfaff [Mon, 16 Jan 2012 19:23:26 +0000 (11:23 -0800)]
xenserver: Synchronize scripts with XenServer 6.0.0.

This commit updates the "vif" and "interface-reconfigure" scripts installed
by Open vSwitch on Citrix XenServer with those in XenServer 6.0.0.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Fix version check for 3.2.
Jesse Gross [Sat, 14 Jan 2012 01:09:21 +0000 (17:09 -0800)]
datapath: Fix version check for 3.2.

We support Linux 3.2 and all of its patch levels but the current
check only allows for 3.2.0.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoofproto-dpif: Revalidate flows after "fdb/flush".
Ben Pfaff [Thu, 19 Jan 2012 00:08:46 +0000 (16:08 -0800)]
ofproto-dpif: Revalidate flows after "fdb/flush".

Otherwise bad translations can stick around.

Bug #9253.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Correct GRE checksum offset.
Jesse Gross [Fri, 20 Jan 2012 23:12:38 +0000 (15:12 -0800)]
datapath: Correct GRE checksum offset.

If a statically defined GRE key is used with checksums then the
checksum will overwrite the key.  This is because the key is set
at header caching time and the checksum is set at packet processing
time and we don't update the offset on packet processing because
we don't do anything with the key.

Reported-by: Christos Argyropoulos <cargious@netmode.ntua.gr>
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agodatapath: Enforce mutual exclusion between bridge and brcompat_mod.
Ben Pfaff [Tue, 17 Jan 2012 19:15:49 +0000 (11:15 -0800)]
datapath: Enforce mutual exclusion between bridge and brcompat_mod.

In kernels 2.6.36, Open vSwitch can (and does) safely coexist with the
Linux bridge module, but it does not make sense to load both bridge and
brcompat_mod at the same time.  Until now, nothing has prevented both from
loading; when they both load, confusion (at best) results.  This fixes
the problem by enforcing mutual exclusion.

Bug #9226.
Launchpad bug #917309.
Reported-by: Rogério Vinhal Nunes
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agomultipath: Correctly calculate number of required destination bits.
Ben Pfaff [Tue, 27 Dec 2011 21:37:43 +0000 (13:37 -0800)]
multipath: Correctly calculate number of required destination bits.

The previous calculation was wrong when n_links was a power of 2.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Fix multipart datapath dumps.
Ben Pfaff [Wed, 11 Jan 2012 17:58:17 +0000 (09:58 -0800)]
datapath: Fix multipart datapath dumps.

The logic to split up the list of datapaths into multiple Netlink messages
was simply wrong, causing the list to be terminated after the first part.
Only about the first 50 datapaths would be dumped.  This fixes the
problem.

Bug #9124.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoofproto-dpif: Keep subfacets longer to avoid assert-fail in facet_account().
Ben Pfaff [Fri, 6 Jan 2012 23:03:07 +0000 (15:03 -0800)]
ofproto-dpif: Keep subfacets longer to avoid assert-fail in facet_account().

If a subfacet expired when its facet still had statistics that had not
yet been pushed into the rule, and the facet either used the "normal"
action or the bridge contained a bond port, then facet_account() would
be called after the last subfacet was removed from its facet's list of
subfacets, triggering an assertion failure in list_front().

This fixes the problem by always running facet_flush_stats() (which calls
facet_account()) before deleting the last subfacet from a facet.

This problem took a while to surface because subfacets usually expire only
long after their statistics have been pushed into the rule.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Mike Kruze <mkruze@nicira.com>
Bug #9074.

12 years agoofproto-dpif: Fake-up OFPP_NONE input bundle for mirroring and normal.
Justin Pettit [Tue, 3 Jan 2012 21:34:20 +0000 (13:34 -0800)]
ofproto-dpif: Fake-up OFPP_NONE input bundle for mirroring and normal.

Both mirroring and "normal" processing make use of the input bundle to
perform various sanity checks.  Controller-generated traffic typically
uses an ingress port of OFPP_NONE, which doesn't have a corresponding
input bundle.  This commit fakes one up well enough that mirroring and
"normal" processing succeed.

We looked at creating an actual bundle based on the "real" OFPP_NONE.
This was even uglier, since there were even more special-cases that
needed to be handled, including having to hide it from port queries.

Reported-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoofproto-dpif: Have lookup_input_bundle() return a bundle.
Justin Pettit [Tue, 3 Jan 2012 00:06:48 +0000 (16:06 -0800)]
ofproto-dpif: Have lookup_input_bundle() return a bundle.

Previously, the function returned an "ofport_dpif", but it makes more
sense to return an "ofbundle".  This will also be helpful in a
forthcoming commit.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoovs-ofctl: Fix error in man page related to TCI masks.
Justin Pettit [Thu, 22 Dec 2011 22:39:54 +0000 (14:39 -0800)]
ovs-ofctl: Fix error in man page related to TCI masks.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
12 years agoofproto: Fix detection of in-use VLANs based on the flow table.
Ben Pfaff [Wed, 4 Jan 2012 22:38:46 +0000 (14:38 -0800)]
ofproto: Fix detection of in-use VLANs based on the flow table.

I swear I tested this, but the code was obviously wrong.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Brendan Kelley <bkelley@nicira.com>
Bug #8729.

12 years agovswitchd: Also consider access port VLANs as "in use" for VLAN splinters.
Ben Pfaff [Tue, 3 Jan 2012 21:34:47 +0000 (13:34 -0800)]
vswitchd: Also consider access port VLANs as "in use" for VLAN splinters.

It's natural to add an access port to a bridge and expect that trunk ports
will then immediately start to work properly with that VLAN without
additional configuration.  This change makes that happen.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoDebian: Depend on python (>= 2.7) | python-argparse
Simon Horman [Fri, 30 Dec 2011 05:37:52 +0000 (14:37 +0900)]
Debian: Depend on python (>= 2.7) | python-argparse

Depend on python (>= 2.7) | python-argparse instead of
python-argparse to avoid pulling in python2.6

See: http://bugs.debian.org/653645

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agobundle: Fix returned error code in one bundle_check() corner case.
Ben Pfaff [Tue, 27 Dec 2011 23:44:41 +0000 (15:44 -0800)]
bundle: Fix returned error code in one bundle_check() corner case.

In C, the || operator yields 0 or 1, not (as in some other languages) the
value of its first nonzero operand.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto-dpif: Fix bug in VLAN splinters.
Ben Pfaff [Tue, 27 Dec 2011 20:34:57 +0000 (12:34 -0800)]
ofproto-dpif: Fix bug in VLAN splinters.

Bug #8671.
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agopacket: Match userspace and kernel definition of ICMP header.
Jesse Gross [Tue, 27 Dec 2011 01:33:03 +0000 (17:33 -0800)]
packet: Match userspace and kernel definition of ICMP header.

Current userspace considers an ICMP header to be 4 bytes consisting
of the type, code, and checksum.  The kernel considers it to be 8
bytes because it also counts the two data fields that contain
type-specific information (and are always present).  Since flow
extract will zero out headers that are not completely present this
means that an ICMP packet that has a header of 5-7 bytes will be
interpreted differently by userspace and kernel.  This fixes the
problem by adopting the kernel's version of the ICMP header in
userspace.

Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoofproto-dpif: Flush MACs for deleted ports from every bridge.
Ben Pfaff [Fri, 16 Dec 2011 18:02:51 +0000 (10:02 -0800)]
ofproto-dpif: Flush MACs for deleted ports from every bridge.

Consider this scenario: two hypervisors HV-1 and HV-2, connected to a
common physical network over SLB bonds.  Two virtual machines VM-1 and VM-2
are both running on HV-1.  Patch ports are in use, so that each VM is not
connected to a bridge with a physical Ethernet port but is actually one
virtual "hop" away across a patch port to a second OVS bridge.  VM-2 is
running a "ping" process directed at VM-1.

Now migrate VM-1 to HV-2.  Suppose that VM-1 fails to send out a gratuitous
ARP following migration, or that the gratuitous ARPs are lost, e.g. because
they are sent before the OpenFlow controller manages to populate the flow
table with rules to allow the VM's traffic

Now we are in a situation where HV-1 has learned that VM-1 is local and
HV-2 has learned that VM-1 is on its bond; both are wrong.  One would
expect the problem to resolve itself as soon the VM-1 sends out its first
packet.  However, SLB bonds (for important reasons documented in
vswitchd/INTERNALS) are very reluctant to learn that a currently local MAC
is actually on the bond: the only ways to learn that the MAC is on the bond
are to receive a gratuitous ARP (which we won't, since they were dropped)
or for the MAC learning entry to expire after 60 seconds. This means that
VM-1 can send out as much ordinary traffic as it wants (even ARP requests
and other broadcasts) but HV-1 will drop all of it at the physical Ethernet
since it believes that VM-1 is local.

(In an ordinary setup with a single bridge, HV-1 would have unlearned the
address for VM-1 when VM-1's port was deleted, but that didn't happen
because HV-1 only learned that VM-1 was on the patch port that leads to the
integration bridge.  The patch port didn't get deleted.)

HV-2 does quickly learn that VM-1 is now local.  SLB bonds are only
reluctant to learn that something they think is local is actually on the
bond, not the reverse.

This commit attempts to work around the problem by flushing the MAC
associated with a port from *every* bridge when a port is deleted.

This commit demonstrates yet another good reason not to use SLB bonds.

Build and unit tested only.
Bug #7978.
Bug #7687.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodpif-netdev: Correctly report types of dummy netdevs.
Ben Pfaff [Fri, 16 Dec 2011 18:03:08 +0000 (10:03 -0800)]
dpif-netdev: Correctly report types of dummy netdevs.

When dpif-netdev is in use as a "dummy" datapath, the devices that are
added to it have type "dummy", but the dpif methods that report the types
of ports reported that they had type "system".  This meant that every time
the bridge code reconfigured, it would see that the ports had the wrong
types and delete and re-add them, which had other undesirable effects such
as flushing the entire MAC learning table whenever ovs-vsctl changed the
configuration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoUpdate FSF address in LGPL notices in bugtool plugins.
Chris Wright [Fri, 9 Dec 2011 07:36:00 +0000 (23:36 -0800)]
Update FSF address in LGPL notices in bugtool plugins.

This quiets the rpmlint errors:
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/system-configuration/openvswitch.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/system-logs/openvswitch.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/system-configuration.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/network-status/openvswitch.xml
 E: incorrect-fsf-address /etc/openvswitch/bugtool-plugins/kernel-info/openvswitch.xml

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoNEWS: Fix typo in entry for 1.3.0.
Ben Pfaff [Wed, 21 Dec 2011 19:01:45 +0000 (11:01 -0800)]
NEWS: Fix typo in entry for 1.3.0.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoAdd release date for 1.3.0.
Ben Pfaff [Wed, 21 Dec 2011 00:48:40 +0000 (16:48 -0800)]
Add release date for 1.3.0.

This made it into branch-1.3 but not master.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto-dpif: Include datapath flow misses in flow statistics.
Ben Pfaff [Thu, 8 Dec 2011 20:40:01 +0000 (12:40 -0800)]
ofproto-dpif: Include datapath flow misses in flow statistics.

Commit 501f8d1fd75 (ofproto-dpif: Batch interacting with the dpif on flow
miss operations.) caused packets handled manually in userspace not to be
counted in flow statistics.  This patch fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Bug #8494.

12 years agobond: Warn of imminent default bond_mode change.
Ethan Jackson [Thu, 15 Dec 2011 21:39:38 +0000 (13:39 -0800)]
bond: Warn of imminent default bond_mode change.

Post version 1.4.*, we are planning to change the default bond_mode
from balance-slb to active-backup.  This commit warns users of the
change so that they can prepare.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
12 years agoofproto-dpif: Fix use-after-free for OFPP_CONTROLLER flows.
Ben Pfaff [Fri, 16 Dec 2011 18:09:30 +0000 (10:09 -0800)]
ofproto-dpif: Fix use-after-free for OFPP_CONTROLLER flows.

When a flow consists solely of an output to OFPP_CONTROLLER, we avoid a
round trip to the kernel and back by calling execute_controller_action()
from handle_flow_miss().  However, execute_controller_action() frees the
packet passed in.  This is dangerous, because the packet and the upcall
key are in the same block of malloc()'d memory, as the comment on struct
dpif_upcall says:

/* A packet passed up from the datapath to userspace.
 *
 * If 'key' or 'actions' is nonnull, then it points into data owned by
 * 'packet', so their memory cannot be freed separately.  (This is hardly a
 * great way to do things but it works out OK for the dpif providers and
 * clients that exist so far.)
 */

Thus, we get a use-after-free later on in handle_flow_miss() and eventually
a double free.

This fixes the problem by making execute_controller_action() clone the
packet in this case.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto-dpif: Avoid segfault for ports with bundles in add_mirror_actions().
Ben Pfaff [Tue, 13 Dec 2011 22:42:11 +0000 (14:42 -0800)]
ofproto-dpif: Avoid segfault for ports with bundles in add_mirror_actions().

Not every port has an associated bundle, so we must not unconditionally
dereference ofport->bundle without first checking that it is nonnull.

(One example of a port without a bundle is a VLAN splinter port.)

Bug #8671.
Reported-by: Michael Mao <mmao@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agobridge: Enable support for access and native VLAN ports on bonds.
Ben Pfaff [Mon, 12 Dec 2011 22:44:23 +0000 (14:44 -0800)]
bridge: Enable support for access and native VLAN ports on bonds.

Since Open vSwitch's inception we've disabled the use of bonds as access
ports, for no particularly good reason.  This also unintentionally
prevented bonds from being used as native VLAN ports.

This commit removes the code that prevented using bonds these ways

Reported-and-tested-by: "Michael A. Collins" <mike.a.collins@ark-net.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Consistently use American spelling of "license" in copyright.in.
Ben Pfaff [Mon, 12 Dec 2011 18:32:44 +0000 (10:32 -0800)]
debian: Consistently use American spelling of "license" in copyright.in.

Consistent spelling may make searches easier.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Correct licensing information for user/kernel shared header files.
Ben Pfaff [Mon, 12 Dec 2011 17:37:34 +0000 (09:37 -0800)]
debian: Correct licensing information for user/kernel shared header files.

The intent is to license all shared user/kernel header files under both
GPLv2 and Apache v2.  The license statement here said GPLv3 instead of
GPLv2, so this commit fixes that problem.

Also, include/openvswitch used to be where all the shared user/kernel
header files were located, but this is no longer true, and now there is a
userspace-only header file also in include/openvswitch, so this commit now
lists all of the user/kernel header files explicitly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Add sFlow license information and text to copyright.in.
Ben Pfaff [Mon, 12 Dec 2011 17:42:09 +0000 (09:42 -0800)]
debian: Add sFlow license information and text to copyright.in.

sFlow licensing information was omitted from debian/copyright due to an
oversight.  This commit adds it.

Reported-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agosFlow: add Sun Industry Standards Source License 1.1 as licensing option
Neil McKee [Sat, 10 Dec 2011 00:56:32 +0000 (16:56 -0800)]
sFlow: add Sun Industry Standards Source License 1.1 as licensing option

The sFlow License was not on the list for the Fedora Project,  but the
Sun Industry Standards Source License 1.1 was (and it has the right
properties).  So this patch includes it as a licensing option in the
relevant places (COPYING and the lib/sflow* sources).   Let me know
if this looks OK or not.

Signed-off-by: Neil McKee <neil.mckee@inmon.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
12 years agobridge: Avoid use-after-free with VLAN splinters and multiple bridges.
Ben Pfaff [Fri, 9 Dec 2011 23:57:55 +0000 (15:57 -0800)]
bridge: Avoid use-after-free with VLAN splinters and multiple bridges.

The VLAN splinters feature uses a "pool" to track and free allocated
blocks.  There's only one pool, but the implementation was freeing all of
the blocks in it for every bridge during reconfiguration, not just once for
each reconfiguration, so caused a use-after-free when there was more than
one bridge and a bridge other than the last one in the list of bridges had
a VLAN splinter port.

Bug #8671.
Reported-by: Michael Mao <mmao@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoAUTHORS: Add Chris Wright.
Ben Pfaff [Fri, 9 Dec 2011 17:38:19 +0000 (09:38 -0800)]
AUTHORS: Add Chris Wright.

12 years agobugtool: move plugins data from /etc/openvswitch to /usr/share/openvswitch
Chris Wright [Fri, 9 Dec 2011 07:36:06 +0000 (23:36 -0800)]
bugtool: move plugins data from /etc/openvswitch to /usr/share/openvswitch

This is in repsonse to the following rpmlint warnings:

 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/system-configuration/openvswitch.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/system-logs/openvswitch.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/system-configuration.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/network-status/openvswitch.xml
 W: non-conffile-in-etc /etc/openvswitch/bugtool-plugins/kernel-info/openvswitch.xml

The xenserver specfile still places them in /etc/xensource/bugtool since
that's a distro policy.  Of course, the rpmlint warnings are as well,
however, this seems like a more logical place for the bugtool plugins.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoutilites: rename ovs-lib.sh to ovs-lib
Chris Wright [Fri, 9 Dec 2011 07:36:05 +0000 (23:36 -0800)]
utilites: rename ovs-lib.sh to ovs-lib

Rename this helper script to simply ovs-lib, since it's primarily
a library of helper functions.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoutilities: install ovs-lib.sh as data not a script
Chris Wright [Fri, 9 Dec 2011 07:36:04 +0000 (23:36 -0800)]
utilities: install ovs-lib.sh as data not a script

Currently, ovs-lib.sh is installed as an executable.  It's meant to be
sourced by external scripts, so install as data.  Fixes rpmlint error:

 E: script-without-shebang /usr/share/openvswitch/scripts/ovs-lib.sh

Could drop the .sh suffix in another commit.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agoman: fix pic issue at the source
Chris Wright [Fri, 9 Dec 2011 07:36:03 +0000 (23:36 -0800)]
man: fix pic issue at the source

The commit 0993b66 (man: pic failed to run during manpage-check) worked
around the manpage-check warning generated by groff.  Using "-T ascii"
rather "-T utf8" was enough to silence the warning because the man page
has this condition in it:

  .if !'\*[.T]'ascii'

However, rpmlint generates the same warning as manpage-check was (it
uses -Tutf8), and manpages are generated using -Tutf8 (leading to an
fairly unreadable drawing).  So let's change the logic a bit and allow
pdf generation w/ nice drawing and kill it for tty's.

Cc: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agorhel: openvswitch.spec.in: fix perms on logrotate and sysconfig.template
Chris Wright [Fri, 9 Dec 2011 07:36:02 +0000 (23:36 -0800)]
rhel: openvswitch.spec.in: fix perms on logrotate and sysconfig.template

Fixes rpmlint warning:

 W: spurious-executable-perm /etc/logrotate.d/openvswitch
 W: non-conffile-in-etc /etc/logrotate.d/openvswitch
 E: script-without-shebang /usr/share/openvswitch/scripts/sysconfig.template

Define rhel_cp() shell func and include file mode on install.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agorhel: openvswitch.spec.in installs README as executable
Chris Wright [Fri, 9 Dec 2011 07:36:01 +0000 (23:36 -0800)]
rhel: openvswitch.spec.in installs README as executable

Fix this rpmlint warning:

 W: spurious-executable-perm /usr/share/doc/openvswitch-1.4.0/README.RHEL

by specifying mode on install.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agosocket-util: Correctly return negative values for errors.
Ben Pfaff [Tue, 6 Dec 2011 23:55:22 +0000 (15:55 -0800)]
socket-util: Correctly return negative values for errors.

The comment on this function says that negative values indicate errors, and
the callers assume that too, but in fact it was returning positive errno
values, which are indistinguishable from valid fd numbers.

It really seems to me that this should have been found pretty quickly in
the field, since stream-tcp and stream-ssl both use inet_open_passive to
implement their passive listeners.  I'm surprised that no one has reported
it.

12 years agodatapath: small potential memory leak in ovs_vport_alloc()
Dan Carpenter [Tue, 6 Dec 2011 19:08:25 +0000 (11:08 -0800)]
datapath: small potential memory leak in ovs_vport_alloc()

We're unlikely to hit this leak, but the static checkers complain if we
don't take care of it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoxenserver: Reduce number of xapi DB calls in plugin
Rob Hoes [Mon, 5 Dec 2011 14:43:12 +0000 (14:43 +0000)]
xenserver: Reduce number of xapi DB calls in plugin

When there are lots of PIFs in a XenServer/XCP pool, for example when
there are many VLANs configured on the pool, operations such as
PIF.get_all and loops over all PIFs which include database operations,
are very inefficient when executed on a pool slave, and should be
avoided as much as possible. This patch reduces the number of database
calls in the update function of the openvswitch-cfg-update xapi plugin.

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Acked-by: Dominic Curran <Dominic.curran@citrix.com>
12 years agoovs-vlan-bugs: Document driver bug with priority tagged packets.
Ben Pfaff [Mon, 28 Nov 2011 21:49:12 +0000 (13:49 -0800)]
ovs-vlan-bugs: Document driver bug with priority tagged packets.

Reported-by: Jesse Gross <jesse@nicira.com>
12 years agoINSTALL.XenServer: Update instructions.
Ben Pfaff [Wed, 30 Nov 2011 20:54:03 +0000 (12:54 -0800)]
INSTALL.XenServer: Update instructions.

The instructions hadn't been properly updated to match current XenServer
releases.

Reported-by: Ramana Reddy <gtvrreddy@gmail.com>
12 years agolearn: Avoid 1-byte buffer underrun in learn_format().
Ben Pfaff [Thu, 1 Dec 2011 16:33:55 +0000 (08:33 -0800)]
learn: Avoid 1-byte buffer underrun in learn_format().

Reported-and-tested-by: Jari Sundell <sundell.software@gmail.com>
12 years agoDeclare the version as "1.4.0".
Justin Pettit [Thu, 1 Dec 2011 06:20:09 +0000 (22:20 -0800)]
Declare the version as "1.4.0".

12 years agotests: Perform basic LACP unit tests.
Ethan Jackson [Tue, 29 Nov 2011 02:08:49 +0000 (18:08 -0800)]
tests: Perform basic LACP unit tests.

This patch adds tests which check that configuration settings in
the database are reflected in the LACP module's appctl output.

12 years agolacp: Sort slaves in appctl output.
Ethan Jackson [Tue, 29 Nov 2011 22:21:26 +0000 (14:21 -0800)]
lacp: Sort slaves in appctl output.

This will simplify unit tests added in a future patch.

12 years agolacp: Remove trailing whitespace from appctl output.
Ethan Jackson [Tue, 29 Nov 2011 22:27:12 +0000 (14:27 -0800)]
lacp: Remove trailing whitespace from appctl output.

This will marginally simplify some unit tests in a future patch.