Ben Pfaff [Thu, 24 Jun 2010 18:01:53 +0000 (11:01 -0700)]
ovs-vsctl: Allow commands to tell ovs-vsctl to try again later.
The "wait-until" command to be introduced in an upcoming commit needs to
be able to tell the ovs-vsctl main loop to try again later, since the
condition that it is looking for has not yet been satisfied. This commit
adds the infrastructure for this. (It's being broken out into a separate
commit because it modifies scattered code in ovs-vsctl.c and thus might
be easier to review this way.)
Justin Pettit [Mon, 28 Jun 2010 20:43:10 +0000 (13:43 -0700)]
debian: Correct naming in init scripts
A number of the init scripts assumed that the package name was the same
as the binary, which is not always true. This fixes those issues as
well as some incorrect names in usage messages.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Ben Pfaff [Thu, 24 Jun 2010 22:02:46 +0000 (15:02 -0700)]
ovs-ofctl: Warn about flows not in normal form.
Lots of people get this wrong.
Bug #185.
Ben Pfaff [Thu, 24 Jun 2010 21:20:45 +0000 (14:20 -0700)]
ofproto: Log changes made by flow normalization.
Open vSwitch has always "normalized" flows, that is, zeroed out fields that
are wildcarded or that otherwise cannot affect whether a packet actually
matches the flow. But until now it has done so silently, which prevents
the authors of controllers from learning what is happening and makes it
less likely that they will update code on their end. This commit makes
OVS log when normalization changes a flow.
Suggested by partner.
Ben Pfaff [Fri, 25 Jun 2010 20:57:22 +0000 (13:57 -0700)]
xenserver: Avoid errors from ovs-vsctl at system shutdown.
Commit
823c5699 "interface-reconfigure: callout to datapath backend class
method on rewrite" changed "interface-reconfigure rewrite" to update
bridge external-ids in the vswitch database. But this had the side effect
of causing errors at system shutdown, since ovsdb-server gets shut down
before the rewrite action is called. This commit fixes the problem by
skipping the update if the database socket does not exist. (It's just
fine to skip the update, since the external-ids will be re-set the next
time the system boots anyhow.)
This commit fixed the problem on 5.6.810-34773p for me. I don't see the
problem at all on 5.5.0. Presumably system shutdown order has changed.
NIC-136.
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Mon, 28 Jun 2010 17:34:10 +0000 (10:34 -0700)]
xenserver: Kill bond master's dhclient when bringing up bond slave.
interface-reconfigure is never explicitly called to down a bond master.
However, when it is called to up a slave it is implicit that we are
destroying the master. The "bridge" version of interface-reconfigure
always "ifdown"s the bond master in such a case, but until now the
"vswitch" version has not done so. Usually, it doesn't matter, because
the bond master network device disappears when the slave is brought up,
but one case was missed: for a bond master with an IP address obtained
via DHCP, the dhclient process needs to be killed, and we were not doing
it. This commit starts doing it (by invoking ifdown on the bond master).
The dhclient process that hangs around doesn't cause problems until the
bond master is brought back up, at which point "ifup" fails because it
refuses to start another dhclient for the same interface.
The converse behavior is also important; that is, when a bond PIF is
brought up, interface-reconfigure is expected to implicitly take down its
slave PIFs. My testing (on 5.5.0) shows that this behavior is already
correct. At any rate, this commit does not change that behavior.
Bug #2668.
Bug #2734.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Ben Pfaff [Thu, 24 Jun 2010 18:35:27 +0000 (11:35 -0700)]
timeval: Hide "memory leak" from Valgrind.
In glibc, "timer_t" is a "void *" that appears to point into malloc()'d
memory. By throwing it away entirely, we leak it, which makes valgrind
complain. We really don't ever care to use the timer object again, but
we can't destroy it without stopping the periodic timer. So make it
static to avoid a warning from Valgrind.
Ben Pfaff [Fri, 25 Jun 2010 16:39:33 +0000 (09:39 -0700)]
Add AUTHORS file.
Suggested-by: Martin Casado <casado@nicira.com>
Yu Zhiguo [Fri, 25 Jun 2010 09:33:07 +0000 (17:33 +0800)]
datapath: fix header file include
linux/highmem.h should be included rather than asm/highmem.h,
otherwise openvswitch_mod cannot resolve kmap and kunmap on some arch.
Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com>
Ben Pfaff [Thu, 24 Jun 2010 23:06:07 +0000 (16:06 -0700)]
ovs-vsctl: Make "ovs-vsctl get <table> <record> _uuid" work.
Requested-by: Sean Brady <sbrady@gtfservices.com>
Jesse Gross [Thu, 24 Jun 2010 22:45:04 +0000 (15:45 -0700)]
docs: Correct DB init instructions in INSTALL.Linux.
We tell people to run "ovs-vsctl init" before starting
ovs-vswitchd but this causes it to hang until it times
out so add "--no-wait" as well.
Jesse Gross [Thu, 24 Jun 2010 22:31:18 +0000 (15:31 -0700)]
ovsdb-idl: Check if row->written is valid.
Commit cde3f1 "ovsdb-idl: Drop unnecessary allocation from
ovsdb_idl_txn_insert()." does lazy allocation of row->written
on the assumption that ovsdb_idl_txn_write() will handle it.
However, this isn't the case for empty rows created by something
like "ovs-vsctl init" so add a check before reading the bitfield.
Ben Pfaff [Wed, 23 Jun 2010 16:41:09 +0000 (09:41 -0700)]
vswitchd: Add entity-relationship diagram to ovs-vswitchd.conf.db.5.
I've updated http://openvswitch.org/ovs-vswitchd.conf.db.5.pdf with
example output.
Ben Pfaff [Wed, 23 Jun 2010 19:29:45 +0000 (12:29 -0700)]
tests: Tolerate ignored SIGPIPE in daemon tests.
I noticed that when I run "make check" inside an Emacs compile-mode buffer,
the "daemon --detach closes standard fds" and "daemon --detach --monitor closes
standard fds" tests failed. Investigation showed that Emacs ignores
SIGPIPE in the compile subprocess, which caused the "yes" process in these
tests to emit the message "yes: Broken pipe" and exit with status 1 instead
of dying from SIGPIPE.
This commit changes these tests to allow either behavior.
Ben Pfaff [Wed, 23 Jun 2010 16:59:49 +0000 (09:59 -0700)]
ovs-vsctl: Add details to documentation for "emer-reset" command.
Someone asked me what emer-reset really does and I had to look in the
source code to find out. It's kinder just to document it.
Ben Pfaff [Thu, 24 Jun 2010 19:56:30 +0000 (12:56 -0700)]
ovsdb-server: Implement unixctl command to reconnect JSON-RPC connections.
This feature may be useful for debugging.
Feature #2222.
Ben Pfaff [Fri, 18 Jun 2010 20:58:42 +0000 (13:58 -0700)]
vswitch: Implement unixctl command to reconnect OpenFlow connections.
This feature may be useful for debugging.
Feature #2222.
Ben Pfaff [Thu, 24 Jun 2010 19:44:47 +0000 (12:44 -0700)]
rconn: Suppress failed connection messages after the backoff maxes out.
Logging a few messages about a failed connection every few seconds for
every bridge is too much. This just logs failed connection messages for a
few attempts, then shuts them off until something changes.
Bug #2610.
Ben Pfaff [Fri, 11 Jun 2010 22:58:14 +0000 (15:58 -0700)]
vconn: Fix tracking of "connected" state.
While I was looking at the rconn code for connection backoff and retry, I
noticed that ovs-vswitchd was logging the following on each connection
attempt:
Jun 11 15:17:41|00020|vconn_stream|ERR|send: Connection refused
The "send:" part didn't make much sense. The configured controller was not
actually running, so the vconn code should not have been able to connect
at all, so the message should have been about a connection failing, not
about sending on a completed connection failing.
Investigation showed that different parts of the library have different
ideas about return value semantics. vconn_open() and stream_open() both
return 0 if a connection succeeded or if one is in progress, but some of
its callers thought that it returned 0 if the connection succeeded and
EAGAIN if the connection was in progress. This commit fixes up the callers
that had the wrong idea, by making them instead all vconn_connect() or
stream_connect() to determine whether the connection is complete.
Ben Pfaff [Fri, 11 Jun 2010 21:59:43 +0000 (14:59 -0700)]
rconn: Remove superfluous \n from log message.
The vlog library suppresses a trailing \n but that's no reason to supply
one.
Ben Pfaff [Wed, 23 Jun 2010 18:02:46 +0000 (11:02 -0700)]
bridge: Implement basic periodic update of interface statistics.
Ben Pfaff [Thu, 10 Jun 2010 21:32:32 +0000 (14:32 -0700)]
bridge: Make configuration database records valid all the time.
Before, it was possible for records in the configuration database to
disappear, so all of the ovsrec pointers inside bridge structures had
comments cautioning against their use except during reconfiguration. But
now that the bridge has direct control over when ovsdb_idl_run() is called,
it can ensure that bridge_reconfigure() is always called immediately
whenever the IDL data structures change. That means that we can use the
ovsrec configuration at any time after the reconfiguration process
initializes them, not just during reconfiguration.
Ben Pfaff [Thu, 10 Jun 2010 21:17:41 +0000 (14:17 -0700)]
ovs-vswitchd: Allow bridge code to manage the database connection itself.
Until now, the ovs-vswitchd main loop has managed the connection to the
database. This worked adequately until now, but upcoming patches will tie
the bridge code more tightly to the database, which means that the bridge
needs more control over interaction with the database connection and thus
that it is better for the bridge to handle that connection itself. This
commit makes the latter change, moving the database interaction from the
ovs-vswitchd main loop into bridge.c.
Ben Pfaff [Thu, 10 Jun 2010 22:31:55 +0000 (15:31 -0700)]
ovsdb-idlc: Fix sizeof calculation in generated code.
Generated <prefix>_<struct>_parse_<column> functions did not allocate
enough memory for the "value" array, because code that should have said,
e.g.:
row->value_options = xmalloc(datum->n * sizeof *row->value_options);
actually said:
row->value_options = xmalloc(datum->n * sizeof row->value_options);
This fixes the problem. I also checked that the same problem didn't occur
elsewhere in the generated code.
(This would be a fairly serious bug fix, because without it reads and
writes beyond the end of allocated memory would be almost inevitable,
except that every existing map has string values, and sizeof(char*)
== sizeof(char**) on any sane system.)
Ben Pfaff [Thu, 10 Jun 2010 21:09:51 +0000 (14:09 -0700)]
ovsdb-idl: Drop unnecessary allocation from ovsdb_idl_txn_insert().
There's no need to allocate row->written ahead of time because the code
that can use it allocates it on demand if row->written is NULL.
Ben Pfaff [Wed, 23 Jun 2010 17:13:39 +0000 (10:13 -0700)]
ovsdb-idl: Start documenting the public interface.
Long overdue.
Ben Pfaff [Wed, 9 Jun 2010 22:18:17 +0000 (15:18 -0700)]
ovsdb-idl: Simplify usage of ovsdb_idl_run().
It makes client code simpler if ovsdb_idl_run() simply lets the caller
know whether anything changed.
Ben Pfaff [Thu, 10 Jun 2010 21:10:51 +0000 (14:10 -0700)]
bridge: Drop unused enum definition.
Ben Pfaff [Thu, 10 Jun 2010 23:31:59 +0000 (16:31 -0700)]
bridge: Remove unused functions.
Ben Pfaff [Thu, 10 Jun 2010 21:40:13 +0000 (14:40 -0700)]
Use shash_destroy_free_data() to simplify a few scattered pieces of code.
Ian Campbell [Wed, 23 Jun 2010 08:22:03 +0000 (09:22 +0100)]
xenserver: Largely untested patch for 5.5 and 5.6 CHIN compatibility
Ian Campbell [Wed, 23 Jun 2010 08:18:57 +0000 (09:18 +0100)]
interface-reconfigure: Handle CHIN Tunnel objects
Only the vswitch backend is able to implement CHIN.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Ben Pfaff [Fri, 4 Jun 2010 23:47:55 +0000 (16:47 -0700)]
stream-ssl: Log protocol details at DBG level.
Sometimes seeing a little bit of SSL protocol information can be valuable
in debugging connection problems. With this commit, setting the stream_ssl
logging module to DBG level will cause basic SSL handshake information to
be logged for new connections.
Ben Pfaff [Fri, 18 Jun 2010 22:58:13 +0000 (15:58 -0700)]
Better document how ovsdb-server is meant to be used.
DarkBls <darkbls@yahoo.com> had the idea that a single ovsdb-server could
be used to serve configuration details across the network to multiple
remote ovs-vswitchd instances. This doesn't work, but the documentation
didn't spell it out. This commit should help.
Ben Pfaff [Wed, 23 Jun 2010 16:50:47 +0000 (09:50 -0700)]
tests: Fix occasional failure of "self-linking idl, inconsistent ops" test.
Commit
97f7803 made this test nondeterministic: depending on the ordering
of the random row UUIDs, the error message might mention one of two
different nonexistent rows that are referenced. This commit fixes the
problem by accepting either one of the two correct rows.
Previous related fixes took a different approach, of instead making the
test deterministic. But now I think that that is not as good an idea,
because we need to be able to test that OVSDB works whether the query is
deterministic or not.
(Of course, every OVSDB test is nondeterministic, since the UUIDs are
random. This test was just more nondeterministic than most.)
Jun Nakajima [Wed, 23 Jun 2010 05:53:15 +0000 (22:53 -0700)]
Update INSTALL.XenServer to indicate that 5.6.0 is supported
Open vSwitch is compatible with XenServer 5.6.0, so indicate that in
INSTALL.XenServer. Remove the reference to 5.5.900, since that was just
a pre-release version of 5.6.0.
Ben Pfaff [Tue, 22 Jun 2010 20:50:55 +0000 (13:50 -0700)]
INSTALL.Linux: Add some troubleshooting instructions for module loading.
Suggested-by: kk yap <yapkke@stanford.edu>
Ben Pfaff [Tue, 22 Jun 2010 19:47:03 +0000 (12:47 -0700)]
ofp-util: Also normalize nw_tos in normalize_match().
The OpenFlow reference implementation was sensibly normalizing these
fields but OVS did not. This change should make OVS resemble the OpenFlow
reference implementation at least in this respect.
For more information:
https://mailman.stanford.edu/pipermail/openflow-spec/2010-June/001040.html
Reported-by: Takayuki HAMA <t-hama@cb.jp.nec.com>
Ben Pfaff [Fri, 11 Jun 2010 21:45:24 +0000 (14:45 -0700)]
Suppress ovsdb-server log messages about connections from ovs-vsctl.
In the ovsdb-server log there are fairly continuous messages like these:
Apr 26 11:27:55|15254|reconnect|INFO|unix:/tmp/stream-unix.31734.0: connected
Apr 26 11:27:55|15255|reconnect|INFO|unix:/tmp/stream-unix.31734.0: connection dropped
Apr 26 11:28:00|15256|reconnect|INFO|unix:/tmp/stream-unix.31810.0: connecting...
Apr 26 11:28:00|15257|reconnect|INFO|unix:/tmp/stream-unix.31810.0: connected
Apr 26 11:28:00|15258|reconnect|INFO|unix:/tmp/stream-unix.31810.0: connection dropped
These just indicate that ovs-vsctl is connecting to ovsdb-server from,
for example, the "vif" script. But there's no need to log all that detail;
it's simply not useful. This commit suppresses it.
Bug #2715.
Ben Pfaff [Fri, 11 Jun 2010 21:37:33 +0000 (14:37 -0700)]
jsonrpc: Suppress duplicate logging.
Both jsonrpc and reconnect were logging ordinary connection closure.
There's no need for both to do it.
Ben Pfaff [Fri, 11 Jun 2010 21:39:13 +0000 (14:39 -0700)]
jsonrpc: Propagate error code to reconnect_disconnected().
Always passing 0 to reconnect_disconnected() means that it uses a generic
log message ("connection dropped"). By passing the error code, as done by
this commit, reconnect_disconnected() can log a more specific message.
Ben Pfaff [Fri, 11 Jun 2010 20:56:36 +0000 (13:56 -0700)]
ovsdb-server: Improve logging for referential integrity violations.
This may help with bug #2727 "ovs-vsctl transaction error while changing
VM power state", if it is reproducible.
Jesse Gross [Sat, 19 Jun 2010 00:11:44 +0000 (17:11 -0700)]
datapath: Don't compute checksums on partial packets.
If we are only copying part of a packet to userspace don't bother
computing the checksum on that part since it is meaningless.
Instead, fall back to the old method of checksumming before
copying to ensure the correct result.
This was supposed to be part of the previous commit but was left
off.
Jesse Gross [Thu, 17 Jun 2010 22:20:16 +0000 (15:20 -0700)]
datapath: Compute checksum while sending packets to userspace().
Currently we compute the checksums on packets being sent to
userspace first and then copy them to a userspace buffer. However,
these two operations can be combined for a significant savings
because the packet data only has to be loaded once. This also
allows GSO packets to save an extra copy.
This will likely have an impact on NIC-121 because it eliminates
the code path that triggers the issue. However, it is not a fix
for the root cause.
Jesse Gross [Thu, 17 Jun 2010 22:17:53 +0000 (15:17 -0700)]
datapath: Check vswitch_skb_checksum_setup() return code.
If vswitch_skb_checksum_setup() returns an error, the checksum
pointers probably haven't been set correctly which could cause
a crash later. We should give up immediately on error.
Jesse Gross [Thu, 17 Jun 2010 22:15:11 +0000 (15:15 -0700)]
datapath: Call vswitch_skb_checksum_setup() before doing GSO.
Since GSO computes checksums as it does segmentation, we need to
setup the checksum pointers before calling skb_gso_segment(). Failing
to do so can potentially result in warnings, incorrect checksums,
crashes, or redundant checksum computation. In general we don't
hit this case because the code path is run during the first packet
in a flow, which is generally not a large GSO packet.
This was found during the investigation of NIC-121 but has no impact
on it because vswitch_skb_checksum_setup() is a no-op on 2.6.27-based
XenServer kernels.
Jesse Gross [Fri, 18 Jun 2010 17:24:28 +0000 (10:24 -0700)]
ofproto: Consistently make queue_id uint32_t.
In some places queue_id was a uint16_t which caused issues when
comparing to 32-bit constants and doing byte swaps.
Ben Pfaff [Thu, 17 Jun 2010 22:24:54 +0000 (15:24 -0700)]
ovsdb-idlc: Fix warning in generated code.
Without this fix, ovsdb-idlc generates the following line of code:
c->type.key.u.integer.max =
4294967295;
which causes GCC to issue this warning:
this decimal constant is unsigned only in ISO C90
This commit changes the generated code to:
c->type.key.u.integer.max = INT64_C(
4294967295);
which eliminates the warning.
Ben Pfaff [Tue, 15 Jun 2010 19:14:43 +0000 (12:14 -0700)]
vswitchd: Attempt to further clarify Port "trunk" and "tag" documentation.
CC: Hao Zheng <hzheng@nicira.com>
Ben Pfaff [Thu, 17 Jun 2010 22:04:12 +0000 (15:04 -0700)]
Implement QoS framework.
ovs-vswitchd doesn't declare its QoS capabilities in the database yet,
so the controller has to know what they are. We can add that later.
The linux-htb QoS class has been tested to the extent that I can see that
it sets up the queues I expect when I run "tc qdisc show" and "tc class
show". I haven't tested that the effects on flows are what we expect them
to be. I am sure that there will be problems in that area that we will
have to fix.
Ben Pfaff [Mon, 7 Jun 2010 23:58:57 +0000 (16:58 -0700)]
shash: New functions shash_destroy_free_data() and shash_clear_free_data().
Ben Pfaff [Thu, 3 Jun 2010 17:17:51 +0000 (10:17 -0700)]
port-array: Add port_array_delete() function.
port_array_delete(pa, idx) is equivalent to port_array_set(pa, idx, NULL),
but it never allocates memory and avoids conditionals.
Ben Pfaff [Fri, 28 May 2010 23:34:55 +0000 (16:34 -0700)]
netdev-linux: Create rtnetlink socket up front instead of on demand.
This simplifies a bit of existing code since it is known that an rtnetlink
socket will always be available. It will simplify additional code in
upcoming commits.
Ben Pfaff [Fri, 28 May 2010 23:16:23 +0000 (16:16 -0700)]
netlink: Improve support for nested Netlink attributes.
Fairly often it happens that nested Netlink attributes must themselves
contain Netlink attributes. In such a case, nlmsg_put_nested() is not so
convenient, because it requires the contents to be pre-assembled and then
copied into place. This commit introduces a new interface that instead
allows the nested attributes to be assembled in-place. As a demonstration,
it updates nl_msg_put_nested() to use this new interface.
Ben Pfaff [Fri, 21 May 2010 00:14:22 +0000 (17:14 -0700)]
netlink: Add support for Netlink table dumping.
Ben Pfaff [Thu, 20 May 2010 22:57:56 +0000 (15:57 -0700)]
netlink: Add functions for handling nested attributes.
Ben Pfaff [Thu, 20 May 2010 22:57:36 +0000 (15:57 -0700)]
netlink: Make nl_sock_transact() always return a reply on success.
Until now, if nl_sock_transact() received a reply that merely acknowledged
success, without providing any other payload, it would return success but
not provide the reply to its caller. This is inconsistent and could easily
cause a segfault in a caller that expects to see the reply on success, if
kernel behavior changed, for whatever reason, so that a request that
previously returned data now just returns an acknowledgment. In practice
this kind of change should never happen, but it is still better to handle
it properly.
Ben Pfaff [Thu, 20 May 2010 22:53:17 +0000 (15:53 -0700)]
netlink: Fix bad assumption about nested Netlink attributes.
I had assumed that nested Netlink attributes contained an entire Netlink
message, including header. This is wrong: they contain only a series of
attributes.
Nothing in the tree actually used nested attributes until now, so this
doesn't fix any existing bugs.
Ben Pfaff [Wed, 19 May 2010 21:13:23 +0000 (14:13 -0700)]
netlink: Make nl_sock_transact() discard reply if 'replyp' is null.
Sometimes only the success or failure return value is interesting, not the
details of the reply, so this simplifies some callers.
Ben Pfaff [Thu, 3 Jun 2010 17:22:31 +0000 (10:22 -0700)]
netlink: Drop sock parameter from nl_msg_put_(ge)nlmsghdr().
These two functions use their "sock" parameter only to figure out the
nlmsg_pid to put in the nlmsghdr. But that field can be filled in just
as well right before sending the message. Since our functions for sending
Netlink messages always modify the nlmsghdr anyhow (to fill in the length),
there is little benefit to filling in the nlmsg_pid in advance. The cost,
on the other hand, is having to pass another argument to functions that
already have too many. So this commit removes the argument.
Ben Pfaff [Thu, 27 May 2010 20:14:05 +0000 (13:14 -0700)]
vconn: Move OpenFlow utility functions into new file ofp-util.c.
The main purpose of the vconn code is to ship OpenFlow messages across
network connections. Over time a large number of utility functions related
to OpenFlow messages have also crept into vconn.c, but that's really
logically separate. This commit breaks those functions out into a new
file.
Ben Pfaff [Wed, 2 Jun 2010 18:08:03 +0000 (11:08 -0700)]
ovs-vsctl: Support references among records at creation time.
This makes it easy to create a bunch of records that are all related to
each other in a single ovs-vsctl invocation. It adds an example to the
ovs-vsctl manpage.
Ben Pfaff [Tue, 18 May 2010 19:46:56 +0000 (12:46 -0700)]
ovs-vsctl: Add support for command options that accept arguments.
Ben Pfaff [Tue, 18 May 2010 19:46:23 +0000 (12:46 -0700)]
ovs-vsctl: Update manpage. Use same order as ovs-vswitchd.conf.db.5.
Ben Pfaff [Tue, 18 May 2010 21:16:43 +0000 (14:16 -0700)]
ovs-vsctl: Fix assert-fail when an error occurs and "create" command used.
When the "create" command is used, post_create() calls
ovsdb_idl_txn_get_insert_uuid(), which asserts that the transaction
completed successfully. This makes it clear that postprocess functions
should only run when the transaction completes successfully. (Currently
post_create() is the only postprocess function.)
Ben Pfaff [Thu, 20 May 2010 22:43:13 +0000 (15:43 -0700)]
ofproto: Fix byte order for OFP_VLAN_NONE to dl_vlan in struct flow.
This is not a bug, since OFP_VLAN_NONE is all-1-bits, but it is still
best to get it correct.
Ben Pfaff [Wed, 16 Jun 2010 21:41:22 +0000 (14:41 -0700)]
vswitch: Improve documentation for datapath_id column.
It was insufficiently documented that the vswitch, not the user, sets the
datapath_id column, which confused people (including me). This commit
fixes the problem.
Ben Pfaff [Wed, 16 Jun 2010 23:01:41 +0000 (16:01 -0700)]
vswitch: Datapath IDs are now 16 hex digits.
OpenFlow 1.0 datapath IDs are 64 bits long, so the "datapath_id" column
should have 16 hex digits. The documentation had this right, but the
code didn't implement it correctly.
Reported-by: Arthur van Kleef <arthur.vankleef@os3.nl>
Ben Pfaff [Tue, 15 Jun 2010 23:09:34 +0000 (16:09 -0700)]
ovs-vsctl: Fix spelling error in log message.
Ben Pfaff [Tue, 15 Jun 2010 17:39:00 +0000 (10:39 -0700)]
ovsdbmonitor: Clean some more files.
Fixes "make distcheck" error.
Ben Pfaff [Tue, 15 Jun 2010 17:38:44 +0000 (10:38 -0700)]
ovsdbmonitor: Put temporary file in ovsdb/ovsdbmonitor directory.
The temporary file ovsdbmonitor.tmp was being put into the root of the
build directory, which seems unnecessary.
Also, delete the temporary file when we no longer need it.
Ben Pfaff [Tue, 15 Jun 2010 17:37:27 +0000 (10:37 -0700)]
update-debian-changelog: Pass "-f" to "mv" to fix "make distcheck".
"make distcheck" unsets the "writable" bit of files as it installs them
on "make dist", so to avoid an error (or a user query) updating
debian/changelog in such a situation we must use the -f option.
Ben Pfaff [Thu, 17 Jun 2010 17:24:39 +0000 (10:24 -0700)]
WHY-OVS: New file explaining the rationale for Open vSwitch.
Signed-off-by: Martin Casado <casado@nicira.com>
Signed-off-by: Paul Fazzone <pfazzone@nicira.com>
Signed-off-by: Dan Wendlandt <dan@nicira.com>
Ben Pfaff [Wed, 9 Jun 2010 20:56:06 +0000 (13:56 -0700)]
xenserver: Delete network.conf on package removal on XenServer 5.5.0.
The previous commit "xenserver: Create network.conf before running
interface-reconfigure" fixed a problem that was not noticed earlier only
because we had not tested very often on pristine XenServer 5.5.0 systems,
instead mostly on systems that had had Open vSwitch installed before and
thus already had a network.conf file. This commit should help to avoiding
future regressions in this area, by removing network.conf when the
openvswitch package is removed on XenServer 5.5.0.
Ben Pfaff [Wed, 9 Jun 2010 20:56:56 +0000 (13:56 -0700)]
xenserver: Create network.conf before running interface-reconfigure.
XenServer 5.5.0 doesn't have /etc/xensource/network.conf, but the
interface-reconfigure that OVS installs issues an error and aborts if it
does not exist, so create network.conf before trying to run it.
CC: Paul Ingram <paul@nicira.com>
Ben Pfaff [Wed, 9 Jun 2010 20:17:51 +0000 (13:17 -0700)]
brcompatd: Remove commented-out code.
This code was never converted from the configuration database to OVSDB.
In the subsequent months the lack of it has not caused any problems, so
this commit deletes it.
Ben Pfaff [Wed, 9 Jun 2010 20:16:09 +0000 (13:16 -0700)]
bridge: Remove commented-out code for custom management and snoop listeners.
Before the transition from configuration file to OVSDB, it was possible to
override the defaults for OpenFlow management listeners and for OpenFlow
controller connection snooping. The former can now effectively be done by
configuring a controller through the database. Overriding the latter is
not very useful (no one has complained that it cannot be done any longer).
So this commit deletes the commented-out code.
Ben Pfaff [Wed, 9 Jun 2010 19:52:05 +0000 (12:52 -0700)]
bridge: Remove commented-out code to set OpenFlow description strings.
This code has been commented out since the end of January, so it cannot
be very important.
Ben Pfaff [Wed, 9 Jun 2010 19:47:45 +0000 (12:47 -0700)]
bridge: Remove unused and write-only members of 'struct bridge'.
Ben Pfaff [Tue, 15 Jun 2010 17:25:21 +0000 (10:25 -0700)]
vlog: Check that all declared vlog modules are used, at "make" time.
Ben Pfaff [Wed, 9 Jun 2010 00:04:54 +0000 (17:04 -0700)]
vlog: Remove modules that don't have any users.
I am surprised that there are so many of these.
Ben Pfaff [Wed, 9 Jun 2010 18:23:47 +0000 (11:23 -0700)]
ovsdb-tool: Don't wait for lockfiles on "compact" or "convert".
Until now, "ovsdb-tool convert" and "ovsdb-tool compact" were willing to
wait an arbitrarily long time to get a lock on the database or on a
temporary file. In practice, though, the program most likely to have the
lock is ovsdb-server, which is not a transient process, and thus
ovsdb-tool will likely wait indefinitely if it waits at all.
This commit changes these ovsdb-tool commands so that they won't wait at
all if some other program has the lock. (The other commands already had
this behavior.)
As a side effect, this change fixes the behavior of
"/etc/init.d/openvswitch start" when Open vSwitch was already running.
Previously, it would hang waiting for "ovsdb-tool convert" to finish.
Now, it completes quickly with an error.
CC: Reid Price <reid@nicira.com>
Bug #2864.
Jesse Gross [Fri, 11 Jun 2010 22:10:35 +0000 (15:10 -0700)]
gre: Improve headroom calculation to reducing copying.
The first change is use skb_header_cloned() instead of (skb_cloned()
&& skb_clone_writable()). While these are effectively the same
checks, skb_clone_writable() does not exist until 2.6.23 and relies
on information not available in earlier kernels and therefore the
compat version always returns false. Since GRE only adds data to
the front of the packet and this is on the transmit path (meaning
there is no important data in the SKB head) it is safe to use
skb_header_cloned(). This avoids a copy for locally generated
TCP packets on the affected kernels.
The second change is to always allocate 64 bytes of headroom when
a copy needs to be made. There is no cost to allocating extra
space once we have decided to make a copy and can avoid another
copy later if we need to add a VLAN tag.
Ben Pfaff [Fri, 11 Jun 2010 17:52:02 +0000 (10:52 -0700)]
INSTALL.Linux: Note the need for CONFIG_TUN and /dev/net/tun.
Ben Pfaff [Fri, 11 Jun 2010 17:35:52 +0000 (10:35 -0700)]
Mention that /dev/urandom is needed.
Jesse Gross [Thu, 10 Jun 2010 23:35:34 +0000 (16:35 -0700)]
tests: Allow some difference in rounding in timeval test.
We now use a time source that provides nanosecond granularity.
However, our test uses gettimeofday() for comparision, which has
microsecond granularity. In some cases this can lead to different
values depending on the rounding. This allows us to be off by one
to prevent intermittent test failures.
Jesse Gross [Wed, 9 Jun 2010 19:54:34 +0000 (12:54 -0700)]
netdev-vport: Use vport set_stats instead of internal dev.
In certain cases we require the ability to provide stats that are
added to the values collected by the kernel (currently only used
by bond fake devices). Internal devices previously implemented
this directly but now that their stats are now handled by the vport
layer the functionality has been moved there. This removes the
userspace code to set the stats and replaces it with a mechanism
to access the equivalent functionality in the vport layer.
Jesse Gross [Tue, 8 Jun 2010 02:20:28 +0000 (19:20 -0700)]
netdev-linux: Add capability to get stats from vport layer.
The vport layer has the ability to track stats using 64-bit counters,
even if the kernel is only 32-bit. This first attempts to collect
stats from these counters if they are available and otherwise falls
back to the normal Linux interfaces.
Jesse Gross [Thu, 20 May 2010 01:28:31 +0000 (18:28 -0700)]
vport-internal: Convert internal devices to vport stats.
Internal devices currently keep track of stats themselves. However,
we now have stats tracking in the vport layer, so convert to use
that instead to avoid code duplication and take advantage of
additional features such as 64-bit counters.
Jesse Gross [Wed, 19 May 2010 22:22:28 +0000 (15:22 -0700)]
vport-netdev: Use vport stats layer on 32-bit machines.
Linux devices store stats in counters the size of a machine word,
which are rapidly overflowed on a 32-bit machine. In this
situation we now use the vport stats layer, which always uses 64-
bit stats. On 64-bit machines we continue to use the normal
Linux stats to avoid the extra overhead of counting twice.
Jesse Gross [Thu, 20 May 2010 00:18:08 +0000 (17:18 -0700)]
vport: Allow offsets to be set for stats.
Adds a method to set a group of stats to be added to the values
gathered normally. This is needed for the fake bond device to
show the stats of its underlying slaves. Also enables devices
that use the generic stats layer to define a get_stats() function
to provide additional error counts.
Jesse Gross [Thu, 10 Jun 2010 20:48:08 +0000 (13:48 -0700)]
vport: Move 'extern' declarations of vports to header.
Since vport implementations have no header files they needed to be
declared as extern before being used. They are currently declared
in vport.c but this isn't safe because the compiler will silently
accept it if the type is incorrect. This moves those declarations
into vport.h, which is included by all implementations and will
cause errors about conflicting types if there is a mismatch.
Jesse Gross [Sat, 29 May 2010 01:09:27 +0000 (18:09 -0700)]
vport: Rename userspace functions.
The vport library can be accessed from both userspace and the
kernel using different sets of functions. These functions were
named similarly, so add _user to the userspace variants to
distinguish them.
Ben Pfaff [Tue, 8 Jun 2010 23:33:39 +0000 (16:33 -0700)]
xenserver: Remove some ovs-xenserverd support that I missed.
Oops. Must have been too giddy to look carefully the first time.
This time I'll test it before I push.
Ben Pfaff [Wed, 26 May 2010 23:15:48 +0000 (16:15 -0700)]
Fix EXTRA_DIST dependence on Automake conditionals.
Automake respects conditionals around EXTRA_DIST assignments. That is, if
COND is not true, then the following will not distribute 'myfile':
if COND
EXTRA_DIST += myfile
endif
See http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
for more information.
This behavior is surprising, at least to me. But we can work around it:
anything that can ever *potentially* be assigned to noinst_HEADERS is
always distributed. So this commit eliminates the problem by adding
$(EXTRA_DIST) to noinst_HEADERS.
Jesse Gross [Wed, 9 Jun 2010 00:18:48 +0000 (17:18 -0700)]
timeval: Use monotonic time where appropriate.
Most of the timekeeping needs of OVS are simply to measure intervals,
which means that it is sensitive to changes in the clock. This commit
replaces the existing clocks with monotonic timers. An additional set
of wall clock timers are added and used in locations that need absolute
time.
Bug #1858
Justin Pettit [Tue, 8 Jun 2010 19:53:46 +0000 (12:53 -0700)]
xenserver: Don't complain for "bridge" network.conf value
Just silently don't start OVS daemons if /etc/xensource/network.conf
contains a value of "bridge". This allows the init script to be called
regardless of whether OVS or bridge is configured.
Justin Pettit [Tue, 8 Jun 2010 06:17:26 +0000 (23:17 -0700)]
xenserver: Don't start OVS if network.conf isn't "openvswitch"
The OVS processes would start as long as "/etc/xensource/network.conf"
didn't contain "bridge". The other OVS scripts, however, would complain
(and not run) if it wasn't "vswitch" or "openvswitch". This commit will
only start the OVS processes if a value of "vswitch" or "openvswitch" is
present, so some consistency is provided.
(If "/etc/xensource/network.conf" is not "bridge", "vswitch", or
"openvswitch", then XAPI will refuse to run anyway, so not much is going
to happen on the system.)
Ben Pfaff [Fri, 4 Jun 2010 20:49:25 +0000 (13:49 -0700)]
discovery: Include datapath name in log messages.
This commit adds the datapath name to discovery and DHCP-related messages,
so that it is obvious to the user where discovery is taking place.
Previously, messages looked like:
Jun 04 13:41:29|00010|dhcp_client|INFO|sending DHCPDISCOVER
With this commit, they look like this:
Jun 04 13:41:29|00010|dhcp_client|INFO|br0: sending DHCPDISCOVER
I may be the only person in the world who regularly uses controller
discovery.
Ben Pfaff [Tue, 8 Jun 2010 17:38:57 +0000 (10:38 -0700)]
ofproto: Make OpenFlow connection log messages name the datapath.
Until now, log messages about OpenFlow connections have named the target
of the connection, e.g. "tcp:1.2.3.4:5555", but they have not named the
datapath. Most often, every datapath has the same target, so this can
make it difficult to tell which connection is going wrong. Usually, that
isn't important, because all connections with the same target will have the
same problems, but it's probably better to be more informative.
This commit changes the log messages to include the datapath name, so that
"tcp:1.2.3.4:5555" becomes, e.g., "xenbr0<->tcp:1.2.3.4:5555".
Requested-by: Keith Amidon <keith@nicira.com>