openvswitch
14 years agojson: Export function to parse an individual JSON string.
Ben Pfaff [Tue, 26 Jan 2010 17:47:54 +0000 (09:47 -0800)]
json: Export function to parse an individual JSON string.

The JSON syntax for strings is very reasonable.  An upcoming commit will
have a need for a string parser, so make the JSON string parser available
for that.

Also, this change improves the error message for strings that end in the
middle of a \u sequence, so update the tests to match.

14 years agoovsdb-idl: Avoid redundant memset.
Ben Pfaff [Thu, 21 Jan 2010 18:59:34 +0000 (10:59 -0800)]
ovsdb-idl: Avoid redundant memset.

14 years agoovsdb-idl: Fix use-after-free error in ovsdb_idl_txn_delete().
Ben Pfaff [Thu, 21 Jan 2010 18:51:37 +0000 (10:51 -0800)]
ovsdb-idl: Fix use-after-free error in ovsdb_idl_txn_delete().

14 years agoCleanly separate IDL annotations from OVSDB schema information.
Ben Pfaff [Thu, 7 Jan 2010 23:52:58 +0000 (15:52 -0800)]
Cleanly separate IDL annotations from OVSDB schema information.

Until now, the OVSDB IDL annotations have been glommed together with the
schema information in a single file, and then we've used ovsdb-idlc to
extract the schema from that file.  This commit reverses the process:
the schema and the annotations are stored separately and then glommed
together as necessary at build time.

This new arrangement has a few advantages:

    - We can now easily have multiple different sets of IDL annotations
      for a single OVSDB schema.  For example, some users may not need
      access to columns that other users do.

    - Bugs in ovsdb-idlc cannot screw up the underlying schema (as shown
      by a recent commit).

14 years agovswitch: Remove redundant "internal" column from Interface table.
Ben Pfaff [Mon, 11 Jan 2010 22:28:48 +0000 (14:28 -0800)]
vswitch: Remove redundant "internal" column from Interface table.

This column's function is now served by the "type" column, which is set
to "internal" to mark an interface as internal.

14 years agovswitch: Fix types of NetFlow columns in db schema.
Ben Pfaff [Thu, 7 Jan 2010 23:26:36 +0000 (15:26 -0800)]
vswitch: Fix types of NetFlow columns in db schema.

This bug was masked by the translation done by ovsdb-idlc, which doesn't
fully validate its input.  In particular, it ignores fields that it doesn't
know about and drops them when it does translation, so nothing later can
find the problem.

An upcoming commit will ensure that it can't happen again, by dropping the
ovsdb-idlc translation step.

14 years agoovsdb-idlc: With "doc" command, output tables and columns alphabetically.
Ben Pfaff [Tue, 26 Jan 2010 17:32:38 +0000 (09:32 -0800)]
ovsdb-idlc: With "doc" command, output tables and columns alphabetically.

Until this commit, tables and columns in output were output in random
order (according to the ordering of Python's internal hash table).
Alphabetical order makes more sense.

Thanks to Reid Price for useful Python tips.

14 years agotests: Prefer $(VAR) over @VAR@ in Makefiles.
Ben Pfaff [Thu, 14 Jan 2010 19:32:00 +0000 (11:32 -0800)]
tests: Prefer $(VAR) over @VAR@ in Makefiles.

The Autoconf documentation recently started recommending $(VAR) over @VAR@,
so adopt this style.

14 years agoRelease Open vSwitch 0.99.1
Justin Pettit [Tue, 26 Jan 2010 07:09:58 +0000 (23:09 -0800)]
Release Open vSwitch 0.99.1

This is an "unstable" release.

14 years agoMerge "sflow" into "master".
Ben Pfaff [Mon, 25 Jan 2010 18:52:28 +0000 (10:52 -0800)]
Merge "sflow" into "master".

No conflicts, but lib/dpif.c needed a few changes since struct dpif's
member "class" was renamed to "dpif_class" in master since sflow was
branched off.

14 years agoAdd build checks for portable OpenFlow structure padding and alignment.
Ben Pfaff [Mon, 25 Jan 2010 18:49:31 +0000 (10:49 -0800)]
Add build checks for portable OpenFlow structure padding and alignment.

This causes the build to fail with an error message if openflow.h contains
a structure whose members are not aligned in a portable way.

14 years agoxenserver: Update interface-reconfigure and vif integration scripts.
Ian Campbell [Fri, 22 Jan 2010 20:55:37 +0000 (12:55 -0800)]
xenserver: Update interface-reconfigure and vif integration scripts.

This patch updates the versions of the host integration scripts to
what is present in the recent XCP update and the next release of
XenServer (5.6). I think it probably works on 5.5 as well but I
haven't verified that.

These new versions support runtime selection of the Linux bridging vs
vswitch through the toolstack. The patch includes the necessary
reconfiguration (rewriting /etc/xensource/network.conf) to enable
vswitch in the RPM %post stage.

The RPM spec file integration is only lightly tested, seems to work
for me.

This commit is as provided by Ian Campbell, with a few minor tweaks:

    - Updated xenserver/automake.mk to distribute the added files.

    - Updated RPM spec file not to complain if the added files do
      not already exist (since they do not exist on XenServer 5.5.0).

    - Change location of dbcache back to /var/lib/openvswitch/dbcache
      so that this can coexist with our other internal builds.
      (Undoubtedly we will have to adopt the new location chosen by Ian
      eventually, however.)

14 years agodatapath: Clean up vswitch_skb_checksum_setup().
Ben Pfaff [Wed, 20 Jan 2010 21:07:47 +0000 (13:07 -0800)]
datapath: Clean up vswitch_skb_checksum_setup().

vswitch_skb_checksum_setup() can be defined in datapath.h as a no-op
when defined(CONFIG_XEN) && defined(HAVE_PROTO_DATA_VALID) is false.

Also, skb_checksum_setup(), which was defined similarly, can be dropped
now, since it was unused.

14 years agonetdev: Rename "class" members to "netdev_class" for C++ compatibility.
Ben Pfaff [Fri, 22 Jan 2010 23:13:26 +0000 (15:13 -0800)]
netdev: Rename "class" members to "netdev_class" for C++ compatibility.

From partner.

14 years agohmap: Rename "new" to "new_node" for C++ header compatibility.
Ben Pfaff [Fri, 22 Jan 2010 23:10:07 +0000 (15:10 -0800)]
hmap: Rename "new" to "new_node" for C++ header compatibility.

From partner.

14 years agodpif: Rename "class" member to "dpif_class" for C++ compatibility.
Ben Pfaff [Fri, 22 Jan 2010 23:14:01 +0000 (15:14 -0800)]
dpif: Rename "class" member to "dpif_class" for C++ compatibility.

From partner.

14 years agosflow: Fix sFlow sampling structure.
Ben Pfaff [Wed, 20 Jan 2010 21:52:42 +0000 (13:52 -0800)]
sflow: Fix sFlow sampling structure.

According to Neil McKee, in an email archived at
http://openvswitch.org/pipermail/dev_openvswitch.org/2010-January/000934.html:

    The containment rule is that a given sflow-datasource (sampler or
    poller) should be scoped within only one sflow-agent (or
    sub-agent).  So the issue arrises when you have two
    switches/datapaths defined on the same host being managed with
    the same IP address: each switch is a separate sub-agent, so they
    can run independently (e.g. with their own sequence numbers) but
    they can't both claim to speak for the same sflow-datasource.
    Specifically, they can't both represent the <ifindex>:0
    data-source.  This containment rule is necessary so that the
    sFlow collector can scale and combine the results accurately.

    One option would be to stick with the <ifindex>:0 data-source but
    elevate it to be global across all bridges, with a global
    sample_pool and a global sflow_agent.  Not tempting.  Better to
    go the other way and allow each interface to have it's own
    sampler, just as it already has it's own poller.  The ifIndex
    numbers are globally unique across all switches/datapaths on the
    host, so the containment is now clean.  Datasource <ifindex>:5
    might be on one switch, whille <ifindex>:7 can be on another.
    Other benefits are that 1) you can support the option of
    overriding the default sampling-rate on an interface-by-interface
    basis, and 2) this is how most sFlow implementations are coded,
    so there will be no surprises or interoperability issues with any
    sFlow collectors out there.

This commit implements the approach suggested by Neil.

This commit uses an atomic_t to represent the sampling pool.  This is
because we do want access to it to be atomic, but we expect that it will
"mostly" be accessed from a single CPU at a time.  Perhaps this is a bad
assumption; we can always switch to another form of synchronization later.

CC: Neil McKee <neil.mckee@inmon.com>
14 years agoovs-vsctl: Prevent uninitialized variable warning.
Jesse Gross [Wed, 20 Jan 2010 19:19:47 +0000 (14:19 -0500)]
ovs-vsctl: Prevent uninitialized variable warning.

The compiler warns about next_cfg being uninitialized but in the cases
where it is unset we will never reach the point where it is used.  This
just sets next_cfg to 0 to stop the whining.

14 years agohash: Prevent warnings about strict aliasing rules.
Jesse Gross [Wed, 20 Jan 2010 18:50:48 +0000 (13:50 -0500)]
hash: Prevent warnings about strict aliasing rules.

Some versions of GCC complain about violations of strict aliasing
rules due to a cast between different pointer types.  This avoids
any aliasing by copying the value first.

14 years agomac-learning: Rename "non-learning VLANs" to "flood VLANs".
Ben Pfaff [Tue, 19 Jan 2010 18:41:46 +0000 (10:41 -0800)]
mac-learning: Rename "non-learning VLANs" to "flood VLANs".

Usually positive names are better than negative ones.

14 years agoReimplement port mirroring configuration for database.
Ben Pfaff [Tue, 19 Jan 2010 18:40:36 +0000 (10:40 -0800)]
Reimplement port mirroring configuration for database.

Tested only to the extent that it doesn't obviously break anything else.

14 years agosflow: Fix printf format specifier in log message.
Ben Pfaff [Tue, 19 Jan 2010 18:12:05 +0000 (10:12 -0800)]
sflow: Fix printf format specifier in log message.

"65536 / sizeof *actions" has type size_t, so use %zu.

Reported-by: Neil McKee <neil.mckee@inmon.com>
14 years agodpif-linux: Always set *fnp in make_openvswitch_device().
Ben Pfaff [Tue, 19 Jan 2010 18:10:52 +0000 (10:10 -0800)]
dpif-linux: Always set *fnp in make_openvswitch_device().

Some versions of GCC warn about this.  Always initializing it seems like
the right thing to do, since we "almost always" initialized it before.

Reported-by: Neil McKee <neil.mckee@inmon.com>
14 years agonetdev: Compare full arguments instead of hash for reconfigure.
Jesse Gross [Mon, 18 Jan 2010 22:26:02 +0000 (17:26 -0500)]
netdev: Compare full arguments instead of hash for reconfigure.

We only reconfigure netdevs if the arguments have changed, which
was previously detected based on a hash.  This stores and compares
the full argument list to avoid any chance of missing changes due
to collisions.

14 years agonetdev-linux: Use the netdev list of devices instead of cachemap.
Jesse Gross [Mon, 18 Jan 2010 20:05:58 +0000 (15:05 -0500)]
netdev-linux: Use the netdev list of devices instead of cachemap.

We previously maintained a list of open devices inside of the
linux netdev.  Since the netdev library now maintains this list,
it is better to use that list instead of our own.

14 years agonetdev-linux: Avoid potential issues with unset FD.
Jesse Gross [Sat, 16 Jan 2010 00:24:53 +0000 (19:24 -0500)]
netdev-linux: Avoid potential issues with unset FD.

Never close the file descriptor if it is 0, since it is never a
valid FD in this context.  Also initialize the FD to -1 so that
it is never set to a valid but incorrect value.

14 years agoAdd ability to set controller for specific bridges
Keith Amidon [Mon, 18 Jan 2010 00:55:30 +0000 (16:55 -0800)]
Add ability to set controller for specific bridges

Some applications would prefer that the controller only be enabled for
a subset of bridges.  This commit introduces an alternative syntax for
the XAPI vSwitchController key to enable the specification of such a
configuration.

The implementation of the configuration is currently a hack.  The
problem is that some bridges (especially internal bridges) are only
created when a VIF is added to them.  This means that attempting to
set the controller on boot as we used to do won't work.  Ideally we
would should hook the creation of the bridge and set the controller at
that time.  However, in XenServer 5.5 I can't find an appropriate
place to hook to do so.

To meet immediate requirements, this commit hacks the startup-based
approach by spawning background processes that watch for the creation
of the bridge and set the controller when it becomes available.  We'll
have to replace it with a better and more robust solution ASAP.

14 years agonetdev-linux: Properly store netdev_dev pointer for RTNL callbacks.
Jesse Gross [Sat, 16 Jan 2010 14:45:45 +0000 (09:45 -0500)]
netdev-linux: Properly store netdev_dev pointer for RTNL callbacks.

We were storing a struct netdev_dev_linux ** instead of a
netdev_dev_linux * in the cache map.  This prevented the cache
from being invalidated on changes such as link status.

14 years agortnetlink: Fix typo in comments referencing rtnetlink_notifier_register()
Justin Pettit [Sat, 16 Jan 2010 08:53:09 +0000 (00:53 -0800)]
rtnetlink: Fix typo in comments referencing rtnetlink_notifier_register()

14 years agonetdev: Increase default ingress policing burst size
Justin Pettit [Sat, 16 Jan 2010 01:27:28 +0000 (17:27 -0800)]
netdev: Increase default ingress policing burst size

The default burst rate was 10Kb.  This increases it to 1000kb, since
we were having problems getting traffic through at 10kb.  A better value
probably exists between these two points, but that will require
additional experimentation.

14 years agoidl: Gracefully handle destroying a transaction before receiving its reply.
Ben Pfaff [Fri, 15 Jan 2010 23:22:54 +0000 (15:22 -0800)]
idl: Gracefully handle destroying a transaction before receiving its reply.

If ovsdb_idl_txn_destroy() is called to destroy a transaction before its
reply has been received from the database server, then until now we would
drop the connection to the database when the reply actually arrived,
because we would have no record of that transaction ID any longer.

Notably, ovs-vswitchd does this: it "fires and forgets" database
transactions.  (Really, it should not do that, but that's a bigger commit.)

This commit fixes the problem by not dropping the database connection in
such a case.

This fixes an observed problem such that sometimes ovs-vsctl took a long
time to complete, which was because ovs-vswitchd was dropping its
connection to the database and backing off.

14 years agonetdev-linux: Don't close(0) when closing an ordinary netdev.
Ben Pfaff [Fri, 15 Jan 2010 22:06:15 +0000 (14:06 -0800)]
netdev-linux: Don't close(0) when closing an ordinary netdev.

Calling close(0) at random points is bad.  It means that the next call to
socket() or open() returns fd 0.  Then the next time a netdev gets closed,
that socket or file fd gets closed too, and you end up with weird "Bad
file descriptor" errors.

Found by installing the following as lib/unistd.h in the source tree:

#ifndef UNISTD_H
#define UNISTD_H 1

#include <stdlib.h>
#include_next <unistd.h>

#undef close
#define close(fd) rpl_close(fd)

static inline int rpl_close(int fd)
{
    if (!fd) {
        abort();
    }
    return (close)(fd);
}

#endif

14 years agoEnable daemon monitoring and automatic restart by default.
Ben Pfaff [Fri, 15 Jan 2010 21:09:32 +0000 (13:09 -0800)]
Enable daemon monitoring and automatic restart by default.

Tested on a XenServer by running "kill -SEGV" on the daemon processes and
watching them restart automatically and by running plain "kill" and
watching them terminate normally.

14 years agodaemon: Add support for process monitoring and restart.
Ben Pfaff [Fri, 15 Jan 2010 20:13:46 +0000 (12:13 -0800)]
daemon: Add support for process monitoring and restart.

14 years agodaemon: Refactor code.
Ben Pfaff [Fri, 15 Jan 2010 23:29:52 +0000 (15:29 -0800)]
daemon: Refactor code.

This commit should not change behavior, but it paves the way for
implementing --monitor in the following commit.

14 years agotests: New macro OVS_WAIT_WHILE.
Ben Pfaff [Fri, 15 Jan 2010 20:12:51 +0000 (12:12 -0800)]
tests: New macro OVS_WAIT_WHILE.

For use by upcoming tests.

14 years agotests: Factor OVSDB_INIT out of OVS_VSCTL_SETUP for other tests to use.
Ben Pfaff [Fri, 15 Jan 2010 20:12:36 +0000 (12:12 -0800)]
tests: Factor OVSDB_INIT out of OVS_VSCTL_SETUP for other tests to use.

New tests in upcoming commits will use this.

14 years agofatal-signal: After fork, clear hooks instead of disabling them.
Ben Pfaff [Fri, 15 Jan 2010 23:28:14 +0000 (15:28 -0800)]
fatal-signal: After fork, clear hooks instead of disabling them.

Until now, fatal_signal_fork() has simply disabled all the fatal signal
callback hooks.  This worked fine, because a daemon process forked only
once and the parent didn't do much before it exited.

But upcoming commits will introduce a --monitor option, which requires
processes to fork multiple times.  Sometimes the parent process will fork,
then run for a while, then fork again.  It's not good to disable the
hooks in the child process in such a case, because that prevents e.g.
pidfiles from being removed at the child's exit.

So this commit changes the semantics of fatal_signal_fork() to just
clearing out hooks.  After hooks are cleared, new hooks can be added and
will be executed on process termination in the usual way.

This commit also introduces a cancellation callback function so that a
canceled hook can free resources.

14 years agounixctl: Avoid double error reporting.
Ben Pfaff [Fri, 15 Jan 2010 18:31:57 +0000 (10:31 -0800)]
unixctl: Avoid double error reporting.

All of these programs were re-reporting an error that
unixctl_server_create() had already reported.  There's no need for that.

14 years agounixctl: Improve error reporting.
Ben Pfaff [Fri, 15 Jan 2010 18:31:06 +0000 (10:31 -0800)]
unixctl: Improve error reporting.

The ovs_error() function is our standard way of reporting startup errors,
so use it.  (It also outputs the program name at the beginning of the
message.)

14 years agotests: Improve error reporting for timeval test failures.
Ben Pfaff [Fri, 15 Jan 2010 18:26:20 +0000 (10:26 -0800)]
tests: Improve error reporting for timeval test failures.

14 years agonetdev: Fix build for switchui.
Jesse Gross [Fri, 15 Jan 2010 16:48:29 +0000 (11:48 -0500)]
netdev: Fix build for switchui.

14 years agoxenserver: Give ovs-vsctl a bit more time to do its work
Justin Pettit [Fri, 15 Jan 2010 16:33:03 +0000 (08:33 -0800)]
xenserver: Give ovs-vsctl a bit more time to do its work

Creating bonds sometimes fails due to ovs-vsctl timing out.  This commit
increases the time interface-reconfigure gives ovs-vsctl from five to
twenty seconds.  We should investigate why it's taking ovs-vsctl so
long, but this helps for now.

14 years agonetdev-linux: Cleanup tap netdev.
Jesse Gross [Tue, 12 Jan 2010 20:58:40 +0000 (15:58 -0500)]
netdev-linux: Cleanup tap netdev.

TAP devices need to be treated slightly differently from other other
devices because they cannot be opened multiple times.  Instead we
open them once and share the file descriptor.  This means that if
the netdev is opened multiple times one reader can drain the buffers
of another.  While this is a deviation from the normal convention,
it does not impact current or planned users.

In addition, this cleans up some confusion between the file
descriptor for tap devices versus other FD's.

14 years agogre: Add support for destroying GRE devices.
Jesse Gross [Tue, 12 Jan 2010 00:00:17 +0000 (19:00 -0500)]
gre: Add support for destroying GRE devices.

This allows GRE tunnel devices to be torn down on graceful exit
of vswitch and cleaned up on restart for non-graceful exits.

14 years agonetdev: Fully handle netdev lifecycle through refcounting.
Jesse Gross [Tue, 12 Jan 2010 21:01:43 +0000 (16:01 -0500)]
netdev: Fully handle netdev lifecycle through refcounting.

This builds on earlier work that implemented netdev object refcounting.
However, rather than requiring explicit create and destroy calls,
these operations are now performed automatically based on the referenece
count.  This is important because in certain situations it is not
possible to know whether a netdev has already been created.  A
workaround existed (which looked fairly similar to this paradigm) but
introduced it's own issues.  This simplifies and unifies the API.

14 years agoovs-vsctl: Add option to create fake iface when adding a bond
Justin Pettit [Fri, 15 Jan 2010 05:53:43 +0000 (21:53 -0800)]
ovs-vsctl: Add option to create fake iface when adding a bond

Some systems, such as XenServer, expect that bonds have their own interface.
This commit adds the ability to do that with the "--fake-iface" option
in ovs-vsctl's add-bond command.  It also has XenServer's
interface-reconfigure use it.

Part of solution to Bug #2376

14 years agogre: Workarounds for large packets over GRE
Jesse Gross [Fri, 15 Jan 2010 01:58:20 +0000 (20:58 -0500)]
gre: Workarounds for large packets over GRE

The first change is to not propagate the IP DF bit from the inner
packet to the outer packet.  Large TCP packets can get segmented
first which will set the DF bit.  However these segmented packets
might still be too large after the GRE header is added, requiring
fragmentation.

The second change is to raise the MTU of the GRE tunnel device.
This prevents packets from being dropped in the datapath before
they can be fragmented.  Since the datapath is layer 2 it does not
do any fragmentation and drops any packets that are too large.

Both of these are temporary workarounds that need to be addressed
more carefully in the future.

Bug #2379

14 years agoRelease Open vSwitch 0.99.0.
Justin Pettit [Fri, 15 Jan 2010 07:24:09 +0000 (23:24 -0800)]
Release Open vSwitch 0.99.0.

This is an "unstable" release.

14 years agoovs-vsctl: Don't mask timeout argument
Justin Pettit [Fri, 15 Jan 2010 02:06:33 +0000 (18:06 -0800)]
ovs-vsctl: Don't mask timeout argument

ovs-vsctl supports the "--timeout" option, which specifies the amount
of time that the operation is allowed to take before a SIGALRM is
raised.  The code that parsed options had a local "timeout" that masked
the global one that was supposed to be set.

14 years agobonding: Use device names instead of Xen OpaqueRefs
Jesse Gross [Wed, 13 Jan 2010 22:43:09 +0000 (17:43 -0500)]
bonding: Use device names instead of Xen OpaqueRefs

When configuring the slaves of a bond, interface-reconfigure was
directly writing the Xen OpaqueRef as the name instead of first
converting it into a standard device name.

Bug #2377

14 years agoovsdb: Provide helper function to determine if IDL has ever connected
Justin Pettit [Thu, 14 Jan 2010 21:10:35 +0000 (13:10 -0800)]
ovsdb: Provide helper function to determine if IDL has ever connected

14 years agoovs-brcompatd: Don't consume CPU if can't connect to config db
Justin Pettit [Thu, 14 Jan 2010 20:20:09 +0000 (12:20 -0800)]
ovs-brcompatd: Don't consume CPU if can't connect to config db

When ovs-brcompatd can't connect to the database, the "ovs" variable
is never set.  The function "brc_recv_update" takes care of draining
brcompat kernel module's netlink messages.  When the netlink message
comes in to modify the bridge, that function never gets called, so a
netlink message always appears to be ready and we consume 100% CPU
looping.

With this commit, we log a warning and drop the request on the floor.

Bug #2373

14 years agodatapath: Disable preemption updating per-CPU data in dp_dev_recv().
Ben Pfaff [Wed, 13 Jan 2010 18:43:31 +0000 (10:43 -0800)]
datapath: Disable preemption updating per-CPU data in dp_dev_recv().

dp_dev_recv() is called from do_output(), which can be called from
execute_actions(), which can be called from process context with
preemption enabled, so it needs to disabled preemption before it can
access per-CPU data.

Build tested on a few different kernels.

Bug #2316.

Reported-by: John Galgay <john@galgay.net>
CC: Dan Wendlandt <dan@nicira.com>
14 years agoovsdb-client: Fix regression introduced with changes to daemonize().
Ben Pfaff [Wed, 13 Jan 2010 17:55:52 +0000 (09:55 -0800)]
ovsdb-client: Fix regression introduced with changes to daemonize().

daemonize() now closes the standard file descriptors, but ovsdb-client's
"monitor" command uses stdout even after daemonizing.  This caused
tests that used "ovsdb-client --detach monitor" to fail without printing
their complete output.  This commit fixes the problem.

14 years agodaemon: Close standard file descriptors when daemonizing.
Ben Pfaff [Tue, 12 Jan 2010 22:10:11 +0000 (14:10 -0800)]
daemon: Close standard file descriptors when daemonizing.

Before SSH terminates, it waits for the PTYs that it creates for use as
stdin, stdout, and stderr to be closed.  When any of the Open vSwitch
daemons were started in the background over an SSH session, they held
those file descriptors open and thus the SSH session hung.  This commit
fixes the problem by closing those file descriptors, allowing SSH to
terminate.

14 years agoxenserver: Make BRCOMPATD_MEMLEAK_LOGFILE setting work.
Ben Pfaff [Tue, 12 Jan 2010 18:57:12 +0000 (10:57 -0800)]
xenserver: Make BRCOMPATD_MEMLEAK_LOGFILE setting work.

Sometimes it's too bad that shell variables don't need declarations.

14 years agoovsdb-idl: Fix memory leak committing a no-op transaction.
Ben Pfaff [Tue, 12 Jan 2010 18:51:52 +0000 (10:51 -0800)]
ovsdb-idl: Fix memory leak committing a no-op transaction.

Partial fix for bug #2373.

14 years agojsonrpc: Fix memory leak in jsonrpc_session_send() when not connected.
Ben Pfaff [Tue, 12 Jan 2010 18:51:30 +0000 (10:51 -0800)]
jsonrpc: Fix memory leak in jsonrpc_session_send() when not connected.

Partial fix for bug #2373.

14 years agovswitchd: Fix issue of networking not working when Tools not installed
Justin Pettit [Tue, 12 Jan 2010 02:36:56 +0000 (18:36 -0800)]
vswitchd: Fix issue of networking not working when Tools not installed

During the transition to the configuration database, not all code from
the bridge compatibility layer was updated.  In particular, the code
which removes port configuration based on RTNL notifications of port
removal was not updated.  This commit brings that code back.

Note that the code that removes ports based on actively checking whether
ports exist is still commented out pending a review of its impact on GRE
support.

Bug #2370

14 years agoovs-vsctl: Print correct fail-mode
Justin Pettit [Tue, 12 Jan 2010 00:57:29 +0000 (16:57 -0800)]
ovs-vsctl: Print correct fail-mode

When printing the fail-mode, ovs-vsctl would always attempt to print the
top-level one--even if it didn't exist.  So, in addition to sometimes
being wrong, it could cause segfaults.

Thanks to Peter Balland for reporting the error.

Bug #2374

14 years agoreconnect: Fix repeated RECONNECT_CONNECT that was confusing JSON-RPC.
Ben Pfaff [Tue, 12 Jan 2010 01:00:25 +0000 (17:00 -0800)]
reconnect: Fix repeated RECONNECT_CONNECT that was confusing JSON-RPC.

reconnect_run() returns RECONNECT_CONNECT to tell the client that it should
start a new connection.  The client is then supposed to call
reconnect_connecting() to tell the FSM that it has begun a connection
attempt.  However, even after reconnect_connecting() was called,
reconnect_run() continued to return RECONNECT_CONNECT on each call until
the connection succeeded or failed.  This confused the jsonrpc_session
client, which expected that it would get a 0 return value from
reconnect_run() while the connection attempt was in progress.  Connections
that required multiple trips through the main poll loop, e.g. for SSL
negotiation, would often get cut off to start a second connection attempt.

This commit change reconnect_run() to return RECONNECT_CONNECT only until
the client tells it that a connection is in progress, which fixes the
problem.  This change entails a change to the internal details of the
reconnect FSM, so this commit also updates the reconnect tests to match.

Reported by Jeremy Stribling.

14 years agodebian: Fix tab/space issues
Justin Pettit [Mon, 11 Jan 2010 23:31:14 +0000 (15:31 -0800)]
debian: Fix tab/space issues

14 years agodebian: Create the config database if it doesn't exist on startup
Justin Pettit [Mon, 11 Jan 2010 23:20:44 +0000 (15:20 -0800)]
debian: Create the config database if it doesn't exist on startup

On startup, create an empty config database if it doesn't already exist.  This
is the behavior of the XenServer init scripts.

14 years agovswitch: Fix null pointer dereference in iface_is_internal().
Ben Pfaff [Mon, 11 Jan 2010 23:21:33 +0000 (15:21 -0800)]
vswitch: Fix null pointer dereference in iface_is_internal().

Reported by Henrik Amren.

14 years agoovsdb-tool: Make show-log command offer more verbose output.
Ben Pfaff [Mon, 11 Jan 2010 21:47:35 +0000 (13:47 -0800)]
ovsdb-tool: Make show-log command offer more verbose output.

This may be useful for debugging.

With fixes suggested by Justin Pettit.

14 years agoovsdb: Improve comments.
Ben Pfaff [Mon, 11 Jan 2010 21:30:15 +0000 (13:30 -0800)]
ovsdb: Improve comments.

Suggested by Justin Pettit.

14 years agoovsdb: Save some space in the log for newly inserted records.
Ben Pfaff [Mon, 11 Jan 2010 21:14:54 +0000 (13:14 -0800)]
ovsdb: Save some space in the log for newly inserted records.

When a new record is inserted into a database, ovsdb logs the values of all
of the fields in the record.  However, often new records have many columns
that contain default values.  There is no need to log those values, so this
commit causes them to be omitted.

As a side effect, this also makes "ovsdb-tool show-log --more --more"
output easier to read, because record insertions print less noise.  (Adding
--more --more to this command makes it print changes to database records.
The --more option will be introduced in an upcoming commit.)

14 years agoovsdb: Add tests for OVSDB protocol over SSL.
Ben Pfaff [Mon, 11 Jan 2010 21:07:11 +0000 (13:07 -0800)]
ovsdb: Add tests for OVSDB protocol over SSL.

14 years agojsonrpc: Check RPC status after trying to send, not before.
Ben Pfaff [Mon, 11 Jan 2010 21:06:42 +0000 (13:06 -0800)]
jsonrpc: Check RPC status after trying to send, not before.

This usually prevented JSON-RPC over SSL from working.

Reported-by: Jeremy Stribling <strib@nicira.com>
14 years agoovsdb: Clarify spec for map mutation insert mutator.
Ben Pfaff [Mon, 11 Jan 2010 20:03:20 +0000 (12:03 -0800)]
ovsdb: Clarify spec for map mutation insert mutator.

Suggested by Jeremy Stribling.

14 years agosflow: Improve documentation phrasing.
Ben Pfaff [Mon, 11 Jan 2010 19:13:49 +0000 (11:13 -0800)]
sflow: Improve documentation phrasing.

Suggested by Justin Pettit.

14 years agosflow: Document how the agent address is determined.
Ben Pfaff [Mon, 11 Jan 2010 19:11:03 +0000 (11:11 -0800)]
sflow: Document how the agent address is determined.

14 years agosflow: Fix byte order problem.
Ben Pfaff [Mon, 11 Jan 2010 19:10:24 +0000 (11:10 -0800)]
sflow: Fix byte order problem.

Reported by Justin Pettit.

14 years agosflow: Improve user-visible string.
Ben Pfaff [Mon, 11 Jan 2010 19:10:01 +0000 (11:10 -0800)]
sflow: Improve user-visible string.

Suggested by Justin Pettit.

14 years agosflow: Improve comments.
Ben Pfaff [Mon, 11 Jan 2010 19:09:43 +0000 (11:09 -0800)]
sflow: Improve comments.

Pointed out by Justin Pettit.

14 years agosflow: Avoid division by zero if sampling rate is 0.
Ben Pfaff [Mon, 11 Jan 2010 19:09:14 +0000 (11:09 -0800)]
sflow: Avoid division by zero if sampling rate is 0.

Reported by Justin Pettit.

14 years agosflow: Fix ifDirection setting if duplex unknown.
Ben Pfaff [Mon, 11 Jan 2010 19:08:29 +0000 (11:08 -0800)]
sflow: Fix ifDirection setting if duplex unknown.

Reported by Justin Pettit.

14 years agosflow: Fix handling of struct ofproto_sflow_options members.
Ben Pfaff [Mon, 11 Jan 2010 19:07:59 +0000 (11:07 -0800)]
sflow: Fix handling of struct ofproto_sflow_options members.

Reported by Justin Pettit.

14 years agodatapath: Improve comments.
Ben Pfaff [Mon, 11 Jan 2010 19:06:56 +0000 (11:06 -0800)]
datapath: Improve comments.

14 years agodpif: Remove stray new-line.
Ben Pfaff [Mon, 11 Jan 2010 19:06:36 +0000 (11:06 -0800)]
dpif: Remove stray new-line.

Suggested by Justin Pettit.

14 years agoxenserver: Fix init script with multiple --remote options to ovsdb-server.
Ben Pfaff [Mon, 11 Jan 2010 18:04:13 +0000 (10:04 -0800)]
xenserver: Fix init script with multiple --remote options to ovsdb-server.

Reported-by: Peter Balland <peter@nicira.com>
14 years agodatapath: Renumber ioctls to avoid gaps.
Ben Pfaff [Sat, 9 Jan 2010 00:46:03 +0000 (16:46 -0800)]
datapath: Renumber ioctls to avoid gaps.

Suggested by Justin Pettit.

14 years agoImprove comments on interpretation of sFlow sampling probabilities.
Ben Pfaff [Sat, 9 Jan 2010 00:44:43 +0000 (16:44 -0800)]
Improve comments on interpretation of sFlow sampling probabilities.

Suggested by Justin Pettit.

14 years agodatapath: Improve comments on struct dp_stats_percpu.
Ben Pfaff [Sat, 9 Jan 2010 00:45:14 +0000 (16:45 -0800)]
datapath: Improve comments on struct dp_stats_percpu.

Suggested by Justin Pettit.

14 years agosflow: Write "sFlow" as "sFlow(R)" in documentation.
Ben Pfaff [Sat, 9 Jan 2010 00:45:02 +0000 (16:45 -0800)]
sflow: Write "sFlow" as "sFlow(R)" in documentation.

The sFlow license requires sFlow to be written as sFlow(R) for the first
reference in user documentation, so this commit implements that.

Suggested by Justin Pettit.

14 years agosflow: Set proper output port number for dropped packets.
Ben Pfaff [Sat, 9 Jan 2010 00:10:01 +0000 (16:10 -0800)]
sflow: Set proper output port number for dropped packets.

Based on advice from Neil McKee.

14 years agosflow: Report port ifIndexes instead of datapath port numbers.
Ben Pfaff [Wed, 6 Jan 2010 18:24:52 +0000 (10:24 -0800)]
sflow: Report port ifIndexes instead of datapath port numbers.

Reported-by: Neil McKee <neil.mckee@inmon.com>
14 years agojsonrpc: Properly implement connection timeout.
Ben Pfaff [Fri, 8 Jan 2010 23:36:06 +0000 (15:36 -0800)]
jsonrpc: Properly implement connection timeout.

jsonrpc_session_connect() indirectly called reconnect_disconnected(), which
told the reconnect object that the connection had failed, before it told it
that the connection attempt had started.  When the connection didn't
complete immediately, this caused the connection to time out immediately,
without any backoff.

Reported by Jeremy Stribling.

14 years agodatapath: Add a find the kernel source directory for Debian 2.6.32+.
Ben Pfaff [Fri, 8 Jan 2010 21:09:10 +0000 (13:09 -0800)]
datapath: Add a find the kernel source directory for Debian 2.6.32+.

Debian's kernel-headers packages starting from 2.6.32 (or thereabouts) put
links to the kernel build and source directories at the same level, named
"build" and "source" respectively.  Add support for this structure.

14 years agoxenserver: Fix fallout from removing remote command execution.
Ben Pfaff [Fri, 8 Jan 2010 18:41:48 +0000 (10:41 -0800)]
xenserver: Fix fallout from removing remote command execution.

Commit 2280e7223 "ofproto: Drop remote command execution feature." removed
the remote command execution feature from the vswitch.  This commit removes
one bit that was overlooked.

14 years agoconfigure: Fix indentation.
Ben Pfaff [Fri, 8 Jan 2010 18:02:49 +0000 (10:02 -0800)]
configure: Fix indentation.

14 years agotests: Make test-vconn build and pass tests without OpenSSL.
Ben Pfaff [Fri, 8 Jan 2010 18:01:27 +0000 (10:01 -0800)]
tests: Make test-vconn build and pass tests without OpenSSL.

14 years agotests: Improve vconn tests.
Ben Pfaff [Fri, 8 Jan 2010 17:41:29 +0000 (09:41 -0800)]
tests: Improve vconn tests.

14 years agostream-ssl: Fix bug that crept in during rebasing.
Ben Pfaff [Fri, 8 Jan 2010 17:40:45 +0000 (09:40 -0800)]
stream-ssl: Fix bug that crept in during rebasing.

14 years agoDistribute some forgotten files that are needed by "make check".
Ben Pfaff [Fri, 8 Jan 2010 00:11:28 +0000 (16:11 -0800)]
Distribute some forgotten files that are needed by "make check".

14 years agovconn: Test SSL vconns too.
Ben Pfaff [Thu, 7 Jan 2010 22:00:58 +0000 (14:00 -0800)]
vconn: Test SSL vconns too.

This test should help avoid simple bugs in the SSL vconn and SSL stream
implementations in the future.  It would have found the bugs fixed by
recent commits.

14 years agostream: Really enable SSL streams.
Ben Pfaff [Thu, 7 Jan 2010 21:59:44 +0000 (13:59 -0800)]
stream: Really enable SSL streams.

SSL streams were supposed to work, but they didn't.  Oops.

14 years agostream-ssl: Fix ssl_recv() and ssl_send() return value semantics.
Ben Pfaff [Thu, 7 Jan 2010 21:58:49 +0000 (13:58 -0800)]
stream-ssl: Fix ssl_recv() and ssl_send() return value semantics.

These functions' return value semantics did not match those documented
in stream-provider.h.

14 years agostream-ssl: Try to shut SSL connections down gracefully.
Ben Pfaff [Thu, 7 Jan 2010 21:57:53 +0000 (13:57 -0800)]
stream-ssl: Try to shut SSL connections down gracefully.

It's nice to shut down SSL connections gracefully when we can.