sliver-openvswitch.git
13 years agoconfigure: Fix Graphviz test and input generation.
Ben Pfaff [Wed, 3 Nov 2010 16:57:16 +0000 (09:57 -0700)]
configure: Fix Graphviz test and input generation.

This check for Graphviz never actually worked properly because Autoconf
swallows up the [] around [gG], so Graphviz was always detected as missing.
This commit fixes the problem by doubling up to [[gG]].

Because Graphviz was never used, I never noticed that ovsdb-dot had not
been revised to use the latest Python interface to OVSDB, so this commit
fixes up those problems too.

13 years agoofproto: Improve comment in send_flow_removed().
Ben Pfaff [Fri, 5 Nov 2010 16:27:27 +0000 (09:27 -0700)]
ofproto: Improve comment in send_flow_removed().

13 years agoofproto: Simplify send_flow_removed().
Ben Pfaff [Mon, 18 Oct 2010 23:15:50 +0000 (16:15 -0700)]
ofproto: Simplify send_flow_removed().

I have no evidence that the optimization in this function is valuable.
An upcoming commit will introduce a new form of flow expiration message
that is sent to controllers that ask for it, while the standard OpenFlow
1.0 message is sent to other controllers.  Since retaining this
optimization with that logic would complicate the function, this commit
drops it.

13 years agoofp-util: New functions make_nxmsg(), make_nxmsg_xid().
Ben Pfaff [Mon, 18 Oct 2010 23:25:52 +0000 (16:25 -0700)]
ofp-util: New functions make_nxmsg(), make_nxmsg_xid().

These functions slightly simplify constructing Nicira vendor extension
messages.

13 years agoofp-util: Add macros for composing error codes.
Ben Pfaff [Tue, 19 Oct 2010 21:12:26 +0000 (14:12 -0700)]
ofp-util: Add macros for composing error codes.

These are useful in static initializers and case labels, where function
calls are not allowed.

13 years agoSync Nicira error number assignments with "wdp" branch.
Ben Pfaff [Fri, 20 Aug 2010 17:33:02 +0000 (10:33 -0700)]
Sync Nicira error number assignments with "wdp" branch.

This adds the error numbers that the "wdp" branch added, without adding
any uses of them (because they are not needed on "master" yet).

13 years agoofp-util: Use our usual variable naming convention in make_ofp_error_msg().
Ben Pfaff [Thu, 4 Nov 2010 17:33:28 +0000 (10:33 -0700)]
ofp-util: Use our usual variable naming convention in make_ofp_error_msg().

13 years agoofp-util: Actually map vendor codes to IDs correctly.
Ben Pfaff [Thu, 4 Nov 2010 17:33:08 +0000 (10:33 -0700)]
ofp-util: Actually map vendor codes to IDs correctly.

Reported-by: Justin Pettit <jpettit@nicira.com>
13 years agoofp-util.h: Use NX_VENDOR_ID instead of literal numeric constant.
Ben Pfaff [Thu, 4 Nov 2010 17:32:46 +0000 (10:32 -0700)]
ofp-util.h: Use NX_VENDOR_ID instead of literal numeric constant.

13 years agoFix typos in comments.
Ben Pfaff [Thu, 4 Nov 2010 17:32:13 +0000 (10:32 -0700)]
Fix typos in comments.

13 years agoofp-util: Add infrastructure for vendor extensions to OpenFlow error codes.
Ben Pfaff [Fri, 20 Aug 2010 17:29:03 +0000 (10:29 -0700)]
ofp-util: Add infrastructure for vendor extensions to OpenFlow error codes.

Cross-ported from "wdp" branch.

13 years agoofp-util: Add more functions for supporting OpenFlow error codes.
Ben Pfaff [Tue, 19 Oct 2010 16:55:40 +0000 (09:55 -0700)]
ofp-util: Add more functions for supporting OpenFlow error codes.

Cross-ported from "wdp" branch.

13 years agoAUTHORS: Add Romain Lenglet.
Jesse Gross [Fri, 5 Nov 2010 05:01:16 +0000 (22:01 -0700)]
AUTHORS: Add Romain Lenglet.

13 years agoofp-print: always print the flow nw_tos if not wildcarded
Romain Lenglet [Fri, 5 Nov 2010 01:47:50 +0000 (10:47 +0900)]
ofp-print: always print the flow nw_tos if not wildcarded

Print the nw_tos field for all flows if it is not wildcarded, instead
of only if the dl_type is IP and the nw_proto is not ICMP, TCP, or
UDP.

13 years agodatapath: Directly use free_netdev for internal devices.
Jesse Gross [Thu, 4 Nov 2010 23:20:32 +0000 (16:20 -0700)]
datapath: Directly use free_netdev for internal devices.

Currently internal devices register a destructor function which
simply calls free_netdev.  Instead we can simply set the destructor
to free_netdev.  In addition to being cleaner, it is also a bug fix
because the module could be unloaded before the destructor is called,
making a call into our code illegal.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
13 years agoovs-vsctl: Create bridge interface as type "internal".
Ben Pfaff [Thu, 4 Nov 2010 17:53:57 +0000 (10:53 -0700)]
ovs-vsctl: Create bridge interface as type "internal".

The bridge device is always an internal interface, so it seems best to
actually mark it as one.  Jesse would like to eventually make the "type"
column mandatory for Interface records, so here's a step in the right
direction.

13 years agonetdev: Assert that the type of a new network device is correct.
Ben Pfaff [Thu, 4 Nov 2010 00:00:57 +0000 (17:00 -0700)]
netdev: Assert that the type of a new network device is correct.

This would have found a bug that I accidentally inserted while working on
netdev-linux.

13 years agoPORTING: Update to describe netdev-vport.c
Justin Pettit [Thu, 4 Nov 2010 08:59:57 +0000 (01:59 -0700)]
PORTING: Update to describe netdev-vport.c

The "lib/netdev-gre.c" and "lib/netdev-patch.c" files have been
consolidated into "lib/netdev-vport.c".  This change reflect that.

13 years agoCodingStyle: Mention that "free" functions should accept a null pointer.
Ben Pfaff [Thu, 4 Nov 2010 00:07:33 +0000 (17:07 -0700)]
CodingStyle: Mention that "free" functions should accept a null pointer.

I've always written OVS code this way, so this just codifies it so that
others know.

13 years agoovsdb-client: Add JSON output format.
Ben Pfaff [Thu, 4 Nov 2010 00:12:59 +0000 (17:12 -0700)]
ovsdb-client: Add JSON output format.

Requested-by: DK Moon <dkmoon@nicira.com>
CC: DK Moon <dkmoon@nicira.com>
13 years agoovsdb-client: Refactor table code to save original json during formatting.
Ben Pfaff [Tue, 2 Nov 2010 21:50:48 +0000 (14:50 -0700)]
ovsdb-client: Refactor table code to save original json during formatting.

This refactoring should not change user-visible behavior, but saving the
JSON used to format tables will make it possible to print the raw JSON in
the following commit.

13 years agoconfigure: Simplify use of OVS_GREP_IFELSE.
Ben Pfaff [Wed, 8 Sep 2010 23:46:43 +0000 (16:46 -0700)]
configure: Simplify use of OVS_GREP_IFELSE.

Most users of OVS_GREP_IFELSE simply defined HAVE_<regex>, so make this
the default.

13 years agoofproto: Don't show separate wildcard and exact-match tables via OpenFlow.
Ben Pfaff [Wed, 3 Nov 2010 18:07:16 +0000 (11:07 -0700)]
ofproto: Don't show separate wildcard and exact-match tables via OpenFlow.

Formerly the classifier used in Open vSwitch was very sensitive to the
number of exact-match versus wildcarded rules, so it made sense to show
them as separate tables over OpenFlow.  The current classifier doesn't
have the same performance sensitivity, so we might as well just show one
table.

13 years agoclassifier: Rewrite.
Ben Pfaff [Wed, 3 Nov 2010 18:00:58 +0000 (11:00 -0700)]
classifier: Rewrite.

The old classifier was not adaptive: it required knowing the structure of
the flows that were likely to be in use to get good performance.  It is
likely that it degenerated to linear search in any real-world case.

This new classifier is adaptive and should perform better in the real
world.

13 years agoautoconf: Compat checks no longer support multiple files.
Jesse Gross [Wed, 3 Nov 2010 17:14:06 +0000 (10:14 -0700)]
autoconf: Compat checks no longer support multiple files.

We now test that a file exists before grepping but that doesn't
work if there are multiple possible files.  For the one case that
needs this (kmemdup) break the test into two: check the first file
and if the pattern isn't found check the second file.

13 years agodatapath: Work around debugging for csum_and_copy_to_user().
Jesse Gross [Tue, 2 Nov 2010 22:43:32 +0000 (15:43 -0700)]
datapath: Work around debugging for csum_and_copy_to_user().

Certain versions of XenServer add debugging to csum_and_copy_to_user()
in such a way that it changes the function signature.  This adds a
check and a workaround to allow us to build on these versions.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
13 years agoautoconf: Tolerate missing file when grepping.
Jesse Gross [Tue, 2 Nov 2010 23:00:16 +0000 (16:00 -0700)]
autoconf: Tolerate missing file when grepping.

Currently we die when grepping for compatibility strings if the
file does not exist.  Since this can be a valid situation when
files are added in later versions, we shouldn't kill the build.
Instead, note that the file doesn't exist but otherwise treat it
as if the string was not found.

13 years agoovsdb: Fix formatting of ovs.db.Error on Python 2.6.
Ben Pfaff [Tue, 2 Nov 2010 20:13:12 +0000 (13:13 -0700)]
ovsdb: Fix formatting of ovs.db.Error on Python 2.6.

All of the negative Python OVSDB tests were failing on Python 2.6 because
"%s\n" % e yielded the empty string on that version of Python.  In turn,
that was because ovs.db.error.Error.__unicode__ was being called instead of
ovs.db.error.Error.__str__.  I'm puzzled why that was happening, but this
commit fixes it and also seems like a small code cleanup.

Peter Balland helped me gain some insight on this problem.

CC: Peter Balland <peter@nicira.com>
CC: Reid Price <reid@nicira.com>
13 years agodatapath: The definition of struct tbl is needed by rcu_dereference()
Simon Horman [Tue, 2 Nov 2010 12:35:14 +0000 (21:35 +0900)]
datapath: The definition of struct tbl is needed by rcu_dereference()

Due to the use of typeof(*p) by __rcu_dereference_check(),
which was introduced by the Linux changeset
ca5ecddfa8fcbd948c95530e7e817cee9fb43a3d
(rcu: define __rcu address space modifier for sparse) the definition
of the type of a the parameter to rcu_dereference() is needed.

In terms of the datapath, this means that the definition of
struct tbl needs to be available wherever rcu_dereference(dp->table)
is called.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: IFF_OVS_DATAPATH will exist in in 2.6.37
Simon Horman [Tue, 2 Nov 2010 12:35:13 +0000 (21:35 +0900)]
datapath: IFF_OVS_DATAPATH will exist in in 2.6.37

Signed-off-by: Simon Horman <horms@verge.net.au>
[Jesse: drop comment that no longer applies]
Signed-off-by: Jesse Gross <jesse@nicira.com>
13 years agoFix "make dist" by adding include/openvswitch/types.h to the distribution.
Ben Pfaff [Fri, 29 Oct 2010 17:33:03 +0000 (10:33 -0700)]
Fix "make dist" by adding include/openvswitch/types.h to the distribution.

13 years agoclassifier: Change classifier_rule_overlaps() to take a cls_rule *.
Ben Pfaff [Tue, 19 Oct 2010 20:04:52 +0000 (13:04 -0700)]
classifier: Change classifier_rule_overlaps() to take a cls_rule *.

There's no benefit to spelling out all of the components of a cls_rule
separately.  Just use cls_rule itself.

13 years agoclassifier: Change classifier_find_rule_exactly() to take a cls_rule *.
Ben Pfaff [Thu, 14 Oct 2010 20:25:36 +0000 (13:25 -0700)]
classifier: Change classifier_find_rule_exactly() to take a cls_rule *.

There's no benefit to spelling out all of the components of a cls_rule
separately.  Just use cls_rule itself.

13 years agoclassifier: Merge classifier_lookup_wild(), classifier_lookup_exact().
Ben Pfaff [Thu, 14 Oct 2010 17:13:51 +0000 (10:13 -0700)]
classifier: Merge classifier_lookup_wild(), classifier_lookup_exact().

Merge these functions into classifier_lookup() and update its interface.

The new version of the classifier soon to be implemented naturally merges
these functions, so this commit updates the interface early.

13 years agoclassifier: Remove classifier_insert_exact().
Ben Pfaff [Thu, 14 Oct 2010 17:30:07 +0000 (10:30 -0700)]
classifier: Remove classifier_insert_exact().

This function doesn't provide any extra useful functionality.  It is
amenable to a slightly optimized implementation in the current classifier,
but not in the one that will soon replace it, so get rid of it.

13 years agoclassifier: Remove unused functions cls_rule_moved(), cls_rule_replace().
Ben Pfaff [Thu, 14 Oct 2010 00:14:57 +0000 (17:14 -0700)]
classifier: Remove unused functions cls_rule_moved(), cls_rule_replace().

In preparation for rewriting the classifier, remove some functions that
nothing uses and have no tests.

13 years agoodp-util: Print in_port in decimal in format_odp_flow_key().
Ben Pfaff [Fri, 29 Oct 2010 16:50:56 +0000 (09:50 -0700)]
odp-util: Print in_port in decimal in format_odp_flow_key().

Suggested-by: Justin Pettit <jpettit@nicira.com>
13 years agoodp-util: Print tunnel id as part of ODP flow key in format_odp_flow_key().
Ben Pfaff [Fri, 29 Oct 2010 16:49:46 +0000 (09:49 -0700)]
odp-util: Print tunnel id as part of ODP flow key in format_odp_flow_key().

13 years agoflow: Add more functions for working with flow_wildcards.
Ben Pfaff [Thu, 28 Oct 2010 03:15:56 +0000 (20:15 -0700)]
flow: Add more functions for working with flow_wildcards.

These have limited use now but will become more important later.

13 years agoflow: Use vlan_tci_to_pcp() helper.
Ben Pfaff [Tue, 26 Oct 2010 20:09:28 +0000 (13:09 -0700)]
flow: Use vlan_tci_to_pcp() helper.

This is just a small cleanup that should not change any behavior.

13 years agoflow: Un-inline flow_wildcards functions.
Ben Pfaff [Wed, 20 Oct 2010 23:33:10 +0000 (16:33 -0700)]
flow: Un-inline flow_wildcards functions.

These functions really seem too big to inline.

13 years agoofproto: Use ovs_be<N> types in appropriate places.
Ben Pfaff [Thu, 28 Oct 2010 04:17:27 +0000 (21:17 -0700)]
ofproto: Use ovs_be<N> types in appropriate places.

There are many more places in OVS where using these types would be an
improvement, but the ofproto code is extra confusing because it uses
a mix of byte orders.

13 years agoflow: Use ovs_be<N> types in appropriate places.
Ben Pfaff [Tue, 26 Oct 2010 22:24:26 +0000 (15:24 -0700)]
flow: Use ovs_be<N> types in appropriate places.

There are many more places in OVS where using these types would be an
improvement, but the flow code is particularly confusing because it uses
a mix of byte orders.

13 years agoMake the ovs_be<N> types generally available.
Ben Pfaff [Thu, 21 Oct 2010 18:31:43 +0000 (11:31 -0700)]
Make the ovs_be<N> types generally available.

Using these types for data in network byte order makes code clearer, and
allows the "sparse" checker to give warnings for misuse.

13 years agovlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.
Ben Pfaff [Tue, 19 Oct 2010 21:47:01 +0000 (14:47 -0700)]
vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.

It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon,
so this commit switches to the more common form.

13 years agoxtoxll: Rename "byte-order" since it now include more than xtoxll.
Ben Pfaff [Fri, 29 Oct 2010 00:13:18 +0000 (17:13 -0700)]
xtoxll: Rename "byte-order" since it now include more than xtoxll.

Suggested-by: Justin Pettit <jpettit@nicira.com>
13 years agoxtoxll: Add byte conversions macros for use in constant expressions.
Ben Pfaff [Tue, 11 May 2010 23:44:03 +0000 (16:44 -0700)]
xtoxll: Add byte conversions macros for use in constant expressions.

13 years agohmap: New macro HMAP_NODE_NULL_INITIALIZER.
Ben Pfaff [Tue, 26 Oct 2010 00:11:06 +0000 (17:11 -0700)]
hmap: New macro HMAP_NODE_NULL_INITIALIZER.

13 years agoofproto: Fix memory leak in handle_packet_out().
Ben Pfaff [Mon, 25 Oct 2010 23:42:37 +0000 (16:42 -0700)]
ofproto: Fix memory leak in handle_packet_out().

13 years agonetdev: Fix carrier status for down interfaces.
Jesse Gross [Wed, 27 Oct 2010 22:29:16 +0000 (15:29 -0700)]
netdev: Fix carrier status for down interfaces.

Currently netdev_get_carrier() returns both a carrier status and
an error code.  However, usage of the error code was inconsistent:
most callers either ignored it or didn't perform their task if an
error occured, which prevented bond rebalancing.  This makes the
handling consistent by translating an error into a down status in
the netdev library.

Bug #3959

13 years agoofp-util: Fix normalization of IP TOS bits.
Jean Tourrilhes [Thu, 28 Oct 2010 16:56:37 +0000 (09:56 -0700)]
ofp-util: Fix normalization of IP TOS bits.

If the packet is not IP, you probably want to also wildcard the ToS.

13 years agovswitch.xml: Clarify documentation for "ofport" column in Interface table.
Ben Pfaff [Wed, 27 Oct 2010 19:36:36 +0000 (12:36 -0700)]
vswitch.xml: Clarify documentation for "ofport" column in Interface table.

Reported-by: Jeremy Stribling <strib@nicira.com>
13 years agodaemon: Don't call a normal exit from the monitor a "crash".
Ben Pfaff [Wed, 27 Oct 2010 16:29:08 +0000 (09:29 -0700)]
daemon: Don't call a normal exit from the monitor a "crash".

When the monitored child is killed with SIGTERM, the monitoring process
currently logs a message like "1 crashes: pid 12345 died, killed by
signal 15 (Terminated), exiting".  This counts the SIGTERM as a crash, even
though it's intentional.

This commit changes the log message to omit the "%d crashes" part on normal
termination.

13 years agoovsdb-idl: Document some more functions.
Ben Pfaff [Mon, 25 Oct 2010 17:43:28 +0000 (10:43 -0700)]
ovsdb-idl: Document some more functions.

Suggested-by: Justin Pettit <jpettit@nicira.com>
13 years agoofproto: Add coverage counter for reinit_ports()
Justin Pettit [Tue, 26 Oct 2010 21:54:13 +0000 (14:54 -0700)]
ofproto: Add coverage counter for reinit_ports()

The reinit_ports() function is an interesting enough case that it would
be good to know if we're hitting it often.  This adds a
"ofproto_reinit_ports" coverage counter.

13 years agoofproto: Print "drop" action when dumping hidden flows
Justin Pettit [Thu, 21 Oct 2010 17:07:12 +0000 (10:07 -0700)]
ofproto: Print "drop" action when dumping hidden flows

13 years agoovs-external-ids: Better handle VIFs from recently resumed VMs
Justin Pettit [Tue, 26 Oct 2010 00:26:44 +0000 (17:26 -0700)]
ovs-external-ids: Better handle VIFs from recently resumed VMs

XAPI doesn't provide a way to look up a VIF entry based on the name, so
we have to locate it by other methods.  Previously, we were breaking up
the name into the domid and device number.  Unfortunately, it can take
XAPI a few seconds to update the domid of the VM, when resuming from a
suspend.  Since we have the VIF UUID, we can just look up the needed
information directly based on that.

Bug #3930

13 years agodatapath: Add loop detection for RT kernels.
Jesse Gross [Mon, 18 Oct 2010 22:30:20 +0000 (15:30 -0700)]
datapath: Add loop detection for RT kernels.

Our normal loop detection requires disabling preemption while
packet processing takes place.  On RT kernels this isn't acceptable
and interacts badly with spinlocks, so we can't use it.  This
takes advantage of some extra space that is added to struct
task_struct on RT kernels (and the knowledge that we will always
have a valid task_struct) to store the loop counter for a given
thread.  Since we can't make these assumptions on non-RT kernels,
we continue to use the previous method of loop detection there.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: #define local_bh_disable to preempt_disable on RT.
Jesse Gross [Mon, 18 Oct 2010 22:36:59 +0000 (15:36 -0700)]
datapath: #define local_bh_disable to preempt_disable on RT.

We use local_bh_disable() to mean that we don't want to get
preempted or interrupted and normally it covers both situations.
However, on RT kernels local_bh_disable() becomes a no-op because
bottom halves aren't interrupts any more.  We still want the
behavior of disabling preemption so #define them to be the same
on these kernels.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
13 years agoovs-vsctl: Prevent double-free when retrying a transaction
Justin Pettit [Sat, 23 Oct 2010 00:25:02 +0000 (17:25 -0700)]
ovs-vsctl: Prevent double-free when retrying a transaction

13 years agovswitchd: Reset ofport columns of invalid interfaces to -1.
Ben Pfaff [Fri, 22 Oct 2010 20:42:40 +0000 (13:42 -0700)]
vswitchd: Reset ofport columns of invalid interfaces to -1.

Until now, when ovs-vswitchd dropped interfaces because of duplicate names,
it would not write -1 to the ofport column in the OVSDB record for the
interface, which made it appear that the interface was still active (if
it had been before).  This commit fixes the problem.

This commit also sets ofport to -1 for interfaces that cannot be created
for other reasons.

13 years agonetdev-linux: Always check tc_make_request() for NULL return value.
Ben Pfaff [Fri, 22 Oct 2010 20:29:06 +0000 (13:29 -0700)]
netdev-linux: Always check tc_make_request() for NULL return value.

Bug #3912.

13 years agonetdev-linux: Remove unused data in htb_tc_load().
Ben Pfaff [Fri, 22 Oct 2010 20:12:27 +0000 (13:12 -0700)]
netdev-linux: Remove unused data in htb_tc_load().

13 years agoovsdb-idl: Test prerequisite checking.
Ben Pfaff [Fri, 22 Oct 2010 19:52:44 +0000 (12:52 -0700)]
ovsdb-idl: Test prerequisite checking.

13 years agoovs-vsctl: Check for dirty reads within transactions.
Ben Pfaff [Fri, 22 Oct 2010 21:46:30 +0000 (14:46 -0700)]
ovs-vsctl: Check for dirty reads within transactions.

OVSDB is transactional but it does not implement any form of locking.  This
means that read-modify-write operations must verify that the values that
they read are still in place before writing.  This commit adds such
checking.

Bug #2387.
Bug #3856.
Bug #3906.

13 years agoovs-vsctl: Add context pointer to struct vsctl_info.
Ben Pfaff [Fri, 22 Oct 2010 18:22:38 +0000 (11:22 -0700)]
ovs-vsctl: Add context pointer to struct vsctl_info.

This will be needed in upcoming commits.

13 years agovswitch: Make unique "name" columns immutable, to simplify transactions.
Ben Pfaff [Fri, 22 Oct 2010 17:19:13 +0000 (10:19 -0700)]
vswitch: Make unique "name" columns immutable, to simplify transactions.

OVSDB has transactions but not locking, so a transaction that must
maintain an invariant must check that the starting state is what it
expects.  For example, to add a bridge a client must verify that the new
bridge's name does not conflict with any existing bridge's name, given
that the set of bridges might have changed.  One way to do that is for
the client to verify that that the set of bridges is the same and that none
of the bridges has been renamed to the new bridge's name.  By making
bridge names immutable, the latter part of the check can be omitted.

Mirror names are not required to be unique so this commit does not make
them immutable.

CC: Jeremy Stribling <strib@nicira.com>
13 years agoovsdb: Document the "mutable" feature for columns.
Ben Pfaff [Fri, 22 Oct 2010 16:58:12 +0000 (09:58 -0700)]
ovsdb: Document the "mutable" feature for columns.

This feature has been implemented in OVSDB since the beginning, but until
now it was undocumented.

13 years agonetdev-linux: Make queue 0 the default QOS policy
Ethan Jackson [Thu, 21 Oct 2010 22:28:36 +0000 (22:28 +0000)]
netdev-linux: Make queue 0 the default QOS policy

This patch defines, by convention, queue 0 as the default queue in
a particular QOS.  Thus, if queue 0 is defined, all traffic going
through the relevant interface will be enqueued in it. If queue 0
is not defined then ovs will send the traffic directly through the
interface without applying any policy to it.

13 years agobridge: Log port destruction
Justin Pettit [Thu, 21 Oct 2010 22:37:57 +0000 (15:37 -0700)]
bridge: Log port destruction

We log when we create a port, so let's log when we destroy one for
parity.

13 years agotests: Update expected test result to match "ovsdb-client dump" changes.
Ben Pfaff [Thu, 21 Oct 2010 18:28:00 +0000 (11:28 -0700)]
tests: Update expected test result to match "ovsdb-client dump" changes.

Commit 06036898849 "ovsdb-client: Make "dump" print table names in default
output format too" changed the output format of "ovsdb-client dump" without
updating the tests that depended on that output format.  This commit
updates the expected test results to match.

13 years agoovsdb-client: Make "dump" print table names in default output format too.
Ben Pfaff [Thu, 21 Oct 2010 17:48:56 +0000 (10:48 -0700)]
ovsdb-client: Make "dump" print table names in default output format too.

The "dump" command printed table names in CSV and HTML output formats but
they were omitted in the default tabular form.  This commit corrects the
discrepancy.

Reported-by: Brad Hall <brad@nicira.com>
13 years agoFix bug in parsing large datapath IDs.
Ben Pfaff [Thu, 21 Oct 2010 17:40:05 +0000 (10:40 -0700)]
Fix bug in parsing large datapath IDs.

Datapath IDs are unsigned, but dpid_from_string() was parsing them as
signed integers, which caused high values to be capped at INT64_MAX.

Also, document that datapath IDs may not be all-zero.

Reported-by: Pankaj Thakkar <thakkar@nicira.com>
Reported-by: Teemu Koponen <koponen@nicira.com>
13 years agoovs-ofctl: Better document the meaning of "priority" in flow descriptions.
Ben Pfaff [Thu, 21 Oct 2010 16:49:12 +0000 (09:49 -0700)]
ovs-ofctl: Better document the meaning of "priority" in flow descriptions.

Reported-by: Reid Price <reid@nicira.com>
Bug #3905.

13 years agoxenserver debian: Add additional tc output to bugtools
Ethan Jackson [Wed, 20 Oct 2010 19:49:12 +0000 (12:49 -0700)]
xenserver debian: Add additional tc output to bugtools

Added tc commands which show what qos policies are running on each
interface.

13 years agoovs-vswitchd: Add ability to disable in-band on a bridge
Justin Pettit [Tue, 19 Oct 2010 22:58:35 +0000 (15:58 -0700)]
ovs-vswitchd: Add ability to disable in-band on a bridge

In-band control is always enabled when a manager is configured.  Some
applications wish to control all the flows within a bridge, and in-band
control can override that wish.  Depending on how the network is
configured, this can lead to loops as the in-band control rules try to
learn where to send traffic.

This commit adds a "disable-in-band" key to the "other_config" column of
bridge tables.  If set to "true", in-band will be disabled regardless of
manager or controller configuration.

13 years agodatapath: Simplify ODPAT_SET_DL_TCI action.
Ben Pfaff [Mon, 18 Oct 2010 18:18:10 +0000 (11:18 -0700)]
datapath: Simplify ODPAT_SET_DL_TCI action.

There's no need to have a mask in this action, because both parts of the
TCI are part of the flow structure.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
13 years agoovs-monitor-ipsec: Add ability to traverse NATs
Justin Pettit [Mon, 18 Oct 2010 05:43:14 +0000 (22:43 -0700)]
ovs-monitor-ipsec: Add ability to traverse NATs

Stable versions of ipsec-tools have a bug that prevents our using
transport mode through a NAT box.  Even though the bug has been fixed
for years, it is only available in the 0.8 alpha release of ipsec-tools.
This commit modifies our configuration to allow NAT traversal with that
version of ipsec-tools.

NB: An official package for this version of ipsec-tools is not yet
available on Debian, so we're requiring a custom version number.

13 years agoCreate /etc/openvswitch dir when package is installed.
Sajjad Lateef [Fri, 15 Oct 2010 20:41:46 +0000 (13:41 -0700)]
Create /etc/openvswitch dir when package is installed.

Earlier, the /etc/openvswitch directory would get installed as part of
the init script's start sequence. However, as newer packages are added,
including some that create files in this directory during their init
script sequences, a race condition may occur.

This change ensures that the directory /etc/openvswitch is created even
before the init scripts execute. Thus, the race condition is avoided.

13 years agolib: Remove warnings in daemon.c
Ethan Jackson [Thu, 14 Oct 2010 22:59:11 +0000 (22:59 +0000)]
lib: Remove warnings in daemon.c

On some platforms compilation of daemon.c results in implicit
declaration of function fstat and stat warnings.

13 years agostream-ssl: Avoid warning with recent OpenSSL.
Ben Pfaff [Thu, 14 Oct 2010 22:13:33 +0000 (15:13 -0700)]
stream-ssl: Avoid warning with recent OpenSSL.

Reported-by: Ethan Jackson <ethan@nicira.com>
13 years agovswitchd: Bubble no-flood configuration up to bridge
Ethan Jackson [Wed, 13 Oct 2010 22:12:12 +0000 (22:12 +0000)]
vswitchd: Bubble no-flood configuration up to bridge

When bridge.c decides to flood a packet as the result of a "normal"
flow action, it now checks whether each port is configured to
receive flood packets.

Bug #3741

13 years agodocs: Make it clear that ovs-openflowd is an alternative to ovs-vswitchd.
Ben Pfaff [Thu, 14 Oct 2010 16:44:26 +0000 (09:44 -0700)]
docs: Make it clear that ovs-openflowd is an alternative to ovs-vswitchd.

Suggested-by: Vishal Swarankar <vishal.swarnkar@gmail.com>
13 years agoofproto: Fix implementation of OFPP_FLOOD.
Ben Pfaff [Thu, 14 Oct 2010 00:11:56 +0000 (17:11 -0700)]
ofproto: Fix implementation of OFPP_FLOOD.

Commit f1588b1fa1 "datapath: Remove implementation of port groups" removed
a "break" statement accidentally, which caused OFPP_FLOOD to send duplicate
packets and to ignore OFPPC_NO_FLOOD.

13 years agodebian: Make the init script's start command idempotent
Simon Horman [Wed, 13 Oct 2010 22:18:20 +0000 (07:18 +0900)]
debian: Make the init script's start command idempotent

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agonetdev-vport: Actually destroy the vport when "destroy" is called
Justin Pettit [Wed, 13 Oct 2010 07:14:31 +0000 (00:14 -0700)]
netdev-vport: Actually destroy the vport when "destroy" is called

Commit 2b9d65 (netdev-vport: Merge in netdev-patch and netdev-tunnel.)
refactored the common parts of the netdev-patch and netdev-tunnel
sources into netdev-vport.  During the refactoring, the "destroy" method
didn't inherit the netdev_vport_do_ioctl(ODP_VPORT_DEL, ...) call, which
is needed to actually destroy the device in the kernel.  This commit
fixes that.

Bug #3267

13 years agonetflow: Back-out optimization that could lead to infinite loop
Justin Pettit [Tue, 12 Oct 2010 18:24:04 +0000 (11:24 -0700)]
netflow: Back-out optimization that could lead to infinite loop

Commit 924282 (netflow: Do 64-bit division less often.) attempted to
remove the 64-bit division used to break flow records with large byte
counts into multiple NetFlow records.  The calculation to determine the
number of records was incorrect and should have shifted "byte_delta" by
31 instead of 32.  This commit reverts the change (while keeping commit
f22a24 (netflow: Avoid (theoretically) looping 2**32 times.) ), since
the logic is more straight-forward than the optimized version.

Bug #3813

13 years agoofproto: Update flow context for resubmit on VLAN actions
Justin Pettit [Tue, 12 Oct 2010 07:01:37 +0000 (00:01 -0700)]
ofproto: Update flow context for resubmit on VLAN actions

Any modifications that happen to the packet are supposed to be reflected
in the flow context for a resubmitted lookup.  Commit 26233b (datapath:
Combine dl_vlan and dl_vlan_pcp.) broke this for OFPAT_SET_VLAN_VID and
OFPAT_SET_VLAN_PCP.  This corrects that behavior.

Bug #3808 (2/2)

13 years agoodp-util: Remove extraneous "set_tci(" from format_odp_action()
Justin Pettit [Tue, 12 Oct 2010 06:50:36 +0000 (23:50 -0700)]
odp-util: Remove extraneous "set_tci(" from format_odp_action()

The function format_odp_action(), which is used to format the output of
"ovs-dpctl dump-flows", printed "set_tci(" before printing a correct
"set_tci" with actual parameters.

Bug #3808 (1/2)

13 years agolib: ofp-parse segfaults if required argument isn't specified
Ethan Jackson [Fri, 8 Oct 2010 22:15:26 +0000 (22:15 +0000)]
lib: ofp-parse segfaults if required argument isn't specified

Running ovs-ofctl add-flow br0 "in_port=3 actions=resubmit" would
segfault instead of reporting an error.

13 years agodatapath: Fix build break in compat_query_flows().
Ben Pfaff [Mon, 11 Oct 2010 21:05:37 +0000 (14:05 -0700)]
datapath: Fix build break in compat_query_flows().

Commit a01ef04ce "datapath: Drop padding from struct odp_flow_key" removed
the "reserved" member from struct odp_flow_key but overlooked uses of that
member from 64-bit compatibility code.  This commit fixes up the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Fix typo in 64-bit compat header.
Ben Pfaff [Mon, 11 Oct 2010 21:04:10 +0000 (14:04 -0700)]
datapath: Fix typo in 64-bit compat header.

Commit f1588b1f "datapath: Remove implementation of port groups" added a
spurious "V" in the odp-compat.h header.  I failed to test-build that
commit on a 64-bit system and thus this broke the build on x86-64 and other
64-bit systems.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: fix flow used time stats
Hao Zheng [Fri, 8 Oct 2010 23:26:15 +0000 (16:26 -0700)]
datapath: fix flow used time stats

This commit fixes a problem where datapath flow used stats can report
incorrent value, thus may result in flow expirations being incorrect.
This happens when a kernel jiffies rollover occurs between the last time
a flow is hit and the flow stats is queried.

Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Hao Zheng <hzheng@nicira.com>
13 years agodatapath: Always use GFP_ATOMIC to execute actions.
Ben Pfaff [Fri, 10 Sep 2010 18:16:31 +0000 (11:16 -0700)]
datapath: Always use GFP_ATOMIC to execute actions.

These functions run 99% of the time in atomic context and the benefit of
passing along the 'gfp' argument for the other 1% doesn't seem to outweigh
the cost.

Suggested-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agodatapath: Drop padding from struct odp_flow_key.
Ben Pfaff [Fri, 10 Sep 2010 18:18:53 +0000 (11:18 -0700)]
datapath: Drop padding from struct odp_flow_key.

Breaking this out as a separate commit should make it easier to see what
needs to change later, if we need to reintroduce padding at some point.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
13 years agodatapath: Combine dl_vlan and dl_vlan_pcp.
Ben Pfaff [Fri, 8 Oct 2010 23:26:21 +0000 (16:26 -0700)]
datapath: Combine dl_vlan and dl_vlan_pcp.

This allows eliminating padding from odp_flow_key, although actually doing
that is postponed until the next commit.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
13 years agoflow: Get rid of flow_t typedef.
Ben Pfaff [Fri, 3 Sep 2010 18:30:02 +0000 (11:30 -0700)]
flow: Get rid of flow_t typedef.

When userspace and the kernel were using the same structure for flows,
flow_t was a useful way to indicate that a structure was really a userspace
flow instead of a kernel one, but now it's better to just write "struct
flow" for consistency, since OVS doesn't use typedefs for structs
elsewhere.

Acked-by: Jesse Gross <jesse@nicira.com>
13 years agoflow: Separate "flow_t" from "struct odp_flow_key".
Ben Pfaff [Mon, 11 Oct 2010 20:31:35 +0000 (13:31 -0700)]
flow: Separate "flow_t" from "struct odp_flow_key".

The "struct odp_flow_key" used in the kernel datapath is conceptually
separate from the "flow_t" used in userspace, but until now we have
used the latter as a typedef for the former for convenience.  This commit
separates them.  This makes it possible in upcoming commits to change
them independently.

This is cross-ported from the "wdp" branch, which has had it for months.

13 years agodatapath: Remove implementation of port groups.
Ben Pfaff [Fri, 8 Oct 2010 23:36:13 +0000 (16:36 -0700)]
datapath: Remove implementation of port groups.

The "port group" concept seems like a good one, but it has not been
used very much in userspace so far, so before we commit ourselves to
a frozen API that we must maintain forever, remove it.  We can always
add it back in later as a new kind of vport.

Signed-off-by: Ben Pfaff <blp@nicira.com>
13 years agonetdev-vport: Merge in netdev-patch and netdev-tunnel.
Ben Pfaff [Wed, 6 Oct 2010 22:35:53 +0000 (15:35 -0700)]
netdev-vport: Merge in netdev-patch and netdev-tunnel.

The only real difference between netdev-patch and netdev-tunnel is in their
parse_config() implementation.  That's a lot of extra code to maintain, for
questionable benefit.  This commit merges them into the netdev-vport code,
which was heretofore merely a collection of helper functions.