sliver-openvswitch.git
12 years agoofproto: Fix use-after-free error when ports disappear. branch-1.2
Ben Pfaff [Mon, 23 Apr 2012 16:16:18 +0000 (09:16 -0700)]
ofproto: Fix use-after-free error when ports disappear.

update_port() can delete the port for which it is called, if the underlying
network device has been destroyed, so HMAP_FOR_EACH is unsafe in
ofproto_run().

Less obviously, update_port() can delete unrelated ports.  For example,
suppose that initially device A is port 1 and device B is port 2.  If
update_port("A") runs just after this, then it will ofport_remove() both
ports, then ofport_install() A as the new port 2.

So this commit first assembles a list of ports to update, then updates them
in a separate loop.

Without this commit, running "ovs-dpctl del-dp" while ovs-vswitchd is
running consistently causes a crash for me within a few seconds.

Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Fix log rotation.
Ben Pfaff [Thu, 22 Mar 2012 17:20:44 +0000 (10:20 -0700)]
debian: Fix log rotation.

Commit 24e81092a1 (debian: Bring Debian packaging in-line with new file
locations) introduced an ambiguous "--t" option invoking ovs-appctl, so
ovs-vswitchd and ovsdb-server were not reopening their log files following
log rotation.  This fixes the problem by correct the option name.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
12 years agonetdev-linux: Fix use-after-free when netdev_dump_queues() deletes queues.
Ben Pfaff [Mon, 19 Mar 2012 20:47:50 +0000 (13:47 -0700)]
netdev-linux: Fix use-after-free when netdev_dump_queues() deletes queues.

iface_configure_qos() passes a callback to netdev_dump_queues() that can
delete queues.  The netdev-linux implementation of this function was
unprepared for the callback to delete queues, so this could cause a
use-after-free.  This fixes the problem in netdev_linux_dump_queues() and
documents that netdev_dump_queues() implementations must support deletions
in the callback.

Found by valgrind:

==1593== Invalid read of size 8
==1593==    at 0x4A8C43: netdev_linux_dump_queues (hmap.h:326)
==1593==    by 0x4305F7: bridge_reconfigure (bridge.c:3084)
==1593==    by 0x431384: bridge_run (bridge.c:1892)
==1593==    by 0x432749: main (ovs-vswitchd.c:96)
==1593==  Address 0x632e078 is 8 bytes inside a block of size 32 free'd
==1593==    at 0x4C240FD: free (vg_replace_malloc.c:366)
==1593==    by 0x4A4D74: hfsc_class_delete (netdev-linux.c:3250)
==1593==    by 0x42AA59: iface_delete_queues (bridge.c:3055)
==1593==    by 0x4A8C8C: netdev_linux_dump_queues (netdev-linux.c:1881)
==1593==    by 0x4305F7: bridge_reconfigure (bridge.c:3084)
==1593==    by 0x431384: bridge_run (bridge.c:1892)

Bug #10164.
Reported-by: Ram Jothikumar <ram@nicira.com>
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 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 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 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 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 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 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 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>
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 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 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 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 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 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 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 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 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 agoovsdb: Correctly implement conditions that include multiple clauses.
Ben Pfaff [Wed, 16 Nov 2011 22:38:52 +0000 (14:38 -0800)]
ovsdb: Correctly implement conditions that include multiple clauses.

Multiple-clause conditions in OVSDB operations with "where" clauses are
supposed to be conjunctions, that is, the condition is true only if every
clause is true.  In fact, the implementation only checked a single clause
(not necessarily the first one) and ignored the rest.  This fixes the
problem and adds test coverage for multiple-clause conditions.

Reported-by: Shih-Hao Li <shli@nicira.com>
12 years agoflow: flow_extract() improperly parses IPv6 TOS bits.
Ethan Jackson [Wed, 16 Nov 2011 02:35:26 +0000 (18:35 -0800)]
flow: flow_extract() improperly parses IPv6 TOS bits.

This problem could cause userspace to automatically evict IPv6
flows from the datapath which had TOS bits set.

Bug #8323.

12 years agostream: Fix uninitialized values in stream_init().
Ben Pfaff [Wed, 2 Nov 2011 19:59:06 +0000 (12:59 -0700)]
stream: Fix uninitialized values in stream_init().

stream_init() didn't initialize the remote_ip, remote_port, local_ip, or
local_port members of the stream, so "unix" streams that don't have any of
those would get random values instead.

Reported-by: "Voravit T." <voravit@kth.se>
Reported-by: Jari Sundell <sundell.software@gmail.com>
12 years agonetdev-vport: Again allow "tap" devices to be added to bridges.
Ben Pfaff [Mon, 31 Oct 2011 17:54:30 +0000 (10:54 -0700)]
netdev-vport: Again allow "tap" devices to be added to bridges.

I did not check that tap devices otherwise work.  This at least allows
them to be part of a bridge again.

Reported-by: Janis Hamme <janis.hamme@student.kit.edu>
12 years agoofproto-dpif: Fix VLAN and other field handling in OFPP_NORMAL.
Ben Pfaff [Thu, 13 Oct 2011 19:16:34 +0000 (12:16 -0700)]
ofproto-dpif: Fix VLAN and other field handling in OFPP_NORMAL.

This is a nontrivial cross-port of commit 823518f1f "ofproto-dpif: Fix VLAN
and other field handling in OFPP_NORMAL" from the "master" branch.

compose_actions(), which is part of the OFPP_NORMAL implementation, had
multiple flaws that this commit corrects.

First, it did not commit changes made to the flow by actions preceding the
output to OFPP_NORMAL.  This means that, for example, if an OpenFlow action
to modify an L2 or L3 header preceded the output to OFPP_NORMAL, then
OFPP_NORMAL would output its packets without those changes.

Second, it did not update the action_xlate_ctx's notion of the VLAN that
was currently set, in the cases where it modified the current VLAN.  This
means that actions following the output to OFPP_NORMAL could output to
unexpected VLANs.

Bug #6001.
Reported-by: Michael Mao <mmao@nicira.com>
12 years agodebian: Start ovs-monitor-ipsec after ovsdb running.
Justin Pettit [Mon, 24 Oct 2011 21:40:58 +0000 (14:40 -0700)]
debian: Start ovs-monitor-ipsec after ovsdb running.

ovs-monitor-ipsec uses the OVS database to get configuration, so don't
bother starting the daemon until it's up.

Debian recently switched to using the LSB fields in the header of init
scripts to allow dependency-based boots.  This is described in the
following page:

    http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot

This commit makes use of those fields to get the ordering we want.

12 years agoofp-util: Avoid misaligned memory access in ofputil_encode_packet_in().
Ben Pfaff [Tue, 18 Oct 2011 21:00:57 +0000 (14:00 -0700)]
ofp-util: Avoid misaligned memory access in ofputil_encode_packet_in().

Reported-by: Murphy McCauley <murphy.mccauley@gmail.com>
12 years agoofproto-dpif: Make OFPAT_ENQUEUE to input port do nothing.
Ben Pfaff [Sun, 9 Oct 2011 22:52:21 +0000 (15:52 -0700)]
ofproto-dpif: Make OFPAT_ENQUEUE to input port do nothing.

This makes OFPAT_ENQUEUE consistent with OFPAT_OUTPUT for the purpose of
sending a packet back out the input port: both only do it if the port is
given as OFPP_IN_PORT.

Found by inspection.

12 years agopackets.h: Fix STP destination MAC address.
Justin Pettit [Sat, 8 Oct 2011 01:24:12 +0000 (18:24 -0700)]
packets.h: Fix STP destination MAC address.

12 years agoofproto-dpif: Update bundle when OFPPC_NO_FLOOD changed.
Justin Pettit [Mon, 17 Oct 2011 17:27:35 +0000 (10:27 -0700)]
ofproto-dpif: Update bundle when OFPPC_NO_FLOOD changed.

When the OFPPC_NO_FLOOD flag is toggled on the port, the "floodable"
member of the bundle was not updated.  This would cause OFPP_NORMAL to
not include the proper ports when flooding.  With this commit,
OFPPC_NO_FLOOD changes will cause the floodable members to be
recalculated.

Found by inspection.

12 years agobridge: Forbid '/' in bridge names to prevent arbitrary directory access.
Ben Pfaff [Fri, 14 Oct 2011 17:17:41 +0000 (10:17 -0700)]
bridge: Forbid '/' in bridge names to prevent arbitrary directory access.

12 years agodatapath: Fix recv path for CONFIG_PREEMPT_RCU.
Pravin B Shelar [Fri, 7 Oct 2011 02:53:23 +0000 (19:53 -0700)]
datapath: Fix recv path for CONFIG_PREEMPT_RCU.

In case CONFIG_PREEMPT_RCU, rcu grace period waits only for RCU
read-side critical sections that are delimited by rcu_read_lock() and
rcu_read_unlock(). internal_dev_xmit() is called in rcu_read_lock_bh
context. Therefore we need to explicitly take rcu lock to prevent race
with call_rcu() in PREEMPT_RCU case.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agodebian: Package the installed Python files, not those from the source tree.
Ben Pfaff [Wed, 5 Oct 2011 21:55:02 +0000 (14:55 -0700)]
debian: Package the installed Python files, not those from the source tree.

The only difference between the Python files that are installed and the
Python files found in the source tree is in the ovs.dirs module, but this
is a very important difference: we want the directories used to be the ones
configured in (e.g. /usr/share/openvswitch), not the only used by default
by the source tree's dirs.py (e.g. /usr/local/share/openvswitch).

I verified with "dpkg-deb -x" and "diff -ur" that in fact this is the only
change that this commit makes.

This bug has been in place since at least commit 1d273d6d8 "debian: Rename
openvswitch-python to python-openvswitch" from over a year ago, but until
now the packaged Python files didn't actually use any directories that
differed between the two versions of dirs.py, so only now has the problem
manifested.

This problem prevented ovs-monitor-ipsec from finding the OVSDB schema
file.

Reported-by: Ethan Jackson <ethan@nicira.com>
12 years agodebian: Make python-openvswitch packaging work with squeeze dh_python2.
Ben Pfaff [Mon, 3 Oct 2011 16:19:29 +0000 (09:19 -0700)]
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.

Bug #7510.
Reported-by: Michael Hu <mhu@nicira.com>
Tested-by: Simon Horman <horms@verge.net.au>
12 years agoovs-bugtool: Use RUNDIR macro for ovs-appctl target.
Justin Pettit [Fri, 23 Sep 2011 22:30:55 +0000 (15:30 -0700)]
ovs-bugtool: Use RUNDIR macro for ovs-appctl target.

Correct the target path used by ovs-appctl.  The previous value was
hard-coded to "/var/run", but the common path is actually
"/var/run/openvswitch".  However, it's better to use RUNDIR, since the
default location is build-time configurable.

12 years agodatapath: Fix unused 'done' label build warning in flow.c. v1.2.2
Justin Pettit [Thu, 22 Sep 2011 06:43:10 +0000 (23:43 -0700)]
datapath: Fix unused 'done' label build warning in flow.c.

Commit d6b37e42 (datapath: Allow a packet with no input port to omit
ODP_KEY_ATTR_IN_PORT.) was a crossport from commit 18886b6 in the
"master" branch, but dropped a few lines.  This causes a compiler
warning about an unused "done" label.  This commit brings the two
patches in line.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
12 years agoovs-bugtool: Fix --unlimited option.
Daniel Roman [Wed, 21 Sep 2011 21:44:15 +0000 (14:44 -0700)]
ovs-bugtool: Fix --unlimited option.

Bug #5443.

12 years agoPrepare Open vSwitch 1.2.2 release.
Justin Pettit [Wed, 21 Sep 2011 06:52:51 +0000 (23:52 -0700)]
Prepare Open vSwitch 1.2.2 release.

12 years agodatapath: Correctly validate vport attributes on old kernels.
Jesse Gross [Tue, 20 Sep 2011 17:31:29 +0000 (10:31 -0700)]
datapath: Correctly validate vport attributes on old kernels.

The vport policy for OVS_VPORT_ATTR_PORT_NO and OVS_VPORT_ATTR_TYPE
are present only in the section for newer kernels.  This means that
on older kernels the length of these attributes are never checked
anywhere but we go ahead and read from them anyways.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodebian: Correct path to ovs-controller in init script.
Ben Pfaff [Tue, 20 Sep 2011 16:38:33 +0000 (09:38 -0700)]
debian: Correct path to ovs-controller in init script.

Reported-by: George Shuklin <amarao@desunote.ru>
Bug-report: http://bugs.debian.org/642206

12 years agodatapath: Fully initialize datapath before local port.
Jesse Gross [Thu, 15 Sep 2011 23:41:36 +0000 (16:41 -0700)]
datapath: Fully initialize datapath before local port.

It's possible to start receiving packets on a datapath as soon as
the internal device is created.  It's therefore important that the
datapath be fully initialized before this, which it currently isn't.
In particular, the fact that dp->stats_percpu is not yet set is
potentially fatal.  In addition, if allocation of the Netlink response
failed it would leak the percpu memory.  This fixes both problems.

Found by code inspection, in practice the datapath is probably always
done initializing before someone can send a packet on it.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Correctly set error code in queue_userspace_packets().
Jesse Gross [Mon, 19 Sep 2011 23:23:25 +0000 (16:23 -0700)]
datapath: Correctly set error code in queue_userspace_packets().

In a few places in queue_userspace_packets() when we encounter an
error, we don't actually set the 'err' variable.  Although we
free the packets we don't correctly account for these packets as
being lost.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agoofproto-dpif: Fix behavior when a subset of VLANs is trunked.
Ben Pfaff [Wed, 24 Aug 2011 22:27:14 +0000 (15:27 -0700)]
ofproto-dpif: Fix behavior when a subset of VLANs is trunked.

Reported-by: Philippe Jung <phil.jung@free.fr>
12 years agoovs-brcompatd: Delete ports when netdevs on fake bridges disappear.
Ben Pfaff [Thu, 15 Sep 2011 22:55:45 +0000 (15:55 -0700)]
ovs-brcompatd: Delete ports when netdevs on fake bridges disappear.

Until now, when a network device disappeared, netdev_changed_cb() passed
the name of the bridge that contained the network device to ovs-vsctl as
part of the "del-port" command.  However, when the network device was
actually a "fake bridge", it would pass the name of the real bridge, which
ovs-vsctl rejected as wrong (expecting the name of the fake bridge) and
not remove the port.

This fixes the problem by dropping the bridge name, which is simpler than
trying to get the name of the fake bridge in this case.

Reported-by: Tyler Coumbes <coumbes@gmail.com>
Tested-by: Tyler Coumbes <coumbes@gmail.com>
12 years agodatapath: Set vport in skb when executed from userspace.
Jesse Gross [Mon, 1 Aug 2011 07:35:20 +0000 (00:35 -0700)]
datapath: Set vport in skb when executed from userspace.

Currently, the OVS_CB(skb)->vport member is never initialized for
packets coming from userspace.  This means that they can never be
sampled by sFlow and generally violates our principle that userspace
packets should be made to look the same as others.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin Shelar <pshelar@nicira.com>
12 years agoofproto-dpif: Emit set_tunnel when required to.
Ethan Jackson [Mon, 12 Sep 2011 23:56:21 +0000 (16:56 -0700)]
ofproto-dpif: Emit set_tunnel when required to.

ofproto-dpif assumed that the datapath initialized the tun_id of a
flow on egress, to its tun_id on ingress.  For this reason, if
OpenFlow actions set the tun_id to a flow's ingress tun_id,
ofproto-dpif would fail to emit a set_tunnel action.

Reported-by: Igor Ganichev <iganichev@nicira.com>
Reported-by: Pankaj Thakkar <thakkar@nicira.com>
12 years agoDebian: Update changelog for 1.2.1-3 upload
Simon Horman [Sat, 10 Sep 2011 06:09:32 +0000 (15:09 +0900)]
Debian: Update changelog for 1.2.1-3 upload

12 years agoDebian: fail gracefully if modules can't be loaded on install
Simon Horman [Sat, 10 Sep 2011 06:09:31 +0000 (15:09 +0900)]
Debian: fail gracefully if modules can't be loaded on install

By registering an error-handler for the init script used
in openvswitch-switch.postinst and detecting if module insertion fails,
it is possible to avoid failure to install in the case where the
openvswitch_mod module is not available.

This is done without altering the behaviour that the start target
of the openvswitch-switch init script will fail if module insertion fails.

This patch also adds a friendly hint as as to why starting
openvswitch-switch has failed if it is due to failure to insert
the openvswtich_mod. This message is displayed as necessary both
on package install and other calls to the start target of the
init script.

[Ben Pfaff fixed up == to = in postinst]

12 years agoovs-ctl: Add load-kmod command
Simon Horman [Wed, 7 Sep 2011 01:10:30 +0000 (10:10 +0900)]
ovs-ctl: Add load-kmod command

On Debian there is a need for the init scripts to die gracefully
if module insertion fails. In such a case it is desirable to print
some sort of informative message.

By adding the load-kmod sub-command to ovs-ctl init scripts
may try to load modules and take appropriate action on failure
or then try to start the daemons.

12 years agodatapath: Allow a packet with no input port to omit ODP_KEY_ATTR_IN_PORT.
Ben Pfaff [Thu, 8 Sep 2011 23:36:57 +0000 (16:36 -0700)]
datapath: Allow a packet with no input port to omit ODP_KEY_ATTR_IN_PORT.

When ovs-vswitchd executes actions on a synthesized packet, that is, on a
packet that is not being forwarded from any particular port but is being
generated by ovs-vswitchd itself or by an OpenFlow controller (using a
OFPT_PACKET_OUT message with an in_port of OFPP_NONE), there is no good
choice for the in_port to pass to the kernel in the flow in the
ODP_PACKET_CMD_EXECUTE message.  This commit allows ovs-vswitchd to omit
the in_port entirely in this case.

This fixes a bug in OFPT_PACKET_OUT: using an in_port of OFPP_NONE would
cause the packet to be dropped by the kernel, since that's an invalid
input port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Reported-by: Aaron Rosen <arosen@clemson.edu>
12 years agodatapath: Calculate flow hash after extracting metadata.
Jesse Gross [Thu, 8 Sep 2011 22:32:24 +0000 (15:32 -0700)]
datapath: Calculate flow hash after extracting metadata.

When we execute a packet from userspace we first extract the header
fields from the packet and then add supplied metadata.  However, we
compute the hash of the packet in between these two steps despite
the fact that the metadata can affect the hash.  This can lead to
two separate hashes for packets of the same flow.

Found by code inspection, not an actual real-world problem.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agoDebian: Update changelog for 1.2.1-2 upload
Simon Horman [Fri, 26 Aug 2011 09:03:43 +0000 (18:03 +0900)]
Debian: Update changelog for 1.2.1-2 upload

12 years agodebian: Transition to dh_python2
Simon Horman [Fri, 26 Aug 2011 09:03:42 +0000 (18:03 +0900)]
debian: Transition to dh_python2

dh_pysupport that the packaging used until now is deprecated, with
dh_python2 as its successor.

This commit removes the PYTHONPATH setting from
debian/openvswitch-ipsec.init because it is not needed, as the Python
packaging is public.  In fact, the Python packaging was public,
unintentionally, before, so the PYTHONPATH could have been removed earlier.

12 years agoDebian: update changelog for 1.2.1-1
Simon Horman [Wed, 24 Aug 2011 01:40:56 +0000 (10:40 +0900)]
Debian: update changelog for 1.2.1-1

12 years agoDebian: set -e in brcompat postinst
Simon Horman [Wed, 24 Aug 2011 01:40:55 +0000 (10:40 +0900)]
Debian: set -e in brcompat postinst

As reported by lintian:

The maintainer script doesn't seem to set the -e flag which ensures
that the script's execution is aborted when any executed command
fails.

Refer to Debian Policy Manual section 10.4 (Scripts) for details.

12 years agodoc: Add spaces between commas to avoid overflowing line during formatting.
Ben Pfaff [Wed, 24 Aug 2011 16:45:18 +0000 (09:45 -0700)]
doc: Add spaces between commas to avoid overflowing line during formatting.

This resolves a warning reported as
"71: warning [p 11, 5.0i]: cannot adjust line"

Reported-by: Simon Horman <horms@verge.net.au>
Found by lintian.

12 years agodocs: Add missing escape
Simon Horman [Wed, 24 Aug 2011 01:40:53 +0000 (10:40 +0900)]
docs: Add missing escape

This adds what appears to be a missing character to an escape sequence.

This resolves a problem reported as
"a newline character is not allowed in an escape name".

Reported by lintian

12 years agodocs: Suppress "warning: macro `DD' not defined" warning
Simon Horman [Wed, 24 Aug 2011 01:40:52 +0000 (10:40 +0900)]
docs: Suppress "warning: macro `DD' not defined" warning

Suppress "warning: macro `DD' not defined" warning for ovs-brcompatd.8.

As per the description by Ben Pfaff for the same problem effecting
other files:

deamon.man allows the file that is including it to include extra
text in the description of --detach by defining a macro named DD.
Only some of the manpages that included it did this (only those
manpages that needed extra text there).  But it's better to be
quiet in "man --warnings", so this defines DD to an empty value in
the other manpages that include daemon.man.

Reported by lintian

12 years agoDebian: Add dependency on ${misc:Depends}
Simon Horman [Wed, 24 Aug 2011 01:40:51 +0000 (10:40 +0900)]
Debian: Add dependency on ${misc:Depends}

Add dependency on ${misc:Depends} to openvswitch-brcompat and ovsdbmonitor.
As reported by Lintian:

The source package uses debhelper, but it does not include
${misc:Depends} in the given binary package's debian/control entry.
Any debhelper command may add dependencies to ${misc:Depends} that
are required for the work that it does, so recommended best
practice is always add ${misc:Depends} to the dependencies of each
binary package if debhelper is in use.

Refer to the debhelper(7) manual page for details.

12 years agoPrepare Open vSwitch 1.2.1 release. v1.2.1
Justin Pettit [Sat, 20 Aug 2011 00:23:47 +0000 (17:23 -0700)]
Prepare Open vSwitch 1.2.1 release.

12 years agoofproto-dpif: Delete MAC learning entries when they expire.
Ben Pfaff [Fri, 19 Aug 2011 21:29:27 +0000 (14:29 -0700)]
ofproto-dpif: Delete MAC learning entries when they expire.

Commit fa066f015f716c7 "bridge: Move packet processing functionality into
ofproto" deleted the call to mac_learning_run() that deletes MAC learning
table entries when they expire.  This fixes the problem.

12 years agonx-match: Fix bug in "move" action.
Ethan Jackson [Fri, 12 Aug 2011 18:15:53 +0000 (11:15 -0700)]
nx-match: Fix bug in "move" action.

This patch fixes a bug introduced in Commit 43edca57 "nx-match: New
helpers.", which caused the "move" action to improperly handle bit
ranges.

12 years agoofp-parse: Fix parsing of register values 2**31 and greater.
Ben Pfaff [Fri, 12 Aug 2011 21:59:11 +0000 (14:59 -0700)]
ofp-parse: Fix parsing of register values 2**31 and greater.

Reported-by: Ethan Jackson <ethan@nicira.com>
12 years agodebian: Avoid installing duplicate files in ovsdbmonitor package.
Ben Pfaff [Wed, 10 Aug 2011 16:13:12 +0000 (09:13 -0700)]
debian: Avoid installing duplicate files in ovsdbmonitor package.

This is just a typo introduced in commit 57483aeda (debian: Fix bug from
commit 211b05b5 "debian: Modernize use of dh_install.) that caused the
ovsdbmonitor package to install too many files.

Bug-report: http://bugs.debian.org/636815
Reported-by: Ralf Treinen <treinen@free.fr>
12 years agonicira-ext: Fix NXM example.
Ben Pfaff [Tue, 9 Aug 2011 20:46:51 +0000 (13:46 -0700)]
nicira-ext: Fix NXM example.

The code and the specification say that nxm_length includes both value
and mask, but this example showed nxm_length only including the value.
This commit fixes it.

Reported-by: Justin Pettit <jpettit@nicira.com>
12 years agoovs-ofctl: Fix reading flows from file for "replace-flows", "diff-flows".
Ben Pfaff [Tue, 9 Aug 2011 19:55:13 +0000 (12:55 -0700)]
ovs-ofctl: Fix reading flows from file for "replace-flows", "diff-flows".

Commit c821124b25e "ovs-ofctl: Accept only valid flow_mod and
flow_stats_request fields" caused actions read by read_flows_from_file()
to be ignored and treated as "drop".  This fixes the problem.

12 years agoOption to forward BPDU (Ethernet control class) frames
Sanjay Sane [Tue, 9 Aug 2011 18:08:27 +0000 (11:08 -0700)]
Option to forward BPDU (Ethernet control class) frames

Currently, a NORMAL action bridge drops reserved-multicast-mac addresses;
01-80-c2-00-00-[f0:ff]. A node that does not implement STP should have an
option to forward such frames.

This commit proposes to have a configuration option to allow forwarding of
BPDU class frames.  To ensure backward compatibility, this option is
disabled by default.

This config can be set using bridge's other-config column, for e.g
ovs-vsctl set bridge br0 other-config:forward-bpdu=true

Changing this option can revalidate all flows in a software-OVS
implementation (ofproto-dpif)

--------
unit tests:

------------
make config changes, test runtime behavior

-- test runtime behavior --
continuously send packets to br0 with dest-mac=01:80:c2:00:00:00

ovs-dpctl dump-flows br0
ovs-vsctl set bridge br0 other-config:forward-bpdu=true
ovs-dpctl dump-flows br0
ovs-vsctl set bridge br0 other-config:forward-bpdu=false
ovs-dpctl dump-flows br0
ovs-vsctl set bridge br0 other-config:forward-bpdu=true
ovs-dpctl dump-flows br0
ovs-vsctl remove bridge br0 other-config forward-bpdu=true
ovs-dpctl dump-flows br0

--result--
 ovs-dpctl dump-flows br0
 in_port(1),eth(src=00:0c:29:d1:39:42,dst=01:80:c2:00:00:00), packets:29550, bytes:1773000, used:0.004s, actions:drop
 ovs-vsctl set bridge br0 other-config:forward-bpdu=true

 ovs-dpctl dump-flows br0
in_port(1),eth(src=00:0c:29:d1:39:42,dst=01:80:c2:00:00:00), packets:8209, bytes:492540, used:0.000s, actions:2,0

 ovs-vsctl set bridge br0 other-config:forward-bpdu=false
 ovs-dpctl dump-flows br0
in_port(1),eth(src=00:0c:29:d1:39:42,dst=01:80:c2:00:00:00), packets:19, bytes:1140, used:0.000s, actions:drop

 ovs-vsctl set bridge br0 other-config:forward-bpdu=true
 ovs-dpctl dump-flows br0
in_port(1),eth(src=00:0c:29:d1:39:42,dst=01:80:c2:00:00:00), packets:29, bytes:1740, used:0.000s, actions:2,0

 ovs-vsctl remove bridge br0 other-config forward-bpdu=true
 ovs-dpctl dump-flows br0
in_port(1),eth(src=00:0c:29:d1:39:42,dst=01:80:c2:00:00:00), packets:0, bytes:0, used:never, actions:drop

Bug #6624
Reported-by: Niklas Andersson <nandersson@nicira.com>
12 years agodebian: Ensure that /var/run/openvswitch exists in controller init script.
Ben Pfaff [Mon, 8 Aug 2011 17:58:38 +0000 (10:58 -0700)]
debian: Ensure that /var/run/openvswitch exists in controller init script.

It would be better to use ovs-ctl from this script, but until now this is
an adequate solution.

Reported-by: Jibesh Patra
Bug-report: https://bugs.launchpad.net/bugs/822142

12 years agobridge: Add port to datapath before trying to retrieve device stats.
Ben Pfaff [Fri, 5 Aug 2011 21:14:18 +0000 (14:14 -0700)]
bridge: Add port to datapath before trying to retrieve device stats.

Virtual ports such as GRE tunnels don't exist until after the port is
added to the datapath, so without this change adding such a port yields
a warning like the following:

netdev|WARN|failed to retrieve MTU for network device gre0: No such device

12 years agoDocument and warn that mirroring to a VLAN is incompatible with SLB bonding.
Ben Pfaff [Fri, 5 Aug 2011 23:58:02 +0000 (16:58 -0700)]
Document and warn that mirroring to a VLAN is incompatible with SLB bonding.

vswitchd/INTERNALS explains the incompatibility:

   2. When Open vSwitch forwards a multicast or broadcast packet to a
      link in the SLB bond other than the active slave, the remote
      switch will forward it to all of the other links in the SLB
      bond, including the active slave.  Without special handling,
      this would mean that Open vSwitch would forward a second copy of
      the packet to each switch port (other than the bond), including
      the port that originated the packet.

      Open vSwitch deals with this case by dropping packets received
      on any SLB bonded link that have a source MAC+VLAN that has been
      learned on any other port.  (This means that SLB as implemented
      in Open vSwitch relies critically on MAC learning.  Notably, SLB
      is incompatible with the "flood_vlans" feature.)

We could go farther than this and automatically change the bonding mode to
a safer one (e.g. active-backup) when flood_vlans are enabled.  However,
that would still leave the SLB fallback for LACP modes in place; perhaps
active-backup would have to be the fallback for LACP modes when flood_vlans
are enabled.

12 years agolib: Adapt headers for use in C++.
Casey Barker [Thu, 4 Aug 2011 23:18:59 +0000 (16:18 -0700)]
lib: Adapt headers for use in C++.

This commit makes several library headers suitable for inclusion in C++.

It adds [extern "C"] guards and makes minor changes to fix casting and
keyword issues.

12 years agoin-band: Delete remaining rules when disabling in-band control.
Ben Pfaff [Wed, 3 Aug 2011 22:01:11 +0000 (15:01 -0700)]
in-band: Delete remaining rules when disabling in-band control.

in_band_destroy() doesn't remove all of the rules that in-band control
adds (and it cannot, because that might require waiting for an existing
asynchronous flow modification or addition to complete), so turning on
other-config:disable-in-band or deleting all of the OpenFlow controllers
did not delete all of the in-band rules.

This commit fixes the problem by making the in-band control object hang
around until all of the flows that it set up have actually been deleted.

This problem was introduced as part of commit 7ee20df "ofproto: Implement
asynchronous OFPT_FLOW_MOD commands."

Reported-by: Brad Hall <brad@nicira.com>
12 years agoconnmgr: Drop 'next_in_band_update' timer.
Ben Pfaff [Wed, 3 Aug 2011 21:31:54 +0000 (14:31 -0700)]
connmgr: Drop 'next_in_band_update' timer.

This timer used to exist because it was possible for in-band remote IP
addresses to change without any intentional configuration change in one
case: where controller discovery found a new controller.  Controller
discovery was removed long ago, but the reason for the timer had been
forgotten and so remained.  This commit removes it.

12 years agoPrepare Open vSwitch 1.2.0 release. v1.2.0
Justin Pettit [Wed, 3 Aug 2011 22:09:45 +0000 (15:09 -0700)]
Prepare Open vSwitch 1.2.0 release.

12 years agoUpdate ChangeLog to reflect changes since 1.1.0.
Justin Pettit [Wed, 3 Aug 2011 06:15:30 +0000 (23:15 -0700)]
Update ChangeLog to reflect changes since 1.1.0.

12 years agovlog: Move log level definitions from source code to user documentation.
Ben Pfaff [Thu, 28 Jul 2011 17:19:43 +0000 (10:19 -0700)]
vlog: Move log level definitions from source code to user documentation.

Users should be able to find out what a log level means without reading
source code comments, so this seems like a better place for it.

Reported-by: David Tsai <dtsai@nicira.com>
12 years agovlog: Add a new log level "off".
Ben Pfaff [Thu, 28 Jul 2011 17:19:42 +0000 (10:19 -0700)]
vlog: Add a new log level "off".

Until now, "emer" has effectively been "off" because no messages were ever
logged at "emer" level.  Justin points out that it is useful to use "emer"
for messages that indicate a fatal error.  This commit makes that change
and adds a new "off" level to really turn off all logging to a facility.

12 years agodebian: Fix path for ovsdb-server in init script.
Justin Pettit [Mon, 1 Aug 2011 17:43:26 +0000 (10:43 -0700)]
debian: Fix path for ovsdb-server in init script.

Reported-by: Brad Hall <brad@nicira.com>
12 years agodatapath: Backport flex_arrays.
Jesse Gross [Fri, 15 Jul 2011 16:59:06 +0000 (09:59 -0700)]
datapath: Backport flex_arrays.

flex_arrays didn't exist at all until 2.6.30, weren't exported to modules
until 2.6.38, and performed poorly until 3.0, so this backports the
functionality to older kernels.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Don't pass __GFP_ZERO to kmalloc on older kernels.
Jesse Gross [Fri, 15 Jul 2011 16:59:16 +0000 (09:59 -0700)]
datapath: Don't pass __GFP_ZERO to kmalloc on older kernels.

On new kernels kzalloc() is simply a wrapper around kmalloc with
the addition of the __GFP_ZERO flag.  flex_arrays take advantage
of this by expecting the user to just pass in this flag if they
want the memory to be zeroed.  However, before 2.6.23, kzalloc()
was a function in its own right and kmalloc really didn't like
receiving __GFP_ZERO.  This overrides kmalloc() to intercept the
flags and direct the call to the right function.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agodatapath: Backport reciprocal division.
Jesse Gross [Fri, 15 Jul 2011 16:59:05 +0000 (09:59 -0700)]
datapath: Backport reciprocal division.

The reciprocal division library did not exist until 2.6.20 and is
not currently exported in any version, so this backports it.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
12 years agoovs-ofctl: Print human readable nx_pull_match() errors.
Ethan Jackson [Thu, 28 Jul 2011 23:49:06 +0000 (16:49 -0700)]
ovs-ofctl: Print human readable nx_pull_match() errors.

I've found this makes debugging a bit easier.

12 years agonx-match: Shorten line length to 79 characters.
Ethan Jackson [Wed, 27 Jul 2011 22:10:38 +0000 (15:10 -0700)]
nx-match: Shorten line length to 79 characters.

12 years agoofproto-dpif: Allow setting of flow eviction threshold
Simon Horman [Thu, 28 Jul 2011 23:38:50 +0000 (16:38 -0700)]
ofproto-dpif: Allow setting of flow eviction threshold

Allow setting the number of flows present in the flow hash
at which point eviction of entries from the kernel flow hash
will begin to occur.

The value may be set using a bridge's other-config column.

e.g.

ovs-vsctl set bridge br3 other-config:flow-eviction-threshold=10000

default is 1000, reflecting constant value previously used.

Increasing this value can result in reduced CPU usage and
packet loss in situations where the number of active flows
is significantly larger than 1000.

12 years agoDatapath action should not refer to controller
pravin shelar [Thu, 28 Jul 2011 16:05:25 +0000 (09:05 -0700)]
Datapath action should not refer to controller

ODP_ACTION_ATTR_CONTROLLER in the kernel actually sends packets to
userspace, not the controller. To make it generic rename this action
to ODP_ACTION_ATTR_USERSPACE.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
12 years agogit: Update gitignore in tests and utilities.
Ethan Jackson [Thu, 28 Jul 2011 18:39:51 +0000 (11:39 -0700)]
git: Update gitignore in tests and utilities.

12 years agoofproto-dpif: Fix mirror configuration and deconfiguration.
Ben Pfaff [Thu, 28 Jul 2011 00:06:50 +0000 (17:06 -0700)]
ofproto-dpif: Fix mirror configuration and deconfiguration.

Deleting or updating a mirror didn't work: mirror_set() didn't set the
'aux' member so mirror_lookup() couldn't find the mirror on that basis.

Bug #6617.
Reported-by: David Tsai <dtsai@nicira.com>
12 years agovlog: Fix typo in VLOG_IS_ERR_ENABLED macro definition.
Ben Pfaff [Thu, 28 Jul 2011 16:45:02 +0000 (09:45 -0700)]
vlog: Fix typo in VLOG_IS_ERR_ENABLED macro definition.

This does not fix any real bug because VLOG_IS_ERR_ENABLED is not used
anywhere in the tree.

12 years agoxenserver: Fix typo in spec file.
Ethan Jackson [Thu, 28 Jul 2011 02:00:59 +0000 (19:00 -0700)]
xenserver: Fix typo in spec file.

12 years agoRemove spurious blank line.
Ben Pfaff [Thu, 28 Jul 2011 00:07:07 +0000 (17:07 -0700)]
Remove spurious blank line.

12 years agoovs-benchmark: New utility.
Ben Pfaff [Wed, 27 Jul 2011 23:23:06 +0000 (16:23 -0700)]
ovs-benchmark: New utility.

12 years agosocket-util: New function lookup_hostname().
Ben Pfaff [Thu, 16 Sep 2010 21:28:53 +0000 (14:28 -0700)]
socket-util: New function lookup_hostname().

This is equivalent to lookup_ip() except that it accepts DNS names also.

12 years agosocket-util: Factor inet_parse_passive() out of inet_open_passive().
Ben Pfaff [Wed, 29 Sep 2010 17:15:15 +0000 (10:15 -0700)]
socket-util: Factor inet_parse_passive() out of inet_open_passive().

12 years agoovs-ofctl: Fix dump-ports and queue-stats commands.
Ben Pfaff [Thu, 21 Jul 2011 21:44:54 +0000 (14:44 -0700)]
ovs-ofctl: Fix dump-ports and queue-stats commands.

These ovs-ofctl commands have been sending malformed stats requests since
commit 63f2140a553 "openflow: Make stats replies more like other OpenFlow
messages."  This commit fixes the problem and adds basic unit tests that
should prevent similar regressions.

Reported-by: Hao Zheng <hzheng@nicira.com>
12 years agoovs-ofctl: New --readd option for "replace-flows".
Ben Pfaff [Wed, 27 Jul 2011 21:58:10 +0000 (14:58 -0700)]
ovs-ofctl: New --readd option for "replace-flows".

This is useful for resetting flows' byte and packet counters to 0.

Suggested-by: Jed Daniels <openvswitch@jeddaniels.com>
12 years agonetlink-socket: Reduce nl_sock_recv() from 2 (or more) system calls to 1.
Ben Pfaff [Wed, 27 Jul 2011 21:56:03 +0000 (14:56 -0700)]
netlink-socket: Reduce nl_sock_recv() from 2 (or more) system calls to 1.

Until now, each attempt to receive a message from a Netlink socket has
taken at least two system calls, one to check the size of the message to
be received and a second one to delete the message from the socket buffer.
This commit switches to a new strategy that requires only one system call
per message received.

In my testing this increases the maximum flow setups per second by a little
over 10%.

12 years agonetlink-socket: Remove unused nl_sock_sendv() function.
Ben Pfaff [Wed, 20 Jul 2011 17:52:09 +0000 (10:52 -0700)]
netlink-socket: Remove unused nl_sock_sendv() function.

This function hasn't been used for ages.

12 years agodebian: Move OVSDB schema and ovsdb-tool to openvswitch-switch.
Ben Pfaff [Tue, 26 Jul 2011 16:46:38 +0000 (09:46 -0700)]
debian: Move OVSDB schema and ovsdb-tool to openvswitch-switch.

ovs-vswitchd in the openvswitch-switch package is tightly coupled to its
database schema.  During development, it's possible to change the schema
without changing the Open vSwitch version number, which makes it possible
for the openvswitch-switch and openvswitch-common packages to get out of
sync: openvswitch-switch requires the same version of openvswitch-common,
but if the version number doesn't get updated that has no effect.

Actually putting the schema and ovs-vswitchd (its primary user) in the
same package prevents them from getting out-of-sync.  This commit also
moves ovsdb-tool because that program often works directly with OVSDB
schemas and so there's not much point having it around without a schema to
work with.