Ben Pfaff [Tue, 2 Nov 2010 17:45:33 +0000 (10:45 -0700)]
vswitch: Add other-config:in-band-queue to set queue for in-band control.
Until now, in-band control traffic has always gone to the default queue,
typically queue 0. It makes sense to be able to assing control traffic to
its own queue, so this commit enables that.
Ben Pfaff [Thu, 28 Oct 2010 20:26:31 +0000 (13:26 -0700)]
classifier: Drop CLS_INC_* enumerations and related 'include' parameters.
This type and these parameters were useful when ofproto had the need to
separately traverse exact-match rules looking for subrules, but it no
longer does that because subrules (now called "facets") are not kept in
the classifier any longer. All the callers are now passing CLS_INC_ALL
anyhow, so we might as well delete this feature and simplify the code.
Ben Pfaff [Fri, 29 Oct 2010 23:33:08 +0000 (16:33 -0700)]
ofproto: Fix accounting in facet_revalidate().
When a facet moves from one rule to another, facet_revalidate() would
credit the packet and byte counters for the facet to the new rule (which
hasn't actually had any packets sent with the new actions at this point),
instead of to the old rule (which did potentially get some packets sent
with its old actions). This commit fixes the problem.
Ethan Jackson [Tue, 9 Nov 2010 18:41:47 +0000 (10:41 -0800)]
netdev-linux: HFSC in linux
This commit implements the Hierarchical Fair Service Curve queuing
discipline in linux. HFSC performs better at high bandwidth and
implements min-rate proportional sharing of excess bandwidth. Only
a simplified configuration interface is exposed to the user. This
can be expand to allow more tweaking in the future.
Ben Pfaff [Fri, 29 Oct 2010 18:38:39 +0000 (11:38 -0700)]
ofproto: Disable timeouts for flows added by ofproto_add_flow().
None of the existing callers of ofproto_add_flow() want an idle timeout,
but ofproto_add_flow() was giving them a 5-second timeout anyway. I don't
know how this worked properly--in-band will patiently add the flow back
every few seconds anyway, but the bridge doesn't do that.
Also add an explanatory comment to ofproto_add_flow().
Ben Pfaff [Thu, 11 Nov 2010 19:04:10 +0000 (11:04 -0800)]
ofproto: Fix used time of revalidated subrules.
Despite the comment, the 'used' member of a rule is always set to at least
the value of 'created', except in one case in revalidation. That case
appears to be just a mistake, so this commit changes it and corrects the
comment.
Ben Pfaff [Tue, 9 Nov 2010 23:58:36 +0000 (15:58 -0800)]
socket-util: Work around Unix domain socket path name limits on Linux.
Many Open vSwitch tests fail on Debian's automatic build machines because
the builds occur in deeply nested directories with long names. OVS tries
to bind and connect to Unix domain sockets using absolute path names, which
in combination with long directory names means that the socket's name
exceeds the limit for Unix domain socket names (108 bytes on Linux).
This commit works around the problem on Linux by indirecting through
/proc/self/fd/<dirfd>/<basename> when names exceed the maximum that can be
used directly.
Reported-by: Hector Oron <hector.oron@gmail.com> Reported-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc> Reported-by: Roger Leigh <rleigh@codelibre.net>
Debian bug #602891.
Debian bug #602911.
Ben Pfaff [Tue, 26 Oct 2010 16:41:24 +0000 (09:41 -0700)]
ofp-util: Make validate_actions() take a struct flow *.
The upcoming support for actions on registers will require the flow to
validate actions, so this commit adds the parameter in advance. It is
not yet used.
Ben Pfaff [Thu, 28 Oct 2010 04:20:50 +0000 (21:20 -0700)]
ofproto: Refactor handle_packet_out().
An upcoming commit will require the flow to be passed in as part of
OpenFlow action validation, but handle_packet_out() has until now been
structured to make this difficult. This commit refactors it to better
suit this purpose.
Ben Pfaff [Tue, 9 Nov 2010 21:48:57 +0000 (13:48 -0800)]
datapath: Use "struct rtnl_link_stats64" instead of "struct odp_vport_stats".
Linux 2.6.35 added struct rtnl_link_stats64, which as a set of 64-bit
network device counters is what the OVS datapath needs. We might as well
use it instead of our own.
This commit moves the if_link.h compat header from datapath/ into the
top-level include/ directory so that it is visible both to kernel and
userspace code.
Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Ben Pfaff [Tue, 19 Oct 2010 23:01:49 +0000 (16:01 -0700)]
nicira-ext: Shuffle comments around.
It seemed to me that the descriptions of what actions do should be just
above the action structures, where the reader can see the arguments,
instead of just above the enumeration name, so I rearranged the code
this way.
A few actions didn't have their own structures, so to do this I had to give
them some.
Ben Pfaff [Mon, 8 Nov 2010 18:43:19 +0000 (10:43 -0800)]
ofproto: Refactor handle_flow_mod().
This breaks this OpenFlow handler into two parts, one responsible
for parsing and constructing OpenFlow messages and one that works
with the flow table. The latter will be reused in a later commit
that implements the Nicira Extended Match flexible flow match
extension.
This breaks this OpenFlow handler into two parts, one responsible
for parsing and constructing OpenFlow messages and one that works
with the flow table. The latter will be reused in a later commit
that implements the Nicira Extended Match flexible flow match
extension.
Ben Pfaff [Fri, 5 Nov 2010 18:59:05 +0000 (11:59 -0700)]
ofproto: Make flow format specific to an OpenFlow connection.
Until now the flow format has been a global property of an ofproto.
This is no longer appropriate, because the Nicira Extended Match
flow format that upcoming commits will add is not compatible with
OpenFlow 1.0-only controllers. This commit changes the flow format
to a property of an individual OpenFlow connection.
Ben Pfaff [Fri, 5 Nov 2010 17:22:18 +0000 (10:22 -0700)]
Add "Manager" and "manager_options" to allow options for OVSDB connections.
I'm retaining the "managers" column in the Open_vSwitch table for now, but
I hope that applications transition to using "manager_options" eventually
so that we could drop it.
CC: Andrew Lambeth <wal@nicira.com> CC: Jeremy Stribling <strib@nicira.com>
Ben Pfaff [Wed, 3 Nov 2010 17:01:38 +0000 (10:01 -0700)]
docs: Implement our own dot->pic translator.
Recent versions of Graphviz no longer support output to PIC format, so this
commit adds our own internal translator from dot's "plain" output format
to PIC format. The "plain" format works best with slightly different
"dot" input (advised by the Graphviz manual description of the "plain"
format) so this commit also adjusts ovsdb-dot's output.
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.
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.
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>
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.
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.
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.
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.
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.
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>
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.
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>
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>
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.