Ian Campbell [Wed, 14 Oct 2009 10:38:40 +0000 (11:38 +0100)]
logrotate: Allow logs to be missing
In particular ovs-brcompatd.log is not present if compatibility mode is
disabled. Without this logrotate attempts to send email to the
administrator.
Ian Campbell [Thu, 1 Oct 2009 16:26:22 +0000 (09:26 -0700)]
xenserver: Fix init script typos that prevented turning brcompatd back on.
Commit
723a8c3ca "xenserver: Disable brcompatd" turned off brcompatd by
default but allowed it to be enabled using an option, but the option
didn't work. This commit fixes that problem.
Ian Campbell [Fri, 26 Mar 2010 20:24:06 +0000 (13:24 -0700)]
xenserver: Disable brcompatd except on XenServer 5.5.0
The compat layer is now unused in the vswitch branch of XenServer.
Based on change originally by Ian Campbell, cherry-picked from
"xs5.7" branch. The original change was not conditional on the
XenServer version.
Ian Campbell [Wed, 14 Oct 2009 10:37:19 +0000 (11:37 +0100)]
Ensure "service vswitch status" returns appropriate error code
This command was returning success when vswitchd was not running.
Our automated test relies on this command to decide if the host uses
vswitch or not.
If vswitchd is not OK then brcompatd is not checked at all. Since the
return codes apparently have specific meanings I couldn't see a sensible
way to combine multiple failure results.
(Cherry-picked from xs5.7 branch by Ben Pfaff but merge conflicts meant
that the whole thing had to be redone.)
Ian Campbell [Fri, 2 Oct 2009 10:32:10 +0000 (11:32 +0100)]
xenserver: Correct "service vswitch status" when brcompatd is disabled
I don't think it makes sense to report brcompatd's status when it is
explicitly disabled. Doing so causes service status to return an error
when brcompatd is deliberately disabled.
Also fix up a tab vs. spaces whitespace snafu.
Justin Pettit [Fri, 26 Mar 2010 05:38:13 +0000 (22:38 -0700)]
Cleanup default file locations and XenServer packaging
This commit cleans up the locations of a number of files and directories
used. These include:
- Config file lives in /etc/openvswitch/conf.db
- Logs go into /var/log/openvswitch
- ovsdb-server socket is /var/run/openvswitch/db.sock
- Schema goes into /usr/share/openvswitch/vswitch.ovsschema
- PID files go in /var/run/openvswitch
For XenServer, these additional changes are made:
- Cores go in /var/xen/openvswitch
- OVS binaries run in /var/xen/openvswitch
In addition, it attempts to cleanup the XenServer packaging. This
includes referring to the project as "openvswitch" as opposed to the
somewhat presumptuous "vswitch".
Note: Changes to the Debian packaging will be forthcoming.
Ian Campbell [Fri, 26 Mar 2010 16:35:32 +0000 (09:35 -0700)]
xenserver: Ensure that Bridge.other-config:hwaddr and Interface.MAC are set as appropriate.
Otherwise bridges can end up with a generated MAC address using Nicira OID
which has an impact when using DHCP on that devices.
tests/interface-reconfigure.at updated by Ben Pfaff.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Justin Pettit [Tue, 23 Mar 2010 01:41:44 +0000 (18:41 -0700)]
xenserver: Add ovsdb-server status to xsconsole vswitch overview
Ben Pfaff [Thu, 25 Mar 2010 19:30:05 +0000 (12:30 -0700)]
Merge "citrix" branch into "master".
This merge is long overdue, simply because I forgot that there were
outstanding changes on "citrix" that had not yet been merged.
The important fix here is the addition of mlockall. This fixes some
bugs seen under stressful conditions in XenServer.
Ben Pfaff [Thu, 25 Mar 2010 18:34:01 +0000 (11:34 -0700)]
timeval: Always log true poll interval instead of rounding off.
This code triggers when a trip through the process's main loop takes much
longer than expected. The code for calculating the expected time rounds
down to a maximum of 10000 ms to avoid overflow. But there is no reason
that the correct time should not be displayed in the log message, and
furthermore displaying the correct time may help tracking down the
underlying issue, since it lets the administrator find out exactly when
the trip through the main loop started. So this commit displays the exact
time without rounding down.
Ben Pfaff [Thu, 25 Mar 2010 16:46:31 +0000 (09:46 -0700)]
INSTALL.bridge: Update.
The instructions did not assume the default /usr/local install location,
which is confusing.
Also, the instructions partially replicated those in INSTALL.Linux, but it
seems better to only give the additional steps that are necessary, so do
that too.
Reported-by: Jeongkeun Lee <jklee@hp.com>
Tetsuo NAKAGAWA [Thu, 25 Mar 2010 14:54:15 +0000 (10:54 -0400)]
dpif-linux: Fix file descriptor leak.
get_major() opens /proc/devices to get the openvswitch major number
but never closes the FD.
Ben Pfaff [Fri, 19 Mar 2010 18:44:31 +0000 (11:44 -0700)]
ofproto: Don't optimize out updating flow cookie.
The OFPFC_MODIFY and OFPFC_MODIFY_STRICT optimizes out modifying the
actions if the actions didn't change, but it also skipped updating the
flow cookie in that case, which seems wrong. This commit fixes the
problem.
Ben Pfaff [Wed, 24 Mar 2010 00:20:42 +0000 (17:20 -0700)]
jsonrpc: Fix potential memory leak.
This is unlikely to occur very often in practice, because s->stream
usually gets stuffed into s->rpc before long, but it is still a good idea
to fix it.
Ben Pfaff [Tue, 23 Mar 2010 22:27:44 +0000 (15:27 -0700)]
fatal-signal: Initialize library upon any call to public function.
Not calling fatal_signal_init() means that the signal handlers don't get
registered, so the process won't clean up on fatal signals. Furthermore,
signal_fds[0] is then 0, which means that fatal-signal_wait() waits on
stdin, so if you are testing a program interactively and accidentally type
something on stdin then that program's CPU usage jumps to 100%.
Since poll_block() calls fatal_signal_wait() this seems like the most
reliable solution.
Ben Pfaff [Tue, 23 Mar 2010 22:38:37 +0000 (15:38 -0700)]
ovsdb: Fix ovsdb-server crash when specifying nonexistent file.
ovsdb_file_open__() can call (NULL) in its error exit
path, but ovsdb_schema_destroy() didn't tolerate a null pointer argument.
Bug #2538.
Ben Pfaff [Wed, 24 Mar 2010 20:15:41 +0000 (13:15 -0700)]
stream-ssl: Only re-read certificates and keys if they change.
Commit
415f6c0b1 "stream-ssl: Make no-op reconfiguration cheap" caused
ovsdb-server to re-read its certificates and keys every 60 seconds just
in case they changed. However, doing this causes OpenSSL to drop its
connections. This commit solves the problem by making stream-ssl re-read
certificates and keys only if the files changed.
Bug #2535.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Ben Pfaff [Thu, 18 Mar 2010 16:37:31 +0000 (09:37 -0700)]
vswitchd: Make names of Bridge external_ids generic.
Until now the names of the external_ids keys used for Bridge records have
implied that they are specific to XenServer, because they begin with "xs-".
They are more generic in intent, however, so this commit removes the "xs-"
prefix and explains them more generically.
This finishes the renaming process started in commit
c0f9490 "vswitchd:
Make names of Interface external_ids generic."
CC: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 24 Mar 2010 21:41:32 +0000 (14:41 -0700)]
INSTALL.Linux: Consistently assume installation in /usr/local.
The documentation was inconsistent about assuming whether the installation
was to / or to /usr/local. Since the default is /usr/local, use that.
Reported-by: Jeongkeun Lee <jklee@hp.com>
Ben Pfaff [Wed, 24 Mar 2010 21:42:23 +0000 (14:42 -0700)]
INSTALL.Linux: Document "ovs-vsctl init" step to installation.
If the database is not initialized then other programs will complain.
Reported-by: Jeongkeun Lee <jklee@hp.com>
Ben Pfaff [Tue, 23 Mar 2010 16:27:08 +0000 (09:27 -0700)]
datapath: Support 2.6.33 kernel layout in build system.
The 2.6.33 kernel moves generated header files to include/generated, so
we need to look for autoconf.h there.
Reported-by: Brandon Heller <brandonh@stanford.edu>
Ben Pfaff [Tue, 23 Mar 2010 16:40:26 +0000 (09:40 -0700)]
xenserver: Fix "ovs-vsctl get" call in vswitch-cfg-update.
The ovs-vsctl arguments were being passed as a single string instead of
broken up as if the shell had performed word splitting. This fixes the
problem.
Without this commit, "unknown command 'get Open_vSwitch . managers';
use --help for help" appears in the system log. Adding the commit
suppresses that message.
NIC-72.
Reported-by: Andy Southgate <andy.southgate@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 22 Mar 2010 16:40:13 +0000 (09:40 -0700)]
ovsdb-server: Fix build when configuring without --enable-ssl.
Reported-by: Andy Southgate <andy.southgate@citrix.com>
Ben Pfaff [Fri, 19 Mar 2010 00:09:42 +0000 (17:09 -0700)]
vswitch: Limit SSL table to a single row.
Only a single row in the SSL can be useful currently. This should help to
prevent confusion since ovsdb-server will choose an SSL configuration
randomly if there is more than one.
Ben Pfaff [Fri, 19 Mar 2010 00:12:02 +0000 (17:12 -0700)]
ovsdb-server: Obtain SSL configuration from database.
ovsdb-server should be able to obtain its SSL configuration from the
database that it is serving out, instead of having to specify it on the
command line. This commit makes it so.
Ben Pfaff [Fri, 19 Mar 2010 00:00:02 +0000 (17:00 -0700)]
docs: Fix ovsdb-server manpage.
The description of --remote=db:table,column got accidentally dropped a
number of commits back, so restore it. Also, document that ovsdb-server
supports SSL bootstrapping.
Ben Pfaff [Thu, 18 Mar 2010 23:59:04 +0000 (16:59 -0700)]
docs: Move PKI section heading into individual manpages.
The ovsdb-server manpage needs a paragraph between the heading and the
first option description, so the heading can't go into the common fragment.
Ben Pfaff [Fri, 19 Mar 2010 00:12:27 +0000 (17:12 -0700)]
docs: Make SSL manpage fragments less specific to OpenFlow.
These manpage fragments are used in OVSDB manpages as well, so their text
should try to avoid referring to OpenFlow-specific concepts.
Ben Pfaff [Thu, 18 Mar 2010 23:40:35 +0000 (16:40 -0700)]
stream-ssl: Make no-op reconfiguration cheap.
Until now, the stream_ssl functions for configuring private keys,
certificates, and CA certificates have always called into OpenSSL to read
a file. This commit instead makes them do that only if the file name
changed (or it has been 60 seconds since we last tried, in case someone
installed the file behind our backs).
This allows us to factor some code out of vswitchd. In an upcoming commit
we will want to do essentially the same thing from ovsdb-server, so this
avoid code redundancy.
Ben Pfaff [Thu, 18 Mar 2010 23:08:32 +0000 (16:08 -0700)]
stream-ssl: Permit race in bootstrapping CA certificate.
If two processes were both configured to bootstrap the CA certificate, then
one of them would succeed in writing it to a file and use it, and the other
one would fail to use it because the file was created behind its back.
This commit fixes the problem by making the bootstrap code accept a CA
certificate file that exists at the time that bootstrapping tries to create
it.
Jesse Gross [Fri, 19 Mar 2010 17:54:36 +0000 (13:54 -0400)]
classifer: Fix test classifier to match real classifier.
The trivial test classifier had the same bug as the real classifier
when replacing matching flows. This caused it to not find the
original bug and then break when the bug was fixed.
Jesse Gross [Fri, 19 Mar 2010 16:08:16 +0000 (12:08 -0400)]
classifier: Check all rules of equal priority when inserting.
When adding a new classifier rule we check if there is a rule
of the same priority first and overwrite it before inserting a
new rule. Previously we would stop looking if we found one rule
in the correct bucket with the same priority, even if it didn't
match. This keeps going until we either find a matching rule or
we run out of equal priority rules.
Reported-by: Tetsuo NAKAGAWA <nakagawa@mxc.nes.nec.co.jp>
Justin Pettit [Sat, 13 Mar 2010 14:11:47 +0000 (06:11 -0800)]
xenserver: Make OVS xsconsole plugin configure management channel
Previously, the xsconsole plugin configured a single OpenFlow controller
configuration across all bridges. With the management channel, we can
now have the manager configure the bridges' controllers individually.
This changes the plugin to only set that management IP.
Justin Pettit [Sat, 13 Mar 2010 12:41:20 +0000 (04:41 -0800)]
xenserver: Remove support for setting different controllers for datapaths
A hack was put in a while back to support setting different controllers for
different datapaths by defining a "for-bridges" value in the
"vSwitchController" key. It is no longer necessary to do that with the
management protocol, since the manager can directly set controllers for
each datapath.
Justin Pettit [Sat, 13 Mar 2010 14:24:47 +0000 (06:24 -0800)]
xenserver: Add ovsdb-server logs to xen-bugtool
Ben Pfaff [Wed, 17 Mar 2010 00:09:44 +0000 (17:09 -0700)]
vswitch: Limit Open_vSwitch table to a single record.
This table has always been limited to a single record. This commit makes
the database itself enforce that limit.
Ben Pfaff [Wed, 17 Mar 2010 00:08:06 +0000 (17:08 -0700)]
ovsdb: Allow constraining the number of rows in a table.
Ben Pfaff [Wed, 17 Mar 2010 00:07:22 +0000 (17:07 -0700)]
ovsdb: Fix error message when parsing an operation fails.
Otherwise you get errors with text like "ovsdb operation 2 of 1", which
is confusing.
Ben Pfaff [Thu, 18 Mar 2010 18:24:55 +0000 (11:24 -0700)]
ovsdb: Compact databases online automatically and on-demand.
If the database grows fairly large, and we've written a fair number of
transactions to it, and it's been a while since the database was compacted,
then (after the next commit) compact the database.
Also, compact the database online if the "ovsdb-server/compact" command is
issued via unixctl. I suspect that this feature will rarely if ever be
used in practice, but it's easier to test than compacting automatically.
Bug #2391.
Ben Pfaff [Tue, 16 Mar 2010 22:13:42 +0000 (15:13 -0700)]
ovsdb: Rename ovsdb_file_replica to ovsdb_file.
This is in preparation for exposing ovsdb_file to clients outside this
translation unit. These clients don't care that the ovsdb_file is an
ovsdb replica--that's an implementation detail--and so it makes sense to
rename it from their point of view.
This is just a search-and-replace plus reindenting where appropriate.
Ben Pfaff [Tue, 16 Mar 2010 22:06:11 +0000 (15:06 -0700)]
util: New functions get_cwd(), abs_file_name().
These will be used further in an upcoming commit.
Ben Pfaff [Tue, 16 Mar 2010 19:42:40 +0000 (12:42 -0700)]
ovsdb: Always set *dbp to null on failure in ovsdb_file_open__().
Found via inspection. I do not know that this fixes a real bug.
Ben Pfaff [Wed, 17 Mar 2010 21:35:56 +0000 (14:35 -0700)]
Merge "next" branch into "master".
Ben Pfaff [Tue, 16 Mar 2010 23:31:52 +0000 (16:31 -0700)]
ovsdb: Add tests for transient ovsdb-server.
This variant of the ovsdb execution tests runs each transaction against a
separately started ovsdb-server. The idea is that this should help to
ferret out any differences between what ovsdb-server has in memory and what
actually gets committed to disk. There should not be any such differences,
but we need to test for that.
Ben Pfaff [Mon, 15 Mar 2010 22:23:22 +0000 (15:23 -0700)]
vswitch: Use weak references in Mirror table.
A port mirror seems sufficiently disconnected from the ports that it
mirrors that it seems counterproductive to forbid removing a port if
it is mirrored. This commit therefore changes the references from
Mirror to Port from strong references to weak references, so that
removing a port automatically removes references to it from the Mirror
table.
Since this could cause the port and VLAN selection for the Mirror to
become empty, which would make the mirror select all packets, at the same
time this commit adds a new column "select_all" to Mirror, to explicitly
allow selecting all packets.
Ben Pfaff [Mon, 15 Mar 2010 22:41:54 +0000 (15:41 -0700)]
ovsdb: Add support for weak references.
Ben Pfaff [Fri, 12 Mar 2010 01:14:31 +0000 (17:14 -0800)]
ovsdb: Check for changed columns only once per transaction commit.
Until now, each part of a transaction commit that is interested in whether
a column's value has changed has had to do a comparison of the old and new
values itself. There can be several interested parties per commit
(generally one for file storage and one for each remove OVSDB connection),
so this seems like too much redundancy. This commit adds a bitmap
to struct ovsdb_txn_row that tracks whether a column's value has actually
changed, to reduce this overhead.
As a convenient side effect of doing these checks up front, it then
becomes easily possible to drop txn_rows (and txn_tables and entire txns)
that become no-ops. (This probably fixes bug #2400, which reported that
some no-ops actually report updates over monitors.)
Ben Pfaff [Fri, 12 Mar 2010 19:03:44 +0000 (11:03 -0800)]
ovsdb: Simplify referential integrity checking commit logic.
Until now, the commit-time logic for verifying referential integrity
modified row reference counts in-place. That meant that it had to be
careful to be able to roll back those changes if it did detect a violation.
This commit changes the logic to avoid making any in-place changes.
Instead, the reference counts are tracked outside the rows themselves and
committed only if the transaction as a whole satisfies the constraints.
This eliminates a fair bit of code and paves the way for implementing
weak references as well.
Ben Pfaff [Wed, 17 Mar 2010 18:16:07 +0000 (11:16 -0700)]
ovsdb: Introduce for_each_txn_row() iterator function for transactions.
A number of places in the transaction code want to iterate over all of
the txn_rows and possibly modify them. It is getting messy to duplicate
the code to do this everywhere. This commit introduces a new function that
encapsulates the iteration logic, efficiently handling modifications made
by the callback function.
Upcoming commits will add more uses of this iterator function.
Ben Pfaff [Fri, 12 Mar 2010 18:27:33 +0000 (10:27 -0800)]
New function ovsdb_error_assert() for verifying that no error occurred.
Ben Pfaff [Fri, 12 Mar 2010 00:56:36 +0000 (16:56 -0800)]
ovsdb: Centralize and make consistent setting txn_row members of rows.
When a transaction modified a row, the "old" row's txn_row member was
not being set to the txn_row. This commit changes that and factors out
the code to set the txn_row member of the rows within a txn_row.
This is not a bug fix, because nothing previously cared about the txn_row
member of the old version of a row, but it does matter for an upcoming
commit.
Ben Pfaff [Mon, 15 Mar 2010 21:50:14 +0000 (14:50 -0700)]
ovsdb-tool: Fix segfault if deleted row doesn't exist.
This "can't happen" normally, but it will if you monkey with the OVSDB
file by hand such that a row that gets deleted never actually existed in
the db.
Ben Pfaff [Wed, 17 Mar 2010 18:02:41 +0000 (11:02 -0700)]
debian: Upgrade database before starting ovsdb-server.
The XenServer init script has been upgrading the database before starting
ovsdb-server for some time now, but the corresponding change was never
made to the Debian init script. This commit fixes that.
Ben Pfaff [Wed, 17 Mar 2010 16:53:36 +0000 (09:53 -0700)]
tests: Don't use obsolete names in ovs-vsctl tests of external-ids.
The names used in the tests don't matter, but they could potentially
confuse a reader, so use more generic names.
Reported-by: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Fri, 12 Mar 2010 22:58:30 +0000 (14:58 -0800)]
vswitchd: Remove documentation of xs-network-names.
The xs-network-names external_id is no longer used or populated, so remove
its documentation.
Ben Pfaff [Fri, 12 Mar 2010 22:57:59 +0000 (14:57 -0800)]
vswitchd: Make names of Interface external_ids generic.
Until now the names of the external_ids keys used for Interface records
have implied that they are specific to XenServer, because they begin with
"xs-". They are more generic in intent, however, so this commit removes
the "xs-" prefix and explains them more generically.
The Bridge record's external_ids still need renaming.
Ben Pfaff [Fri, 12 Mar 2010 23:08:18 +0000 (15:08 -0800)]
xenserver: Restore XS5.5 compatibility for vif script.
XAPI in XenServer 5.5 does not put the vif-uuid or network-uuid into
XenStore, so the vif script needs to query xapi for those attributes in
that case.
Tested with XenServer 5.5.0 update 1 and XenServer 5.5.9 build 29381
(the latter just to make sure I didn't break anything).
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Wed, 17 Mar 2010 16:48:05 +0000 (09:48 -0700)]
xenserver: Must pass --no-wait to ovs-vsctl before starting ovs-vswitchd.
Otherwise ovs-vsctl pauses until it times out waiting for ovs-vswitchd to
reload its configuration.
Jesse Gross [Fri, 12 Mar 2010 21:36:58 +0000 (16:36 -0500)]
datapath: Consistently maintain flow key.
After executing an action that changes a packet sometimes we update
the flow key and sometimes we don't. This is potentially problematic
because we sometimes use the key for checks later on. This consistently
maintains the key.
Jesse Gross [Fri, 12 Mar 2010 21:05:25 +0000 (16:05 -0500)]
datapath: Validate ToS when flow is added.
Check that the ToS is valid when the flow is added, not every time
it is used.
Jesse Gross [Thu, 4 Mar 2010 22:55:44 +0000 (17:55 -0500)]
datapath: Use constants instead of actual values.
Use the appropriate constants instead of the values for masks, shifts,
etc.
Jesse Gross [Fri, 12 Mar 2010 19:10:13 +0000 (14:10 -0500)]
bridge: Remove leftover from config file.
The 'pfx' variable is no longer used now that the config file is
gone and its only purpose in life is to be freed so get rid of it.
Tetsuo NAKAGAWA [Mon, 15 Mar 2010 17:16:02 +0000 (10:16 -0700)]
vconn-stream: Copy stream's IP and port info into vconn at creation time.
This fixes in-band control, which depends on knowing the local and remote
IP and port.
Ben Pfaff [Mon, 15 Mar 2010 17:13:51 +0000 (10:13 -0700)]
vconn-stream: Fix listening on ptcp: and pssl: without specifying a port.
This function was adding an extra ":", which made pstream_open() unhappy.
Justin Pettit [Thu, 11 Mar 2010 15:49:20 +0000 (07:49 -0800)]
ofp-print: Cleanup typos in print OpenFlow Flow Stats Reply
Justin Pettit [Sat, 6 Mar 2010 02:41:16 +0000 (18:41 -0800)]
Add "external_ids" column to Open_vSwitch table, add "system-uuid" on Xen.
Software that interfaces to Open vSwitch needs a way to identify the
host that the switch is running on. This commit adds such a way.
Cleaned up version of original implementation by Ben Pfaff.
Ben Pfaff [Tue, 9 Mar 2010 18:03:29 +0000 (10:03 -0800)]
ofproto: Avoid extra call to time_msec().
compose_flow_removed() already has the current time conveniently provided
as a parameter, so there is no need to call time_msec() directly.
Also squashes an annoying GCC warning about an unused parameter.
Ben Pfaff [Tue, 9 Mar 2010 00:31:55 +0000 (16:31 -0800)]
ovs-brcompatd: Fix stupid merge error.
Apparently I can no longer rely on myself to look for compiler warnings
before I push.
Introduced in commit
4b3a0009 "ovs-brcompatd: Delete what Bridge
references when deleting a Bridge."
Ben Pfaff [Mon, 8 Mar 2010 22:01:16 +0000 (14:01 -0800)]
ovsdb-tool: Do not lock source db for compacting or converting to new db.
"ovsdb-tool compact SRC DST" and "ovsdb-tool convert SRC SCHEMA DST" do not
need to lock SRC, because they do not modify it.
Reported-by: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Mon, 8 Mar 2010 21:52:43 +0000 (13:52 -0800)]
lockfile: Occasionally log a warning when waiting for a lockfile.
Waiting for a lockfile can cause mysterious pauses for users. Logging a
warning to the console every so often gives them feedback on what is
happening.
Reported-by: Justin Pettit <jpettit@nicira.com>
Ben Pfaff [Fri, 26 Feb 2010 20:19:58 +0000 (12:19 -0800)]
Raise minimum Autoconf version to 2.64.
Our configure scripts were actually using Autoconf features introduced in
version 2.64 (e.g. AT_SKIP_IF, AT_CHECK_UNQUOTED), so we should not
claim 2.63 as prerequisite.
Reported-by: Andy Southgate <andy.southgate@citrix.com>
Ben Pfaff [Mon, 8 Mar 2010 22:23:42 +0000 (14:23 -0800)]
ovs-brcompatd: Delete what Bridge references when deleting a Bridge.
A Bridge record can reference a number of other records: Port, Mirror,
NetFlow, sFlow, and Controller records. When the Bridge is deleted, we
should also delete those records that it references. This commit does
that.
Bug #2425.
Ben Pfaff [Mon, 8 Mar 2010 22:18:44 +0000 (14:18 -0800)]
ovsdb-idl: Make ovsdb_idl_txn_add_comment() take a printf() format string.
All of the callers were calling xasprintf() and then passing the result
to ovsdb_idl_txn_add_comment(), so this slightly simplifies the callers.
Ben Pfaff [Mon, 8 Mar 2010 21:33:13 +0000 (13:33 -0800)]
csum: Fix rare error cases in checksum computation.
Occasionally the checksum test on "make check" would fail. This commit
fixes the problem, which was that the partial checksum may need more than
one reduction step to obtain a final checksum. Now running checksum tests
in a continuous loop yields no failures.
Ben Pfaff [Mon, 8 Mar 2010 17:12:34 +0000 (09:12 -0800)]
xenserver: Add ovs-vswitchd.conf.db.5.gz to packaged files in RPM.
Ben Pfaff [Sat, 6 Mar 2010 01:05:43 +0000 (17:05 -0800)]
ovsdb: Remove "comment" support from OVSDB schemas.
Using a separate XML file to document a schema is much more flexible.
You end up with two files (a schema and documentation for it), each of
which is readable and maintainable, instead of a single schema file that
is almost illegible.
Ben Pfaff [Wed, 3 Mar 2010 22:47:46 +0000 (14:47 -0800)]
Add documentation for the vswitch database schema.
We can do better than this (I already have some comments) but this is
still much better than what we had.
Ben Pfaff [Sat, 6 Mar 2010 00:35:23 +0000 (16:35 -0800)]
ofproto: Fix stupid typo that broke the build.
Jesse Gross [Fri, 5 Mar 2010 23:32:40 +0000 (18:32 -0500)]
Add extern "C" to more header files.
From partner.
Ben Pfaff [Fri, 5 Mar 2010 00:57:08 +0000 (16:57 -0800)]
ofproto: Fix OpenFlow flow statistics result.
It made no sense to sum the rule and subrule counters and then throw them
away.
Seemingly caused by a bad merge in commit
3f355f4 'Merge "citrix" into
"master".'
Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Jesse Gross [Mon, 1 Mar 2010 16:59:07 +0000 (11:59 -0500)]
gre: Add support for path MTU discovery.
This allows path MTU discovery to properly work when used with
bridging. While there was previously support for PMTUD it used
the kernel's IP stack. This works fine for routing but when
bridging it is possible that a complete network is operating over
the bridge that the kernel has no knowledge of and the ICMP
fragmentation needed packets are lost.
When a packet arrives that is above the MTU of the tunnel, an
ICMP message is synthesized and send back on the device that the
original packet came from. This does not rely on the kernel IP
stack and is therefore independent of the routing table. Both
IPv4 and IPv6 are supported, including over VLANs. Other types
of packets that are over the MTU are encapsulated and the outer
packets are fragmented.
This entire functionality is a layer violation since bridging
operates at layer 2 and fragmentation is a function of layer 3.
For this reason it is possible to disable PMTUD, which will
provide complete transparency but will cause the outer IP packets
to be fragmented.
Jesse Gross [Fri, 19 Feb 2010 14:42:43 +0000 (09:42 -0500)]
gre: Correctly account for hardware header length.
On recent kernels there are two fields that we can use to keep track
of the overhead due to tunneling: hard_header_len and needed_headroom.
On older kernels everything got shoved into hard_header_len and the
actual header length got lost, which caused MTU calculations to be
incorrect. Since we know the device type we can figure out what the
header length should be.
Jesse Gross [Thu, 18 Feb 2010 16:43:29 +0000 (11:43 -0500)]
gre: Add functions to determine address type to compat layer.
Allows older kernels to classify IPv4/IPv6 addresses as loopback,
broadcast, etc. The IPv6 functions actually exist in all supported
kernels but add a dependency on the IPv6 code on older kernels (they
are always available on more recent kernels). This allows us to
process IPv6 packets without dragging in the entire IPv6 subsystem
if it is compiled as a module (such as on Xen). This is only done
for packets that are passing through the system and does not use
the IPv6 core if it is not configured.
Jesse Gross [Thu, 4 Mar 2010 22:02:57 +0000 (17:02 -0500)]
gre: Allow ToS on outer packet to be configured.
When creating a GRE tunnel, it is now possible to either set the
ToS of the outer packet to a fixed value or copy it from the inner
packet.
Jesse Gross [Thu, 4 Mar 2010 22:02:37 +0000 (17:02 -0500)]
gre: Allow IPv6 ToS bits to be propagated to tunnel packets.
The IPv6 ToS bits should have the same meaning as in IPv4, so
allow them to be copied from the inner packet to the tunnel packet
if enabled.
Jesse Gross [Thu, 18 Feb 2010 16:42:36 +0000 (11:42 -0500)]
gre: Always set TTL on outer packet to 64.
Currently the TTL is copied from the inner packet of the tunnel to
the outer packet if the inner packet is IP. This is good if your
GRE packets might make it into the input of your device but bad
if you want to be fully transparent.
This also resolves an inconsistency between tunnels set up using
the ioctl and using Netlink. The ioctl version would force PMTUD
on if a fixed TTL is set as a backup way to prevent loops but it
never made it over to the newer Netlink code so obviously no one
cares too much about it. This removes it to provide consistency
and transparency.
Basically, don't create loops and you will be happy.
Jesse Gross [Mon, 22 Feb 2010 22:04:41 +0000 (17:04 -0500)]
gre: Disable tx queue.
GRE is a software device that processes packets synchronously and
doesn't need a queue. Currently we are using the default for
Ethernet devices but that is unnecessary.
Jesse Gross [Tue, 23 Feb 2010 23:05:02 +0000 (18:05 -0500)]
gre: Check that the IP header is actually there before using it.
GRE is nominally operating at layer 2 but it has some special
features for IP packets. This checks that the IP header is present
before trying to read it. If it is not there, we just disable the
special features but still process the packet.
Jesse Gross [Fri, 19 Feb 2010 21:54:19 +0000 (16:54 -0500)]
datapath: Disable large receive offload.
LRO can play fast and loose with the packets that it merges, which
isn't very polite when you are bridging packets for other operating
systems. This disables LRO on any underlying devices that are added
to the datapath, which is the same as what the bridge does.
Note that this does not disable GRO, which has a more strict set of
rules about what is merged and is therefore safe for bridging. Both
are typically done in software anyways.
Jesse Gross [Thu, 4 Mar 2010 21:39:57 +0000 (16:39 -0500)]
datapath: Update hardware computed checksum on VLAN change.
The checksum computed by hardware on receive stored in skb->csum
when skb->ip_summed == CHECKSUM_COMPLETE is supposed to reflect
the contents of the packet starting at skb->data, which includes
the VLAN tag if there is one. However, when we manipulate the
VLAN tag we don't update the checksum. This leads to all kinds
of nasty warnings about broken hardware, not to mention we can't
take advantage of the checksum that was already computed.
This also fixes some issues with our private checksum type value
on some different kernels and after GSO.
Justin Pettit [Wed, 3 Mar 2010 20:48:15 +0000 (12:48 -0800)]
brcompat: Print warning when kernel times out waiting for userspace
Justin Pettit [Wed, 3 Mar 2010 20:49:12 +0000 (12:49 -0800)]
veth: Remove obvious debug printk's
Jesse Gross [Thu, 4 Mar 2010 06:14:29 +0000 (01:14 -0500)]
Update userspace datapath documentation.
Ben Pfaff [Thu, 4 Mar 2010 00:57:48 +0000 (16:57 -0800)]
++WARNING++: Delete this file.
This branch is now stable enough to eliminate this scary warning.
Ben Pfaff [Thu, 4 Mar 2010 00:56:47 +0000 (16:56 -0800)]
xenserver: Include the vswitch database contents in bugtool reports.
/etc/ovs-vswitchd.conf no longer exists, but /etc/ovs-vswitchd.conf.db
does.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 4 Mar 2010 00:54:00 +0000 (16:54 -0800)]
Update Open vSwitch documentation.
Ben Pfaff [Thu, 4 Mar 2010 18:05:18 +0000 (10:05 -0800)]
ofproto: Don't shadow global variable name.
There was already a file scope variable named 'rl', so don't use it as
a local variable name too.
Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Justin Pettit [Wed, 3 Mar 2010 14:02:46 +0000 (06:02 -0800)]
ovs-brcompatd: Add comments to config db transactions
The ovsdb-tool show-log command is very useful for debugging, since it
shows changes to the database over time. The bridge compatibility code
was not commenting on the changes it was making, so it was difficult to
determine what a system was doing when bridge ioctls were involved.
This commit adds that annotation.
Justin Pettit [Wed, 3 Mar 2010 14:05:37 +0000 (06:05 -0800)]
ovs-brcompatd: Add rate-limit argument to rate-limited log call
Ben Pfaff [Wed, 3 Mar 2010 22:27:53 +0000 (14:27 -0800)]
brcompatd: Make bridge ioctls synchronous again.
Before OVSDB was adopted in the vswitch, bridge ioctls were synchronous.
That is, an operation that, say, creates a new bridge was guaranteed to
have completed before brcompatd returned a success result to the kernel.
When OVSDB was adopted, however, we failed to maintain this property.
Instead, bridge creation (etc.) only happened some time after the return
value was passed back to the kernel. This causes a race condition against
software that creates or deletes bridges or ports and expects that the
operation is completed synchronously.
This commit restores the synchronous behavior.
Bug #2443.