sliver-openvswitch.git
14 years agoovs-brcompatd: First cut at integration with new config db
Justin Pettit [Thu, 10 Dec 2009 08:08:39 +0000 (00:08 -0800)]
ovs-brcompatd: First cut at integration with new config db

This is an extremely lightly tested attempt at switching ovs-brcompatd
from using the config file to the new config db.  There are a lot of
shortcomings in this cut, but we need to make progress on the XenServer
integration, so it's going in now.  Expect changes in the near future.

14 years agoovs-vsctl: Fix minor memory leak in add_port().
Justin Pettit [Thu, 10 Dec 2009 06:14:54 +0000 (22:14 -0800)]
ovs-vsctl: Fix minor memory leak in add_port().

14 years agoUpdate .gitignore files
Justin Pettit [Tue, 8 Dec 2009 06:21:35 +0000 (22:21 -0800)]
Update .gitignore files

14 years agoxenserver: Modify init scripts to use new configuration database
Justin Pettit [Tue, 8 Dec 2009 02:18:29 +0000 (18:18 -0800)]
xenserver: Modify init scripts to use new configuration database

14 years agoxenserver: Remove ip_gre kernel module when other modules are removed
Justin Pettit [Mon, 7 Dec 2009 23:59:20 +0000 (15:59 -0800)]
xenserver: Remove ip_gre kernel module when other modules are removed

14 years agoovs-vsctl: New commands for working with external IDs.
Ben Pfaff [Thu, 10 Dec 2009 01:04:08 +0000 (17:04 -0800)]
ovs-vsctl: New commands for working with external IDs.

This aids XenServer integration and should make it easier to integrate
with other environments in the future as well.

14 years agoovs-vsctl: Fix performance problem.
Ben Pfaff [Wed, 9 Dec 2009 21:29:02 +0000 (13:29 -0800)]
ovs-vsctl: Fix performance problem.

14 years agoovs-vsctl: Fix bugs.
Ben Pfaff [Wed, 9 Dec 2009 21:28:48 +0000 (13:28 -0800)]
ovs-vsctl: Fix bugs.

The full ovs-vsctl test suite now passes.

14 years agovsctl: Start making it work with ovsdb.
Ben Pfaff [Wed, 9 Dec 2009 01:18:12 +0000 (17:18 -0800)]
vsctl: Start making it work with ovsdb.

This passes at least one test (the one named "add-br a").  It probably
doesn't pass any more than that.

This is *way* not up to my quality standards, but we are in a super hurry
so I'm pushing it anyhow.

14 years agoovsdb-idlc: Add "const" to "set" function arguments that should have it.
Ben Pfaff [Wed, 9 Dec 2009 01:15:46 +0000 (17:15 -0800)]
ovsdb-idlc: Add "const" to "set" function arguments that should have it.

14 years agoovsdb-idl: New function to obtain the current transaction from any row.
Ben Pfaff [Wed, 9 Dec 2009 01:14:56 +0000 (17:14 -0800)]
ovsdb-idl: New function to obtain the current transaction from any row.

14 years agoovsdb-idl: Bug fixes.
Ben Pfaff [Wed, 9 Dec 2009 01:14:36 +0000 (17:14 -0800)]
ovsdb-idl: Bug fixes.

14 years agovswitch: Add "external_ids" and "ofport" columns to Interface table.
Ben Pfaff [Tue, 8 Dec 2009 21:03:38 +0000 (13:03 -0800)]
vswitch: Add "external_ids" and "ofport" columns to Interface table.

14 years agoovsdb-idlc: Fix parsing of "ephemeral" member of "column".
Ben Pfaff [Tue, 8 Dec 2009 21:39:42 +0000 (13:39 -0800)]
ovsdb-idlc: Fix parsing of "ephemeral" member of "column".

14 years agoovsdb-idl: Update IDL data when "set" functions are called.
Ben Pfaff [Tue, 8 Dec 2009 17:48:37 +0000 (09:48 -0800)]
ovsdb-idl: Update IDL data when "set" functions are called.

Until now, the "set" functions generated by the IDL updated the data in the
database (during commit) but not the data exposed by the IDL in its data
structures.  This was just an oversight, so this commit causes the data
exposed by IDL to be updated also.

14 years agoovsdb-idl: Make it possible to write data through the IDL.
Ben Pfaff [Tue, 8 Dec 2009 01:08:04 +0000 (17:08 -0800)]
ovsdb-idl: Make it possible to write data through the IDL.

Until now the IDL has been exclusively a read-only interface.  This commit
introduces a general-purpose interface for writing to ovsdb via the IDL.

14 years agoovsdb: Implement new "declare" operation.
Ben Pfaff [Mon, 7 Dec 2009 19:47:48 +0000 (11:47 -0800)]
ovsdb: Implement new "declare" operation.

14 years agojson: New convenience function json_array_create_1().
Ben Pfaff [Tue, 8 Dec 2009 01:10:09 +0000 (17:10 -0800)]
json: New convenience function json_array_create_1().

14 years agobitmap: New function bitmap_scan() and macro BITMAP_FOR_EACH_1.
Ben Pfaff [Tue, 8 Dec 2009 01:09:52 +0000 (17:09 -0800)]
bitmap: New function bitmap_scan() and macro BITMAP_FOR_EACH_1.

bitmap_scan() can be optimized significantly for the case of a sparse
bitmap but it doesn't seem worth the additional overhead of writing a test
unless and until we show that it's a useful optimization in practice.

14 years agohmap: Add function to mark an hmap_node as "null" and check for the mark.
Ben Pfaff [Tue, 8 Dec 2009 01:02:00 +0000 (17:02 -0800)]
hmap: Add function to mark an hmap_node as "null" and check for the mark.

This is useful in cases where one might want to know whether an hmap_node
is actually part of an hmap, without using a separate variable to indicate
it.

14 years agoovsdb-idlc: Add rules to make sure .h files get generated before .c files.
Ben Pfaff [Tue, 8 Dec 2009 01:00:14 +0000 (17:00 -0800)]
ovsdb-idlc: Add rules to make sure .h files get generated before .c files.

The .c files #include the .h files so the .h files need to be generated
first.

14 years agoFix alphabetic ordering in lib/automake.mk
Glen Gibb [Tue, 8 Dec 2009 00:24:03 +0000 (16:24 -0800)]
Fix alphabetic ordering in lib/automake.mk

    Files in lib_libopenvswitch_a_SOURCES list in automake.mk were
    incorrectly sorted. Files out of order:
      - lib/uuid.[ch]
      - lib/unixctl.[ch]

14 years agoovsdb: Remove obsolete declaration from ovsdb-server.c.
Ben Pfaff [Mon, 7 Dec 2009 21:32:44 +0000 (13:32 -0800)]
ovsdb: Remove obsolete declaration from ovsdb-server.c.

14 years agovswitchd: Avoid segfault when local port is required but missing.
Ben Pfaff [Mon, 7 Dec 2009 21:02:37 +0000 (13:02 -0800)]
vswitchd: Avoid segfault when local port is required but missing.

Connecting to a controller requires the vswitch to have a local port
(typically named the same as the bridge itself).  Before the introduction
of ovsdb ovs-vswitchd simply added the local port itself if it was missing.
This was not properly implemented with the ovsdb transition, and a segfault
resulted.  This commit avoids the segfault, although it should possibly
be improved to also add the local port, as before.

CC: Jeremy Stribling <strib@nicira.com>
14 years agogre: Temporary workarounds for GRE on Xen.
Jesse Gross [Sun, 6 Dec 2009 02:49:37 +0000 (18:49 -0800)]
gre: Temporary workarounds for GRE on Xen.

Two issues exist that prevent GRE tunnels from working properly on
Xen: iptables rules and brcompatd.  The first issue is that GRE
traffic is not permitted by the default iptables rules.  The second
is that brcompatd removes ports from the configuration that it
believes do not exist, which causes GRE ports to be deleted before
they are created.

This commit avoids these issues though not in the most optimal way.
Better fixes will be forthcoming in the near future.

14 years agogre: Add userspace GRE support.
Jesse Gross [Sun, 6 Dec 2009 00:01:06 +0000 (16:01 -0800)]
gre: Add userspace GRE support.

This implements the userspace portion of GRE on Linux. It communicates
with the kernel module to setup tunnels using either Netlink or ioctls
as appropriate based on the kernel version.

Significant portions of this commit were actually written by
Justin Pettit.

14 years agogre: Add kernel GRE support.
Jesse Gross [Sun, 6 Dec 2009 23:10:35 +0000 (15:10 -0800)]
gre: Add kernel GRE support.

This implements the kernel portion of GRE on Linux.  It consists
of a backported module that provides the GRE capabilities of 2.6.32
plus bug fixes to kernels 2.6.18+.

14 years agogre: Compatibility with older Linux kernel versions.
Jesse Gross [Thu, 3 Dec 2009 02:56:36 +0000 (18:56 -0800)]
gre: Compatibility with older Linux kernel versions.

The upcoming GRE kernel module compiles on a range (2.6.18+) of
Linux kernel versions.  The module expects the kernel headers to
look like newer versions.  Where older and newer versions of the
kernel differ this commit implements shims to paper over the changes.

14 years agonetflow: Correctly set active timeout value.
Jesse Gross [Mon, 7 Dec 2009 05:37:57 +0000 (21:37 -0800)]
netflow: Correctly set active timeout value.

This fixes a bug originally introduced in commit 763435 "vswitchd:
Initial conversion to database-based configuration."  The bug
reversed a less than operator when setting the active timeout field.
Also add a warning if the timeout is set to an invalid value.

CC: Glen Gibb <grg@stanford.edu>
14 years agoUpdate ovsdb specifications based on suggestions from Brandon Heller.
Ben Pfaff [Mon, 7 Dec 2009 17:45:38 +0000 (09:45 -0800)]
Update ovsdb specifications based on suggestions from Brandon Heller.

14 years agoofproto: Fix reversed inequality test.
Ben Pfaff [Mon, 7 Dec 2009 17:25:32 +0000 (09:25 -0800)]
ofproto: Fix reversed inequality test.

Thanks to Glen Gibb <grg@stanford.edu> for pointing out the problem.

14 years agovswitch: Add description for configuring GRE tunnels
Justin Pettit [Sat, 5 Dec 2009 07:07:09 +0000 (23:07 -0800)]
vswitch: Add description for configuring GRE tunnels

14 years agoovsdb-idl: Fix memory leak.
Ben Pfaff [Fri, 4 Dec 2009 23:06:26 +0000 (15:06 -0800)]
ovsdb-idl: Fix memory leak.

14 years agoovsdb-idl: Optimize lookup of struct idl_table from struct idl_table_class.
Ben Pfaff [Fri, 4 Dec 2009 22:55:24 +0000 (14:55 -0800)]
ovsdb-idl: Optimize lookup of struct idl_table from struct idl_table_class.

Before, the idl_table could only be obtained through a hash lookup of a
string.  This way is faster and more straightforward.

14 years agoDistribute ovsdb-idlc built sources, so Python is not required for build.
Ben Pfaff [Fri, 4 Dec 2009 01:06:29 +0000 (17:06 -0800)]
Distribute ovsdb-idlc built sources, so Python is not required for build.

The Xen DDK VM does not include Python, so it's best if we don't have to
require it for the build.

The built sources are still regenerated if necessary.

14 years agovswitchd: Add "id" column to Interface table for use by NOX.
Ben Pfaff [Fri, 4 Dec 2009 00:20:30 +0000 (16:20 -0800)]
vswitchd: Add "id" column to Interface table for use by NOX.

This might end up being absorbed into a more general-purpose
"foreign-keys" column.

14 years agojson: Improve error reporting.
Ben Pfaff [Fri, 4 Dec 2009 00:08:34 +0000 (16:08 -0800)]
json: Improve error reporting.

14 years agovswitchd: Avoid segfault when creating a bridge fails.
Ben Pfaff [Thu, 3 Dec 2009 23:14:56 +0000 (15:14 -0800)]
vswitchd: Avoid segfault when creating a bridge fails.

bridge_create() can return a null pointer if creating the bridge fails, so
check for that and don't dereference it in that case.

Thank to Jeremy Stribling for reporting the problem.

14 years agoxenserver: Mention additional ovsdb files that are included.
Ben Pfaff [Thu, 3 Dec 2009 23:03:38 +0000 (15:03 -0800)]
xenserver: Mention additional ovsdb files that are included.

14 years agoovsdb: Fix race conditions in test suite.
Ben Pfaff [Thu, 3 Dec 2009 22:45:16 +0000 (14:45 -0800)]
ovsdb: Fix race conditions in test suite.

14 years agoovsdb-client: Add support for --detach to "monitor" command.
Ben Pfaff [Thu, 3 Dec 2009 22:25:06 +0000 (14:25 -0800)]
ovsdb-client: Add support for --detach to "monitor" command.

14 years agoovsdb-server: Open --listen sockets before detaching.
Ben Pfaff [Thu, 3 Dec 2009 22:20:33 +0000 (14:20 -0800)]
ovsdb-server: Open --listen sockets before detaching.

This prevents a race condition in a command sequence that starts
ovsdb-server and then immediately connects to it with ovsdb-client.

14 years agoxenserver: Remove now-missing files from RPM spec file.
Ben Pfaff [Thu, 3 Dec 2009 22:46:57 +0000 (14:46 -0800)]
xenserver: Remove now-missing files from RPM spec file.

Making XenServer work with ovsdb will take additional changes, but this
should at least make it possible to build the RPM again.

14 years agovswitchd: Initial conversion to database-based configuration.
Ben Pfaff [Thu, 3 Dec 2009 19:28:40 +0000 (11:28 -0800)]
vswitchd: Initial conversion to database-based configuration.

This has seen very little testing, so some features are almost certainly
busted.  Port mirroring is not yet converted, so it will definitely not
work.

14 years agovswitchd: Remove vestigial spanning tree protocol (STP) support.
Ben Pfaff [Thu, 3 Dec 2009 18:59:09 +0000 (10:59 -0800)]
vswitchd: Remove vestigial spanning tree protocol (STP) support.

ovs-vswitchd has never supported spanning tree protocol, but there was
nevertheless a considerable amount of code that provided a framework for
supporting it.

This commit deletes this code, since we have no plans to introduce STP
support soon.

14 years agoovsdb-idl: Fix resolution of references from one table to another.
Ben Pfaff [Thu, 3 Dec 2009 18:35:45 +0000 (10:35 -0800)]
ovsdb-idl: Fix resolution of references from one table to another.

Our tests only checked references from a table to itself, so of course
there were bugs in references from one table to another.  This fixes the
obvious one and adds a test.

14 years agoovsdb-idl: Make IDL-generated files depend on ovsdb-idlc.
Ben Pfaff [Thu, 3 Dec 2009 18:53:58 +0000 (10:53 -0800)]
ovsdb-idl: Make IDL-generated files depend on ovsdb-idlc.

This ensures that IDL-generated files get rebuilt whenever the IDL
compiler itself is updated.

14 years agoovsdb-idlc: C code generation improvements.
Ben Pfaff [Thu, 3 Dec 2009 18:34:26 +0000 (10:34 -0800)]
ovsdb-idlc: C code generation improvements.

This eliminates many casts from the IDL's generated C code and reduces the
number of levels of indirection for simple cases of optional string or
pointer columns.

14 years agoMerge "master" branch into "db".
Ben Pfaff [Wed, 2 Dec 2009 19:49:53 +0000 (11:49 -0800)]
Merge "master" branch into "db".

14 years agoovsdb: Implement C bindings for IDL.
Ben Pfaff [Wed, 2 Dec 2009 19:26:15 +0000 (11:26 -0800)]
ovsdb: Implement C bindings for IDL.

14 years agojsonrpc: Make it easy to get a new JSON-RPC request's id.
Ben Pfaff [Wed, 2 Dec 2009 00:32:03 +0000 (16:32 -0800)]
jsonrpc: Make it easy to get a new JSON-RPC request's id.

14 years agojsonrpc: New type "jsonrpc_session", which automatically reconnects.
Ben Pfaff [Wed, 2 Dec 2009 18:50:18 +0000 (10:50 -0800)]
jsonrpc: New type "jsonrpc_session", which automatically reconnects.

14 years agoovsdb: Allow a named-uuid to be used within the operation that creates it.
Ben Pfaff [Wed, 2 Dec 2009 00:35:33 +0000 (16:35 -0800)]
ovsdb: Allow a named-uuid to be used within the operation that creates it.

This allows a transaction like this:

[{"op": "insert",
  "table": "mytable",
  "row": {"i": 0, "k": ["named-uuid", "self"]},
  "uuid-name": "self"}]

It was already possible to do this by following up on the "insert" with an
"update", but since this was easy to implement I did it.

14 years agovswitchd: Fix build when source and build directory differ.
Ben Pfaff [Wed, 2 Dec 2009 19:18:40 +0000 (11:18 -0800)]
vswitchd: Fix build when source and build directory differ.

14 years agonetdev: Allow explicit creation of netdev objects
Justin Pettit [Tue, 1 Dec 2009 09:14:33 +0000 (01:14 -0800)]
netdev: Allow explicit creation of netdev objects

This change adds netdev_create() and netdev_destroy() functions to allow
the creation of network devices through the netdev library.  Previously,
network devices had to already exist or be created on demand through
netdev_open().  This caused problems such as not being able to specify
TAP devices as ports in ovs-vswitchd, which this patch fixes.

This also lays the groundwork for adding GRE and VDE support.

14 years agodpif: Minor provider comment cleanups.
Justin Pettit [Tue, 1 Dec 2009 07:20:57 +0000 (23:20 -0800)]
dpif: Minor provider comment cleanups.

14 years agovswitch.ovsidl: Fix comments.
Ben Pfaff [Tue, 24 Nov 2009 17:45:54 +0000 (09:45 -0800)]
vswitch.ovsidl: Fix comments.

14 years agoclassifier: Improve comments.
Ben Pfaff [Tue, 24 Nov 2009 17:59:54 +0000 (09:59 -0800)]
classifier: Improve comments.

14 years agoovsdb: Minor cleanups to the SPECS file
Justin Pettit [Tue, 24 Nov 2009 03:00:27 +0000 (19:00 -0800)]
ovsdb: Minor cleanups to the SPECS file

14 years agovswitch.ovsidl: Various cleanups
Justin Pettit [Tue, 24 Nov 2009 01:28:00 +0000 (17:28 -0800)]
vswitch.ovsidl: Various cleanups

Fix a few minor errors and provide some cleanups in the vswitch IDL
schema.

14 years agoovsdb-idlc: Remove "sha" deprecation warning
Justin Pettit [Tue, 24 Nov 2009 01:24:58 +0000 (17:24 -0800)]
ovsdb-idlc: Remove "sha" deprecation warning

The "sha" module was deprecated in Python 2.5 and calling ovsd-idlc prints
a warning in Python 2.6.  The module is not actually being used, so this
just removes the offending import.

14 years agoovsdb: Add ovsdb IDL compiler to build system.
Ben Pfaff [Tue, 24 Nov 2009 00:07:36 +0000 (16:07 -0800)]
ovsdb: Add ovsdb IDL compiler to build system.

This first stab at any interface definition language and compiler for OVSDB
will give other developers a chance to look at it and try to integrate it.
The IDL is not actually implemented yet; I am working on that.

14 years agoovs-openflowd: Add support for userspace-only switching.
Ben Pfaff [Mon, 23 Nov 2009 19:32:08 +0000 (11:32 -0800)]
ovs-openflowd: Add support for userspace-only switching.

14 years agosvec: New function svec_split().
Ben Pfaff [Mon, 23 Nov 2009 19:09:38 +0000 (11:09 -0800)]
svec: New function svec_split().

This is useful in an upcoming commit.

14 years agodpif: New function dpif_create_and_open().
Ben Pfaff [Mon, 23 Nov 2009 19:09:19 +0000 (11:09 -0800)]
dpif: New function dpif_create_and_open().

This function combines what dpif_create() and dpif_open() do.  It allows
us to factor a tiny amount of code out of the vswitch, but more importantly
this function is also useful in the following commit.

14 years agonetflow: Break out code for sending packets into a new "collectors" module.
Ben Pfaff [Mon, 23 Nov 2009 21:59:20 +0000 (13:59 -0800)]
netflow: Break out code for sending packets into a new "collectors" module.

sFlow uses a similar UDP structure so this will allow use to reuse the
NetFlow code for it.

14 years agonetflow: Use inet_open_active() to factor out some code.
Ben Pfaff [Mon, 23 Nov 2009 20:22:03 +0000 (12:22 -0800)]
netflow: Use inet_open_active() to factor out some code.

14 years agosocket-util: Generalize tcp_open_*() to UDP, as inet_open_*().
Ben Pfaff [Mon, 23 Nov 2009 20:18:59 +0000 (12:18 -0800)]
socket-util: Generalize tcp_open_*() to UDP, as inet_open_*().

The tcp_open_active() and tcp_open_passive() functions don't really have
any strong dependencies on TCP.  With a couple of simple changes they
can be used for UDP also.  Since this is useful for Netflow, this commit
does so.

14 years agosocket-util: Make TCP open function support no default port.
Ben Pfaff [Thu, 19 Nov 2009 21:44:49 +0000 (13:44 -0800)]
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 for NetFlow there is no universal default, so enhance these functions
so that they can require the user to specify a port explicitly.

Crossported from the 'db' branch, where this is useful for JSON-RPC, which
also has no widely known port.

14 years agonetdev: New function netdev_get_ifindex().
Ben Pfaff [Mon, 23 Nov 2009 20:25:08 +0000 (12:25 -0800)]
netdev: New function netdev_get_ifindex().

sFlow needs the ifindex of an interface, so this commit adds a function
to retrieve it.

14 years agoMove C compiler warning (-W) flags from CFLAGS to AM_CFLAGS.
Ben Pfaff [Thu, 19 Nov 2009 21:25:42 +0000 (13:25 -0800)]
Move C compiler warning (-W) flags from CFLAGS to AM_CFLAGS.

C compiler warning options added by the "configure" script have until
now been put into CFLAGS.  However that option is supposed to be reserved
for the user under Automake rules, so move them to AM_CFLAGS.

Besides increased adherence to Automake rules, this is useful because
AM_CFLAGS can be overridden on a per-target (e.g. program or library)
basis, whereas CFLAGS cannot.  In turn, building the sFlow library (which
will be added in an upcoming commit) requires overriding the compiler
flags to avoid some warning messages.  (By modifying the warning flags, we
avoid the need to modify the sFlow library in any way.)

14 years agoacinclude.m4: Fix inconsistency.
Ben Pfaff [Thu, 19 Nov 2009 00:27:55 +0000 (16:27 -0800)]
acinclude.m4: Fix inconsistency.

Both ; and : are valid shell commands here, but one branch of the "if"
uses one and the other branch uses the other.  Use the same one, for
consistency's sake.

14 years agoovsdb: Rename variable to better describe its purpose.
Ben Pfaff [Fri, 20 Nov 2009 23:40:11 +0000 (15:40 -0800)]
ovsdb: Rename variable to better describe its purpose.

Apparently a cut-and-paste error gave this variable a deceptive name.

14 years agoshash: Make it more convenient to store "const" objects in an shash.
Ben Pfaff [Fri, 20 Nov 2009 23:39:07 +0000 (15:39 -0800)]
shash: Make it more convenient to store "const" objects in an shash.

14 years agoovsdb: Require database, table, column names to be valid identifiers.
Ben Pfaff [Fri, 20 Nov 2009 00:48:12 +0000 (16:48 -0800)]
ovsdb: Require database, table, column names to be valid identifiers.

Database, table, and column names have always been required by the OVSDB
specification to be identifiers (e.g. valid C identifiers), but this has
never been enforced.

This commit adds enforcement and fixes one instance of an invalid column
name in the vswitch schema.

14 years agoCorrect dameon options in INSTALL.bridge
Justin Pettit [Thu, 19 Nov 2009 23:45:20 +0000 (15:45 -0800)]
Correct dameon options in INSTALL.bridge

A while back, we retired the short options for daemons.  The
INSTALL.bridge file was never updated to reflect this.

CC: Jeongkeun Lee <jklee@hp.com>
14 years agonetdev: Really set output values to 0 on failure in netdev_get_features().
Ben Pfaff [Thu, 19 Nov 2009 19:06:14 +0000 (11:06 -0800)]
netdev: Really set output values to 0 on failure in netdev_get_features().

The comment on netdev_get_features() claimed that all of the passed-in
values were set to 0 on failure, but the implementation didn't live up
to the promise.

CC: Paul Ingram <paul@nicira.com>
14 years agoovs-controller: Add --wildcard and --normal features.
Jean Tourrilhes [Thu, 19 Nov 2009 20:48:32 +0000 (12:48 -0800)]
ovs-controller: Add --wildcard and --normal features.

This adds two command line switches to ovs-controller to:
1) Use wildcards instead of exact matches.
2) Use "normal" action instead of explicit port.

14 years agodatapath: Use HAVE_PROTO_DATA_VALID when defining vswitch_skb_checksum_setup
Ian Campbell [Thu, 19 Nov 2009 18:20:49 +0000 (10:20 -0800)]
datapath: Use HAVE_PROTO_DATA_VALID when defining vswitch_skb_checksum_setup

The purpose of the non-empty variant of vswitch_skb_checksum_setup is to
synchronise the proto_data_valid and proto_csum_blank fields into the
standard skb csum/ip_summed fields, therefore it is more correct to key
off of HAVE_PROTO_DATA_VALID.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
14 years agodatapath: Fix warning building datapath on pre-2.6.24 kernels.
Ben Pfaff [Wed, 18 Nov 2009 23:56:57 +0000 (15:56 -0800)]
datapath: Fix warning building datapath on pre-2.6.24 kernels.

The Linux 'min' macro checks that its arguments have the same type, and
if not the compiler reports a message about incompatible pointer types.
On pre-2.6.24 kernels skb_headroom() returns int, so this code was
firing a warning:
       unsigned headroom = max(min_headroom, skb_headroom(skb));

This commit makes skb_headroom() return an unsigned int regardless of
kernel version.

14 years agodatapath: Check for proto_data_valid member instead of kernel version.
Ben Pfaff [Wed, 18 Nov 2009 23:19:50 +0000 (15:19 -0800)]
datapath: Check for proto_data_valid member instead of kernel version.

Commit 5ef800a69 "datapath: Copy Xen's checksumming fields when doing
skb_copy" should copy proto_data_valid between sk_buffs when that field
is present.  However the check for CONFIG_XEN plus kernel version 2.6.18
isn't sufficient, because SLES 11 kernels are version 2.6.27 but do have
this field.

This commit adds a configure-time check for the presence of the member
instead of attempting to guess based on the kernel version.

Thanks to Ian Campbell for reporting this problem.

CC: <Ian.Campbell@citrix.com>
14 years agoMerge citrix branch into master.
Ben Pfaff [Wed, 18 Nov 2009 22:14:29 +0000 (14:14 -0800)]
Merge citrix branch into master.

14 years agodatapath: Allow minimum headroom to be set when copying buffers.
Jesse Gross [Wed, 18 Nov 2009 03:03:27 +0000 (19:03 -0800)]
datapath: Allow minimum headroom to be set when copying buffers.

If we need to copy an sk_buff in order to make it writable, allow
the minimum headroom to be specified.  This ensures that if we
need to add additional data, such as a VLAN tag, we will not have
to make a second copy.

Solves bug #2197 in certain situations.

14 years agodatapath: Copy Xen's checksumming fields when doing skb_copy.
Jesse Gross [Wed, 18 Nov 2009 01:28:00 +0000 (17:28 -0800)]
datapath: Copy Xen's checksumming fields when doing skb_copy.

Two fields that control checksumming were added to sk_buff in
Xen: proto_data_valid and proto_csum_blank.  These fields are copied
when doing a skb_clone but not in other functions such as skb_copy,
which can lead to checksum errors in TCP and UDP when offloading is
enabled in the guest.  To fix this we manually copy these fields,
though ideally this should be fixed upstream in Xen.

Bug #2299

14 years agodatapath: Fix build with kernel header layout recently adopted by Debian.
Ben Pfaff [Wed, 18 Nov 2009 19:05:00 +0000 (11:05 -0800)]
datapath: Fix build with kernel header layout recently adopted by Debian.

Recent Debian kernel-header packages divide kernel headers into two
directories: the "common" headers that are not architecture-specific,
which go in a directory named like
    /usr/src/kernel-headers-2.6.31-1-common,
and architecture-specific headers in a directory named, e.g.
    /usr/src/kernel-headers-2.6.31-1-686.
OVS needs to look at the ones in the "common" directory as part of its
configuration process, but the build directory provided on --with-l26 is
the architecture-specific directory.  We also need the
architecture-specific directory, since it is the one that we use as part
of the "make", so we can't simply make the user specify the common
directory on --with-l26.  Furthermore, there is no easy-to-see link
between the two directories, except as part of the text in a Makefile,
which is not the easiest language to parse.

This commit attempts to kluge around the problem by using the Debian
directory naming.  If the build directory does not contain the headers,
then we replace the last component of its name by "-common" and check
for the headers there.  This is not ideal, but it does solve the actual
problem at hand.

Tested with Debian's linux-headers-2.6.31-1-686 and with a few older
sets of headers that do not use this scheme.

14 years agoDocument userspace switch.
Ben Pfaff [Wed, 18 Nov 2009 20:57:18 +0000 (12:57 -0800)]
Document userspace switch.

14 years agoovsdb: Make ovsdb-server tests pass even when @RUNDIR@ is not writable.
Ben Pfaff [Wed, 18 Nov 2009 20:43:50 +0000 (12:43 -0800)]
ovsdb: Make ovsdb-server tests pass even when @RUNDIR@ is not writable.

14 years agoovsdb: Add more tests for "monitor" feature.
Ben Pfaff [Wed, 18 Nov 2009 20:43:30 +0000 (12:43 -0800)]
ovsdb: Add more tests for "monitor" feature.

14 years agoovsdb-server: Fix crash for invalid parameters to "monitor" request.
Ben Pfaff [Wed, 18 Nov 2009 19:32:16 +0000 (11:32 -0800)]
ovsdb-server: Fix crash for invalid parameters to "monitor" request.

Thanks to Jeremy Stribling <strib@nicira.com> for reporting the problem.

14 years agoUpdate documentation to mention correct Autoconf version prerequisite.
Ben Pfaff [Wed, 18 Nov 2009 18:03:34 +0000 (10:03 -0800)]
Update documentation to mention correct Autoconf version prerequisite.

14 years agoovsdb: Monitor support.
Ben Pfaff [Mon, 16 Nov 2009 18:38:14 +0000 (10:38 -0800)]
ovsdb: Monitor support.

14 years agojsonrpc: Add logging for messages sent and received, at DBG level.
Ben Pfaff [Tue, 17 Nov 2009 00:55:35 +0000 (16:55 -0800)]
jsonrpc: Add logging for messages sent and received, at DBG level.

This made it much easier to see problems while developing some
ovsdb-server features.

14 years agoovsdb-server: Add "exit" unixctl command and --unixctl option.
Ben Pfaff [Wed, 18 Nov 2009 00:02:38 +0000 (16:02 -0800)]
ovsdb-server: Add "exit" unixctl command and --unixctl option.

This makes writing predictable test scripts easier.

14 years agodatapath: Remove unused print_flow() function
Justin Pettit [Tue, 17 Nov 2009 17:51:34 +0000 (09:51 -0800)]
datapath: Remove unused print_flow() function

14 years agodatapath: Cleanup tab/space issues in datapath
Justin Pettit [Mon, 16 Nov 2009 23:24:35 +0000 (15:24 -0800)]
datapath: Cleanup tab/space issues in datapath

14 years agovconn: Fix endian issue in unknown action type error message
Justin Pettit [Mon, 16 Nov 2009 23:26:31 +0000 (15:26 -0800)]
vconn: Fix endian issue in unknown action type error message

14 years agoovs-ofctl: Add support for transport and network modification actions
Justin Pettit [Tue, 17 Nov 2009 01:58:26 +0000 (17:58 -0800)]
ovs-ofctl: Add support for transport and network modification actions

Add support to ovs-ofctl for modifying the network source and destination
IP address with the "mod_nw_src" and "mod_nw_dst" actions, respectively.
And support modifying the TCP/UDP source and destination ports with the
"mod_tp_src" and "mod_tp_dst" actions, respectively.

14 years agoofproto: Support missing set_nw_dst and set_tp_dst translations
Justin Pettit [Tue, 17 Nov 2009 02:08:12 +0000 (18:08 -0800)]
ofproto: Support missing set_nw_dst and set_tp_dst translations

The function that translates OpenFlow actions into datapath actions was
missing definitions for OFPAT_SET_NW_DST and OFPAT_SET_TP_DST.  This
meant those actions would not occur in the datapath.

14 years agodatapath: Calculate proper checksum for set_tp_src/dst action
Justin Pettit [Tue, 17 Nov 2009 01:51:31 +0000 (17:51 -0800)]
datapath: Calculate proper checksum for set_tp_src/dst action

When the set_tp_src or set_tp_dst action is used, the calculation for
where the checksum is located was wrong.  This caused the checksum to
not be updated and packet corruption in the bad offset.

14 years agoovs-appctl: Fix shadow variable that could cause segfault
Justin Pettit [Tue, 17 Nov 2009 00:36:21 +0000 (16:36 -0800)]
ovs-appctl: Fix shadow variable that could cause segfault

The variable "socket_name" contains the name of the unix domain socket
to be used for communicating with the OVS process.  If the target does
not begin with a "/", the socket name is determined based on a pidfile.
A shadow copy of "socket_name" was kept in the block that looks at the
pidfile, which would cause the function-level one to not be set.  This
removes that shadow copy.