openvswitch
14 years agoovsdb: Add replication support and refactor files in terms of replication.
Ben Pfaff [Fri, 13 Nov 2009 21:37:55 +0000 (13:37 -0800)]
ovsdb: Add replication support and refactor files in terms of replication.

An upcoming commit will add support for replicating tables across JSON-RPC
connection.  As a prerequisite ovsdb itself must support basic replication.
This commit adds that support and then reimplements the ovsdb file storage
in terms of that replication.

14 years agoovsdb: Rename ovsdb_file to ovsdb_log.
Ben Pfaff [Fri, 13 Nov 2009 21:23:35 +0000 (13:23 -0800)]
ovsdb: Rename ovsdb_file to ovsdb_log.

This prepares for introducing a new, higher-level ovsdb_file that
encapsulates ovsdb storage in a file.

14 years agoovsdb: Fix use of non-array for JSON-RPC parameters.
Ben Pfaff [Fri, 13 Nov 2009 23:05:19 +0000 (15:05 -0800)]
ovsdb: Fix use of non-array for JSON-RPC parameters.

JSON-RPC requires that "params" be an array, but we weren't observing this
properly in the ovsdb specifications or code.

Thanks to Jeremy Stribling for pointing out the problem.

14 years agoovsdb-parser: Fix indentation.
Ben Pfaff [Mon, 16 Nov 2009 17:19:36 +0000 (09:19 -0800)]
ovsdb-parser: Fix indentation.

14 years agoofproto: Update time of super-rule to match sub-rule
Justin Pettit [Sat, 14 Nov 2009 02:53:28 +0000 (18:53 -0800)]
ofproto: Update time of super-rule to match sub-rule

Rules keep track of their creation and last used time.  When a sub-rule
is updated, it wasn't updating the time of its super-rule.  This commit
fixes that behavior.

Thanks to Jesse Gross for the help tracking this down.

14 years agoovs-openflowd: Setup default listener
Justin Pettit [Fri, 13 Nov 2009 23:51:44 +0000 (15:51 -0800)]
ovs-openflowd: Setup default listener

By default, ovs-openflowd was not listening for any management
connections.  Tools such as ovs-ofctl attempt to use a default location
based on the datapath name.  This change creates that default listener.

14 years agoofproto: Don't send OpenFlow flow expirations hidden rules.
Jesse Gross [Fri, 13 Nov 2009 01:41:58 +0000 (17:41 -0800)]
ofproto: Don't send OpenFlow flow expirations hidden rules.

We were reporting flow expirations for the hidden exact match flows
with the stats set to zero.  These are an implementation detail and
can confuse controllers, so don't report them.

CC: David Erickson <derickso@stanford.edu>
14 years agoofproto: Distinguish stats from before and after action changes.
Jesse Gross [Thu, 12 Nov 2009 23:58:18 +0000 (15:58 -0800)]
ofproto: Distinguish stats from before and after action changes.

When a rule is revalidated and the actions change don't lump all
the stats together.  This will clear the stats in the datapath
and send a NetFlow expiration message.  This could already happen
before in certain circumstances so this change makes it more
consistent.

14 years agoofproto: Correct structure length assertion for ofp_action_vlan_pcp
Justin Pettit [Fri, 13 Nov 2009 19:15:35 +0000 (11:15 -0800)]
ofproto: Correct structure length assertion for ofp_action_vlan_pcp

14 years agoxenserver: interface-reconfigure and vif hotplug relicensing.
Ian Campbell [Tue, 10 Nov 2009 09:23:51 +0000 (09:23 +0000)]
xenserver: interface-reconfigure and vif hotplug relicensing.

As part of the Open Sourcing of xapi (the XenServer toolstack) via the
XenCloud project (announcement in [0]). The upstream versions of
interface-reconfigure and the vif hotplug script have been re-licensed
under an LGPL v2.1 + exception license. The exception applies to other
files in the upstream repository and doesn't particularly make sense for
these scripts but it is included to maintain the uniformity of the
license for the upstream repository.

This patch synchronises the licenses headers on those scripts with the
upstream version. Since those headers refer to a file called LICENSE in
the upstream repository I have included a copy here, slightly modified
to indicate precisely which files it applies to.

Git shows[1] that only myself and Nicira employees have made
modifications to these scripts in the openvswitch repository. The
licensing change has been okayed by Keith Amidon on behalf of Nicira.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
[0]
http://lists.xensource.com/archives/html/xen-devel/2009-11/msg00117.html

14 years agoofp-print: Add missing error types
Justin Pettit [Thu, 12 Nov 2009 23:46:35 +0000 (15:46 -0800)]
ofp-print: Add missing error types

14 years agoofproto: Correctly credit stats for displaced rules.
Jesse Gross [Thu, 12 Nov 2009 20:44:44 +0000 (12:44 -0800)]
ofproto: Correctly credit stats for displaced rules.

When a rule displaces another, we are supposed to credit the stats
for packets that have already been processed to the displaced rule
before we eject it from the datapath.  However, we were instead
crediting the new rule.

14 years agoovsdb-client: Support listening for incoming connections too.
Ben Pfaff [Thu, 12 Nov 2009 20:53:05 +0000 (12:53 -0800)]
ovsdb-client: Support listening for incoming connections too.

This makes it easier to test ovsdb-server's support for active connections.
It might also be useful occasionally, too.

14 years agoovsdb-server: Reconnect to clients specified on --connect.
Ben Pfaff [Thu, 12 Nov 2009 20:58:53 +0000 (12:58 -0800)]
ovsdb-server: Reconnect to clients specified on --connect.

14 years agostream: New function pstream_accept_block().
Ben Pfaff [Thu, 12 Nov 2009 20:52:12 +0000 (12:52 -0800)]
stream: New function pstream_accept_block().

14 years agoNew "reconnect" library for managing network connection attempts.
Ben Pfaff [Tue, 10 Nov 2009 23:30:49 +0000 (15:30 -0800)]
New "reconnect" library for managing network connection attempts.

This library implements the reconnection FSM used by the "rconn" library.
Therefore, it makes sense to change rconn to use this, and I have a patch
to do that, but I am not applying it at the moment to avoid changing unrelated
code on the "db" branch.

14 years agosvec: New function svec_is_empty().
Ben Pfaff [Tue, 10 Nov 2009 23:31:03 +0000 (15:31 -0800)]
svec: New function svec_is_empty().

14 years agovswitch: Only one Open vSwitch daemon is supported per database.
Ben Pfaff [Thu, 12 Nov 2009 20:55:40 +0000 (12:55 -0800)]
vswitch: Only one Open vSwitch daemon is supported per database.

14 years agobridge: Fix segfault when updating learning table for deleted port.
Jesse Gross [Thu, 12 Nov 2009 01:05:22 +0000 (17:05 -0800)]
bridge: Fix segfault when updating learning table for deleted port.

A function call using in_port was accidentally moved before the check
to see if it is null.  in_port can be null if a port was deleted but
an update is still pending.  This moves the call after the check.

Bug #2313

14 years agomirroring: Preserve key for disabling learning.
Jesse Gross [Wed, 11 Nov 2009 22:48:48 +0000 (14:48 -0800)]
mirroring: Preserve key for disabling learning.

Don't delete the key for disabling MAC learning on a given VLAN
after a reboot.  Also logs when learning is disabled.

14 years agobridge: Feed flow stats into learning table.
Jesse Gross [Wed, 11 Nov 2009 21:06:16 +0000 (13:06 -0800)]
bridge: Feed flow stats into learning table.

Update the learning table to keep it current with flows actually
going through the datapath.  This ensures that entries do not age
out when they are actively being used.

Feature #2209

14 years agoofproto: Update stats for exact match flows before expiration.
Jesse Gross [Wed, 11 Nov 2009 19:13:37 +0000 (11:13 -0800)]
ofproto: Update stats for exact match flows before expiration.

When a wildcarded flow is expired we remove all of the subrules to
collect their stats before sending a flow expiration message.  However,
we were only removing exact match flows after the expiration message
is composed.  This uninstalls it first.

CC: David Erickson <derickso@stanford.edu>
14 years agoMerge citrix branch into master.
Jesse Gross [Tue, 10 Nov 2009 23:12:01 +0000 (15:12 -0800)]
Merge citrix branch into master.

14 years agomirroring: Allow learning to be disabled on a VLAN.
Jesse Gross [Sat, 7 Nov 2009 01:13:51 +0000 (17:13 -0800)]
mirroring: Allow learning to be disabled on a VLAN.

RSPAN does not work properly unless MAC learning for the VLAN is
disabled on all switches between the origin and monitoring point.
This allows learning to be disabled on a given VLAN so vSwitch can
acts as an intermediate switch.

Feature #2136

14 years agobridge: Require learning table at all times.
Jesse Gross [Mon, 9 Nov 2009 23:26:51 +0000 (15:26 -0800)]
bridge: Require learning table at all times.

The bridge nominally allowed the MAC learning module to not be enabled
though in reality it was always used.  Tracking active MAC addresses
in the bridge is useful for other reasons besides deciding the output
port - primarily for bonding.  In addition there were several bugs
that would have been triggered had learning actually been disabled since
that code path is never tested.  This makes it explicit that the learning
table should be maintained at all times.

14 years agovconn: Clean-up "match" typo in comments
Justin Pettit [Tue, 10 Nov 2009 00:06:52 +0000 (16:06 -0800)]
vconn: Clean-up "match" typo in comments

A few comments referenced "m", when "match" was clearly meant.  This was
likely due to a quick search and replace that scooped up these comments
along with the intended code.  This cleans that up.

14 years agoovs-vsctl: Capitalize names of global constants but not variables.
Ben Pfaff [Mon, 9 Nov 2009 23:02:05 +0000 (15:02 -0800)]
ovs-vsctl: Capitalize names of global constants but not variables.

Conforms to the Google style guide for Python.

Reported by Justin.

14 years agoMake ovs-appctl easier to use and synchronize its interface with ovs-vsctl.
Ben Pfaff [Mon, 9 Nov 2009 22:46:38 +0000 (14:46 -0800)]
Make ovs-appctl easier to use and synchronize its interface with ovs-vsctl.

It is inconvenient to type the whole path to the Unix daemon socket when
using ovs-appctl.  Allow the name of the daemon to be used instead when
a pidfile exists in the default location, and contact ovs-vswitchd by
default.

Also, the various options for manipulating vlog were invented before the
general-purpose command mechanism existed.  Get rid of all of the action
options in favor of just specifying the command to be executed as
non-option arguments.

Finally, there simply wasn't much value in allowing multiple targets or
options to be specified; these variations were never used in practice.  So
simplify the interface by making it one target, one action per invocation.

Also, make ovs-vsctl use the same syntax for its --target option.

Based on work by Justin Pettit.

14 years agobonding: Ignore updelay if there is no active slave.
Jesse Gross [Wed, 4 Nov 2009 21:48:41 +0000 (13:48 -0800)]
bonding: Ignore updelay if there is no active slave.

If all slaves on a bond are down but some are waiting for an updelay,
enable the slave with the shortest amount of delay remaining.  This
would already occur if all other slaves were disabled at the time the
delay was to begin but not if a delay was already in progress.  This
also immediately sends learning packets out in both situations, which
prevents incoming packets to disabled slaves from being blackholed.

CC: Danny Wannagat <Danny.Wannagat@eu.citrix.com>
14 years agoFix incorrect printf format specifiers.
Ben Pfaff [Fri, 6 Nov 2009 18:43:50 +0000 (10:43 -0800)]
Fix incorrect printf format specifiers.

GCC reported these during a 64-bit build.

14 years agobacktrace: Avoid GCC warning on x86-64.
Ben Pfaff [Fri, 6 Nov 2009 18:25:50 +0000 (10:25 -0800)]
backtrace: Avoid GCC warning on x86-64.

The portable implementation of stack_low(), which before this commit is
used on x86-64, provokes a warning from GCC that cannot be disabled.  We
already have an i386-specific implementation that does not warn; this
commit adds a corresponding implementation for x86-64 to avoid the warning
there too.

14 years agobacktrace: Suppress dumb GCC warning on x86-64.
Ben Pfaff [Fri, 6 Nov 2009 18:22:55 +0000 (10:22 -0800)]
backtrace: Suppress dumb GCC warning on x86-64.

Without this change GCC warns "use of assignment suppression and length
modifier together in scanf format", which doesn't actually point out any
real problem (and why would it?  Google turns up nothing interesting).

14 years agoovsdb: Add new ovsdb-client program.
Ben Pfaff [Fri, 6 Nov 2009 23:35:34 +0000 (15:35 -0800)]
ovsdb: Add new ovsdb-client program.

14 years agoovsdb: Add documentation for ovsdb-server and ovsdb-tool programs.
Ben Pfaff [Fri, 6 Nov 2009 23:35:10 +0000 (15:35 -0800)]
ovsdb: Add documentation for ovsdb-server and ovsdb-tool programs.

14 years agoovsdb: Improve error message for transaction that uses unknown operation.
Ben Pfaff [Fri, 6 Nov 2009 23:33:25 +0000 (15:33 -0800)]
ovsdb: Improve error message for transaction that uses unknown operation.

Without this commit, misspelling an operation name provokes a mysterious
error message.

14 years agoDon't try to distribute file that doesn't exist.
Ben Pfaff [Fri, 6 Nov 2009 23:28:59 +0000 (15:28 -0800)]
Don't try to distribute file that doesn't exist.

lib/ovsdb-client.h was in my source tree at one point but was never checked
in.

Fixes "make dist".

14 years agoovsdb: Fix inverted logic in ovsdb_open().
Ben Pfaff [Fri, 6 Nov 2009 21:38:00 +0000 (13:38 -0800)]
ovsdb: Fix inverted logic in ovsdb_open().

We want ovsdb_create() (and thus, the open database) to receive the file
only if it is a read-write database.  If it is read-only, then there is
no need to keep the file around, since we will never read or write it
after opening the database.

14 years agoovsdb: Fix use-after-free error in ovsdb_destroy().
Ben Pfaff [Fri, 6 Nov 2009 21:36:41 +0000 (13:36 -0800)]
ovsdb: Fix use-after-free error in ovsdb_destroy().

14 years agoovsdb-server: Remove unixctl transaction support.
Ben Pfaff [Fri, 6 Nov 2009 21:36:17 +0000 (13:36 -0800)]
ovsdb-server: Remove unixctl transaction support.

Executing transactions over JSON-RPC makes more sense, now that it is
supported, so remove the older support for unixctl.

14 years agoovsdb-tool: Make "query" and "transact" commands work properly.
Ben Pfaff [Fri, 6 Nov 2009 21:35:32 +0000 (13:35 -0800)]
ovsdb-tool: Make "query" and "transact" commands work properly.

These were passing O_RDONLY or O_RDWR as arguments to a function that
expected "true" or "false", respectively.

14 years agoudatapath: Implement ZERO_TCP_FLAGS option.
Jesse Gross [Fri, 6 Nov 2009 22:18:58 +0000 (14:18 -0800)]
udatapath: Implement ZERO_TCP_FLAGS option.

An option to zero the TCP flags when querying flow stats was added
to the kernel datapath to support NetFlow active timeouts.  This
adds that same support to the user datapath.

14 years agonetflow: Only query stats of installed flows.
Jesse Gross [Fri, 6 Nov 2009 21:26:42 +0000 (13:26 -0800)]
netflow: Only query stats of installed flows.

NetFlow active timeouts was querying the stats of all exact match
flows that had reached a certain age including those that could
not be installed.  This was not harmful but it was wasteful and
produced log spew.  This changes it to only query the flows that
are actually installed.

Bug #2252

14 years agodatapath: Allow TCP flags to be cleared.
Jesse Gross [Wed, 28 Oct 2009 21:36:52 +0000 (14:36 -0700)]
datapath: Allow TCP flags to be cleared.

When querying flow stats allow the TCP flags to be reset.  Since
the datapath ORs together all flags that have previously been
seen it is otherwise impossible to determine the set of flags from
after a particular time.

14 years agoovsdb: Make JSON-RPC sessions other than the first work.
Ben Pfaff [Fri, 6 Nov 2009 20:26:00 +0000 (12:26 -0800)]
ovsdb: Make JSON-RPC sessions other than the first work.

The number of open sessions wasn't being tracked properly, so closing a
JSON-RPC database session made it impossible to open any more.

14 years agojson: Make json_equal() compare objects correctly.
Ben Pfaff [Fri, 6 Nov 2009 20:24:44 +0000 (12:24 -0800)]
json: Make json_equal() compare objects correctly.

The previous code checked only that JSON objects have members with the
same names.  This commit makes json_equal() also check that like-named
members have the same values.

14 years agoovsdb: Fix bug in JSON-RPC server.
Jeremy Stribling [Fri, 6 Nov 2009 18:54:16 +0000 (10:54 -0800)]
ovsdb: Fix bug in JSON-RPC server.

14 years agovswitch: First try at an OVSDB schema.
Ben Pfaff [Thu, 5 Nov 2009 19:32:44 +0000 (11:32 -0800)]
vswitch: First try at an OVSDB schema.

14 years agoRevert "ovs-ofctl: Fix use-after-free error in del-flows command."
Jean Tourrilhes [Thu, 5 Nov 2009 07:40:18 +0000 (23:40 -0800)]
Revert "ovs-ofctl: Fix use-after-free error in del-flows command."

This reverts commit cae7a4b90a55cbfd4cfd23c06f9f09cd429ab4c0.

This commit forced the user to specify an action when deleting a flow,
which is not desirable.  The change was not actually needed, as the
buffer is never passed to str_to_flow() in the original code.

14 years agoInitial implementation of OVSDB.
Ben Pfaff [Wed, 4 Nov 2009 23:11:44 +0000 (15:11 -0800)]
Initial implementation of OVSDB.

14 years agoImplement JSON-RPC protocol.
Ben Pfaff [Mon, 26 Oct 2009 22:04:05 +0000 (15:04 -0700)]
Implement JSON-RPC protocol.

14 years agobyteq: Move from extras/ezio into lib and export some private functions.
Ben Pfaff [Wed, 28 Oct 2009 18:06:31 +0000 (11:06 -0700)]
byteq: Move from extras/ezio into lib and export some private functions.

The upcoming JSON-RPC library wants to use this library, and it needs some
functions that are currently declared static.

14 years agostream: New library for bidirectional streams (e.g. TCP, SSL, Unix sockets).
Ben Pfaff [Wed, 4 Nov 2009 23:02:32 +0000 (15:02 -0800)]
stream: New library for bidirectional streams (e.g. TCP, SSL, Unix sockets).

This code is heavily based on the vconn code.  Eventually we should make
the stream-based vconns (currently that's all of them) a wrapper around
streams, but I haven't done that yet.

SSL is not implemented yet.

14 years agosocket-util: Make TCP open function support no default port.
Ben Pfaff [Wed, 28 Oct 2009 22:20:42 +0000 (15:20 -0700)]
socket-util: Make TCP open function support no default port.

Until now, tcp_open_active() and tcp_open_passive() have only been used
in situations where there is a reasonable default port, e.g. OFP_TCP_PORT.
But now, in the upcoming JSON-RPC library and underlying stream library,
there is no reasonable default, so enhance these functions so that they
can require the user to specify a port explicitly.

14 years agoFactor out common code from utilities that multiplex commands.
Ben Pfaff [Fri, 23 Oct 2009 18:49:39 +0000 (11:49 -0700)]
Factor out common code from utilities that multiplex commands.

An upcoming commit will add yet another such utility and the code
redundancy was getting to be a bit much.

14 years agoNew dir_name() function plus tests.
Ben Pfaff [Mon, 19 Oct 2009 21:04:14 +0000 (14:04 -0700)]
New dir_name() function plus tests.

14 years agoutil: Make ovs_error() understand that EOF means "end of file".
Ben Pfaff [Wed, 28 Oct 2009 18:11:18 +0000 (11:11 -0700)]
util: Make ovs_error() understand that EOF means "end of file".

This convention is in use in a few places in the source tree, and so it
seems to be about time to start putting it into central places.

14 years agoImplement RFC 4122-compliant UUIDs.
Ben Pfaff [Thu, 24 Sep 2009 22:02:36 +0000 (15:02 -0700)]
Implement RFC 4122-compliant UUIDs.

This UUID library will be used by the upcoming configuration database.

14 years agoImplement JSON parsing and serialization.
Ben Pfaff [Wed, 4 Nov 2009 22:55:53 +0000 (14:55 -0800)]
Implement JSON parsing and serialization.

This will be used by the upcoming Open vSwitch configuration database.

14 years agosha1: Add functions, macros for converting digests to and from strings.
Ben Pfaff [Wed, 4 Nov 2009 23:12:54 +0000 (15:12 -0800)]
sha1: Add functions, macros for converting digests to and from strings.

These will be used in the upcoming OVSDB.

The SHA1_FMT and SHA1_ARGS macros are arguably absurd, but they are
also convenient.

14 years agoqueue: New function queue_is_empty().
Ben Pfaff [Wed, 28 Oct 2009 18:10:22 +0000 (11:10 -0700)]
queue: New function queue_is_empty().

14 years agoshash: New function shash_sort().
Ben Pfaff [Thu, 29 Oct 2009 21:51:25 +0000 (14:51 -0700)]
shash: New function shash_sort().

14 years agoshash: New function shash_count().
Ben Pfaff [Wed, 4 Nov 2009 22:56:03 +0000 (14:56 -0800)]
shash: New function shash_count().

14 years agoshash: New function shash_find_and_delete().
Ben Pfaff [Wed, 28 Oct 2009 18:10:36 +0000 (11:10 -0700)]
shash: New function shash_find_and_delete().

14 years agohmap: New functions, macros for iterating buckets without comparing hashes.
Ben Pfaff [Tue, 6 Oct 2009 20:31:30 +0000 (13:31 -0700)]
hmap: New functions, macros for iterating buckets without comparing hashes.

Usually, the hash comparison that HMAP_FOR_EACH_WITH_HASH does is an
optimization, because comparing a hash value is usually cheaper than
comparing an entire hash map key.  But for simple hash map keys, it makes
sense to just compare the key directly, because it avoids doing two
comparisons when a single simple comparison suffices.  This commit adds new
functions and macros to support this simple case.

14 years agohmap: Fix bug in hmap_replace().
Ben Pfaff [Tue, 3 Nov 2009 20:50:46 +0000 (12:50 -0800)]
hmap: Fix bug in hmap_replace().

When hmap_replace() replaces one hash table node by another, it must
ensure that any nodes following the old node also follow the new node,
by copying the "next" pointer from "old" to "new".

14 years agohash: Improve hash function for integers.
Ben Pfaff [Thu, 22 Oct 2009 19:58:41 +0000 (12:58 -0700)]
hash: Improve hash function for integers.

As previously defined, the following both returned the same value for
given values of 'basis':
hash_int(0, hash_int(1, basis))
hash_int(1, hash_int(0, basis))
because hash_int(0, basis) evaluated to basis and hash_int(1, basis)
evaluated to c + basis for some constant c.

This commit fixes the problem, by eliminating any simple linear
relationship between basis and the hash value.

We should write some tests for hash function quality.

14 years agohash: Implement hash function for Boolean values.
Ben Pfaff [Wed, 4 Nov 2009 23:01:00 +0000 (15:01 -0800)]
hash: Implement hash function for Boolean values.

This will be used by the configuration database, and it's generally useful
to have around.

14 years agohash: Implement hash function for "double" values.
Ben Pfaff [Thu, 15 Oct 2009 00:03:55 +0000 (17:03 -0700)]
hash: Implement hash function for "double" values.

This will be used by the configuration database, which can store real
numbers.

14 years agohash: Implement hash function for pointer values.
Ben Pfaff [Wed, 4 Nov 2009 23:00:28 +0000 (15:00 -0800)]
hash: Implement hash function for pointer values.

This will be used by an upcoming commit, and it's generally useful to
have around.

14 years agoAdd new function xzalloc(n) as a shorthand for xcalloc(1, n).
Ben Pfaff [Mon, 28 Sep 2009 20:56:42 +0000 (13:56 -0700)]
Add new function xzalloc(n) as a shorthand for xcalloc(1, n).

14 years agoovs-ofctl: Fix use-after-free error in del-flows command.
Jean Tourrilhes [Wed, 4 Nov 2009 21:21:07 +0000 (13:21 -0800)]
ovs-ofctl: Fix use-after-free error in del-flows command.

14 years agoxenserver: Fix issue with deleting network UUID on VLAN destruction
Justin Pettit [Wed, 4 Nov 2009 05:19:47 +0000 (21:19 -0800)]
xenserver: Fix issue with deleting network UUID on VLAN destruction

In XenServer, a VLAN is considered an additional network with its own
UUID.  The interface-reconfigure script properly adds this network UUID
to the configuration script, but commit 774428 removed the code that
would remove this information on VLAN destruction.  Ian Campbell was the
author of that commit and felt that reverting this part was safe.

Bug #1973

14 years agoMention running boot.sh when pulling sources from Git
Justin Pettit [Tue, 3 Nov 2009 21:56:46 +0000 (13:56 -0800)]
Mention running boot.sh when pulling sources from Git

When the sources are pulled directly from Git, it is necessary to run
"./boot.sh" before "./configure" can be run.  This commit documents that
useful bit of information.

14 years agonetflow: Implement NetFlow active timeouts.
Jesse Gross [Tue, 3 Nov 2009 20:25:29 +0000 (12:25 -0800)]
netflow: Implement NetFlow active timeouts.

Provides a NetFlow expiration message at regular intervals if the
key netflow.<br>.active-timeout is set.

Feature #1317

14 years agodatapath: Allow TCP flags to be cleared.
Jesse Gross [Wed, 28 Oct 2009 21:36:52 +0000 (14:36 -0700)]
datapath: Allow TCP flags to be cleared.

When querying flow stats allow the TCP flags to be reset.  Since
the datapath ORs together all flags that have previously been
seen it is otherwise impossible to determine the set of flags from
after a particular time.

14 years agoofproto: Only zero stats for non exact-match sub-rules.
Jesse Gross [Wed, 28 Oct 2009 23:05:57 +0000 (16:05 -0700)]
ofproto: Only zero stats for non exact-match sub-rules.

We zero the stats on sub-rules after they expire to prevent them
from being counted twice in their super-rule if they are reinstalled.
However, for exact-match sub-rules this means that the OpenFlow stats
are always zero.  This changes that to only zero the stats for
non exact match rules.

Bug #1911

14 years agodump-vif-details: Safeguard 'finally' code
Reid Price [Fri, 30 Oct 2009 19:39:14 +0000 (12:39 -0700)]
dump-vif-details:  Safeguard 'finally' code

This makes several minor streamlining changes to dump-vif-details,
and moves the try statement in dump_vif_info to exclude session
initialization, so that finally will not obscure the original exception
with a new exception related to the session variable when logins fail.

14 years agoImplement library for lockfiles and use it in cfg code.
Ben Pfaff [Wed, 14 Oct 2009 23:52:04 +0000 (16:52 -0700)]
Implement library for lockfiles and use it in cfg code.

This is useful because the upcoming configuration database also needs a
lockfile implementation.

Also adds tests.

14 years agounixctl: Allow passing auxiliary data to unixctl commands.
Ben Pfaff [Thu, 29 Oct 2009 22:20:21 +0000 (15:20 -0700)]
unixctl: Allow passing auxiliary data to unixctl commands.

This will allow users of unixctl to avoid using global variables, leading
to cleaner code.

14 years agoopenflow: Fix endian issues in flow expiration messages
Justin Pettit [Thu, 29 Oct 2009 00:15:57 +0000 (17:15 -0700)]
openflow: Fix endian issues in flow expiration messages

A few of the fields in the OpenFlow flow expiration message were being
sent in host-byte order.  This properly converts them to network.

Thanks to David Erickson for catching this!

14 years agoxenserver: Print program name on error in dump-vif-details
Justin Pettit [Wed, 28 Oct 2009 19:01:36 +0000 (12:01 -0700)]
xenserver: Print program name on error in dump-vif-details

14 years agonetflow: Populate NetFlow output interface field.
Jesse Gross [Fri, 23 Oct 2009 00:51:05 +0000 (17:51 -0700)]
netflow: Populate NetFlow output interface field.

Previously NetFlow expiration messages always contained 0 as the
output interface index.  This changes that to report the OpenFlow
interface instead.

Feature #1202

14 years agoSpell verb form of "set up" correctly throughout the tree.
Ben Pfaff [Mon, 26 Oct 2009 21:41:32 +0000 (14:41 -0700)]
Spell verb form of "set up" correctly throughout the tree.

14 years agoflow: Differentiate between "port" when printing flows
Justin Pettit [Mon, 26 Oct 2009 19:02:02 +0000 (12:02 -0700)]
flow: Differentiate between "port" when printing flows

When printing a flow, there were two references to "port": one the
interface the packet arrived on and the other the L4 ports.  This could
be a bit confusing to new users looking at the output of a command such
as "ovs-ofctl dump-flows".  This commit changes the incoming interface
field from "port" to "in_port".

14 years agoovs-vswitchd: Document "bridge/dump-flows" management command
Justin Pettit [Sat, 24 Oct 2009 22:51:31 +0000 (15:51 -0700)]
ovs-vswitchd: Document "bridge/dump-flows" management command

14 years agobridge: Allow flows based on ARP opcode to be installed.
Jesse Gross [Fri, 14 Aug 2009 21:23:44 +0000 (14:23 -0700)]
bridge: Allow flows based on ARP opcode to be installed.

Since we can now distinguish between flows with different ARP opcodes
in the kernel, allow these flows to be installed.

14 years agocfg: Fix implementation of timeout in attempting to lock the config file.
Ben Pfaff [Thu, 15 Oct 2009 17:42:59 +0000 (10:42 -0700)]
cfg: Fix implementation of timeout in attempting to lock the config file.

Without removing SA_RESTART from the SIGALRM handler, the fcntl call will
never return, even after the signal handler is invoked and returns.

We haven't seen a problem in practice, at least not recently, but that's
probably just luck combined with not holding the configuration file lock
for very long.

14 years agoAdd test to ensure that time advances both normally and in a daemon.
Ben Pfaff [Wed, 14 Oct 2009 20:14:43 +0000 (13:14 -0700)]
Add test to ensure that time advances both normally and in a daemon.

This commit adds a test to ensure that the fix that makes daemonize()
reinitialize the periodic timer actually worked.

14 years agoDistribute README-gcov, so that users building from tarballs can read it.
Ben Pfaff [Wed, 21 Oct 2009 17:44:44 +0000 (10:44 -0700)]
Distribute README-gcov, so that users building from tarballs can read it.

14 years agoMerge "citrix" into "master".
Ben Pfaff [Fri, 23 Oct 2009 00:43:28 +0000 (17:43 -0700)]
Merge "citrix" into "master".

This merge took a little bit of care due to two issues:

    - Crossport of "interface-reconfigure" fixes from master back to
      citrix that had happened and needed to be canceled out of the merge.

    - New script "refresh-xs-network-uuids" added on citrix branch that
      needed to be moved from /root/vswitch/scripts to
      /usr/share/vswitch/scripts.

14 years agobridge: Eject NORMAL flows without a learning entry from datapath.
Jesse Gross [Thu, 22 Oct 2009 18:40:04 +0000 (11:40 -0700)]
bridge: Eject NORMAL flows without a learning entry from datapath.

When revalidating NORMAL flows we consult the learning table, which
could be empty if a packet hasn't come to userspace in a while or we
just did a bridge flush.  If there is no learning entry then existing
flows will begin flooding packets until a new flow is setup.  The
problem is worse with bonding because we can receive one of the flooded
packets back on a bond slave and learn that port, causing us to send
traffic to the wrong location.

14 years agobonding: Balance bond slaves based on ratio.
Jesse Gross [Wed, 21 Oct 2009 02:26:55 +0000 (19:26 -0700)]
bonding: Balance bond slaves based on ratio.

Previously when deciding whether to migrate a hash between slaves
we would never move it if it would cause more load on the new slave
than the old.  This could lead to a situation where the slaves would
be imbalanced but no migration would occur since it would flip the
load.  This will do the migration if it will decrease the ratio.

Bug NIC-49

14 years agobonding: Drop unicast packets which have a different learned port.
Jesse Gross [Mon, 12 Oct 2009 20:09:51 +0000 (13:09 -0700)]
bonding: Drop unicast packets which have a different learned port.

Drop packets received on a bond port if we have learned a different
source port for that MAC.  We were already doing this for multicast
packets but extend the logic to unicast packets as well since the
same situation can occur if the connected switch has not learned the
MAC address and is flooding.  Otherwise vSwitch will learn the bond
port as the source of that MAC.

Bug #2167

14 years agoxen: Restore state files for VIF VLANs
Jesse Gross [Tue, 20 Oct 2009 03:14:31 +0000 (20:14 -0700)]
xen: Restore state files for VIF VLANs

A change on master to use ovs-vsctl instead of state files for VLANs
was ported to the citrix branch, which does not have ovs-vsctl.  The
interface reconfigure portion, which does not store the state files
was ported but the vif-hotput script portion was not.  This restores
interface reconfigure to again save the state files.

Bug #2187

14 years agoxen: Correctly write VLAN key in config file.
Jesse Gross [Tue, 20 Oct 2009 01:40:11 +0000 (18:40 -0700)]
xen: Correctly write VLAN key in config file.

When adding the VLAN key the name of the vif was from a variable in
use on only the xs5.7 branch.  This uses the correct variable name
for the master branch

14 years agoovs-vsctl: Add tests that adding duplicate bridges or ports fails.
Ben Pfaff [Fri, 16 Oct 2009 16:49:59 +0000 (09:49 -0700)]
ovs-vsctl: Add tests that adding duplicate bridges or ports fails.

Suggested-by: Reid Price <reid@nicira.com>
14 years agoovs-vsctl: Add the ability to perform multiple operations in a single run.
Ben Pfaff [Fri, 16 Oct 2009 16:42:21 +0000 (09:42 -0700)]
ovs-vsctl: Add the ability to perform multiple operations in a single run.

CC: Ian Campbell <Ian.Campbell@citrix.com>
14 years agoovs-vsctl: Refactor internals to increase flexibility.
Ben Pfaff [Fri, 16 Oct 2009 16:36:25 +0000 (09:36 -0700)]
ovs-vsctl: Refactor internals to increase flexibility.

This changes the interface of each of the command implementations, making
them take the configuration as an argument and return the output.  This
will make it easier to support alternate output formats and to execute more
than one command per invocation (both happening in upcoming commits).

14 years agoovs-vsctl: Allow bridge name to be omitted from del-port command.
Ben Pfaff [Thu, 15 Oct 2009 19:47:05 +0000 (12:47 -0700)]
ovs-vsctl: Allow bridge name to be omitted from del-port command.

The 'bridge' argument to ovs-vsctl's del-port command is only supplied as
a form of error checking.  Sometimes the name of the bridge isn't readily
available, so for such situations this commit allows the user to omit the
name of the bridge entirely.

CC: Ian Campbell <Ian.Campbell@citrix.com>
14 years agoovs-vsctl: Log changes to configuration file to syslog.
Ben Pfaff [Fri, 16 Oct 2009 16:26:20 +0000 (09:26 -0700)]
ovs-vsctl: Log changes to configuration file to syslog.

This feature, which has been in ovs-cfg-mod for some time as the "-c"
option, makes it much easier to see what changes ovs-vsctl actually makes
to ovs-vswitchd.conf.

CC: <Ian.Campbell@citrix.com>