summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* daemon: Avoid races on pidfile creation.Ben Pfaff2011-04-043-175/+267
| | | | | | | | | | | | | | | | | | Until now, if two copies of one OVS daemon started up at the same time, then due to races in pidfile creation it was possible for both of them to start successfully, instead of just one. This was made worse when a previous copy of the daemon had died abruptly, leaving a stale pidfile. This commit implements a new pidfile creation and removal protocol that I believe closes these races. Now, a pidfile is asserted with "link" instead of "rename", which prevents the race on creation, and a stale pidfile may only be deleted by a process after it has taken a lock on it. This may solve mysterious problems seen occasionally on vswitch restart. I'm still puzzled by these problems, however, because I don't see anything in our tests cases that would actually cause two copies of a daemon to start at the same time, which as far as I can see is a necessary precondition for the problem.
* daemon: Integrate checking for an existing pidfile into daemonize_start().Ben Pfaff2011-04-0413-26/+13
| | | | | | | | | | | | Until now, it has been the responsibility of an individual daemon to call die_if_already_running() at an appropriate time. A long time ago, this had to happen *before* daemonizing, because once the process daemonized itself there was no way to report failure to the process that originally started the daemon. With the introduction of daemonize_start(), this is now possible, but we haven't been taking advantage of it. Therefore, this commit integrates the die_if_already_running() call into daemonize_start() and deletes the calls to it from individual daemons.
* daemon: Tolerate EINTR in fork_and_wait_for_startup().Ben Pfaff2011-04-042-5/+11
| | | | | It seems possible that a signal coming in at the wrong time could confuse this code. It's always best to loop on EINTR.
* Log anything that could prevent a daemon from starting.Ben Pfaff2011-04-0420-105/+171
| | | | | If a daemon doesn't start, we need to know why. Being able to consistently consult the log to find out is helpful.
* util: New function ovs_fatal_valist().Ben Pfaff2011-04-044-22/+11
| | | | This commit adds a few initial users but more are coming up.
* signals: New function signal_name().Ben Pfaff2011-04-043-12/+30
| | | | This will acquire a new user in an upcoming commit.
* type-props: New macro for estimating length of a decimal integer.Ben Pfaff2011-04-042-3/+19
|
* Add a few more users for ovs_retval_to_string().Ben Pfaff2011-04-044-14/+6
|
* vlog: Use PRINTF_FORMAT macro from compiler.h.Ben Pfaff2011-04-041-3/+4
| | | | | PRINTF_FORMAT is more portable than raw __attribute__. We use it elsewhere, I don't know why it wasn't used here.
* stream-ssl: Use out_of_memory() to abort due to lack of memory.Ben Pfaff2011-04-041-2/+1
| | | | | | This matches what xmalloc() does. It will be handled better by a monitor process (created with --monitor), which will restart the child instead of exiting.
* xenserver: Fix up iface-id after it changes or disappears too.Ben Pfaff2011-04-011-2/+8
| | | | | | | | | | | | | | | | | | | ovs-xapi-sync is supposed to always keep external-ids:iface-id up to date, but in fact it would only set it when an interface initially appeared. If the interface quickly disappeared and reappeared, then it failed to notice that iface-id had changed or disappeared. This happens in practice on Citrix XenServer, where VM "tap" devices often disappear and then reappear almost immediately during VM boot. This commit fixes the problem. This also fixes the similar problem for external-ids:bridge-id in Bridge records. Bridges aren't ordinarily destroyed and re-created quickly, so this problem might never have manifested in practice for bridges. Many thanks to Reid Price <reid@nicira.com> for identifying the problem and supplying an initial fix. Bug #5239. Reported-by: Henrik Amren <henrik@nicira.com>
* bridge: Avoid partitioning the dst set.Ben Pfaff2011-04-011-54/+19
| | | | | Scanning the dsts twice seems may be a little more efficient than partitioning it, and it now seems more straightforward to me.
* bridge: Separate mirroring logic from forwarding logic.Ben Pfaff2011-04-011-11/+30
| | | | | In my opinion this is easier to understand than the way that these two logically separate steps were previously entangled.
* bridge: Change "struct dst" from containing a dp_ifidx to a struct iface *.Ben Pfaff2011-04-011-35/+13
| | | | | | | The following commit will need to iterate over a set of "struct dst"s, obtaining the iface for each. It could look them up using the hash table that indexes over dp_ifidx, but it's easier if we simply store the iface pointer directly.
* bridge: Get rid of 'n_ifaces' member of struct port.Ben Pfaff2011-04-011-10/+7
| | | | If it doesn't exist then it can't have the wrong value.
* bridge: Break bonding implementation out into library.Ben Pfaff2011-04-014-1344/+1753
| | | | | | This removes over 1000 lines of code from bridge.c and will make it easier to moving the bonding implementation into ofproto as part of future development.
* bridge: Simplify and clean up bond slave enable/disable.Ben Pfaff2011-04-011-154/+104
| | | | | | | | | | | | | | The code that enables and disables bond slaves was a bit of a mess: * Disabling a slave could recursively enable a different slave. * Processing a flow could enable a slave. This commit gets rid of both of those properties, which made it difficult to reason about the code paths along which slaves would be enabled and disabled. Bug #5121.
* bridge: Drop obsolete comment.Ben Pfaff2011-04-011-1/+0
| | | | It's quite clear that we don't support double tagging now.
* bridge: Improve comment.Ben Pfaff2011-04-011-1/+1
|
* bridge: Change Ethernet address array from 8 bytes to ETH_ADDR_LEN bytes.Ben Pfaff2011-04-011-1/+1
| | | | | I don't know why this was declared as 8 bytes long but I only see 6 actually in use, as one would expect of an Ethernet address.
* bridge: Avoid redundant dpif_flow_flush().Ben Pfaff2011-04-011-1/+0
| | | | | ofproto_create() also calls dpif_flow_flush() very soon afterward. This seems more clearly in ofproto's domain anyhow.
* lacp: Encapsulate configuration into new structs.Ben Pfaff2011-04-013-48/+63
| | | | This makes it easier to pass configuration between modules.
* bridge: Drop LACP configuration members from struct iface and struct port.Ben Pfaff2011-04-013-64/+69
| | | | | | There's no reason that I can see to maintain this information in struct port and struct iface. It's redundant, since the lacp implementation maintains the same information.
* lacp: Remove unneeded forward references from header file.Ben Pfaff2011-04-011-5/+0
|
* lacp: Fix misleading prototype for lacp_configure().Ben Pfaff2011-04-012-2/+4
| | | | | | | | | Only the first 6 bytes (ETH_ADDR_LEN) of the 'sys_id' argument are used, but the prototype declared it as an array of 8 bytes. This has no effect on the generated code--the declared size of an array parameter is irrelevant--but it is misleading. Also, add 'const' since the array is not modified.
* vswitch: Improve schema documentation.Ben Pfaff2011-04-011-4/+13
|
* tag: New function tag_set_union().Ben Pfaff2011-04-012-2/+13
|
* list: New functions list_is_singleton(), list_is_short().Ben Pfaff2011-04-013-2/+20
|
* packets: Reserve headroom for VLAN header in eth_compose(), snap_compose().Ben Pfaff2011-04-011-4/+13
| | | | | This allows callers to add a VLAN header to the composed packet and send it out on a VLAN without copying the whole payload.
* packets: New function eth_set_vlan_tci(), from dpif-netdev.Ben Pfaff2011-04-013-32/+33
| | | | This will soon be used in the upcoming bond library.
* packets: Fix potential use-after-free in compose_benign_packet().Ben Pfaff2011-04-011-22/+7
| | | | | | | | | The second call to ofpbuf_put_zeros() could cause the 'eth' pointer to be invalidated. It appears that this does not fix a real bug because the existing callers all preallocate 128 bytes of tailroom, but the interface doesn't document that requirement.
* packets: New function snap_compose(); rename compose_packet() for consistency.Ben Pfaff2011-04-014-16/+56
| | | | The following commit will introduce the first use of snap_compose().
* netdev-vport: Implement 'send' function.Ben Pfaff2011-04-013-1/+68
| | | | | The new implementation of the bonding code expects to be able to send packets on netdevs using netdev_send(). This implements it.
* netdev-linux: Support 'send' for netdevs opened with NETDEV_ETH_TYPE_NONE.Ben Pfaff2011-04-012-9/+39
| | | | | | The new implementation of the bonding code expects to be able to send packets using netdev_send(). This makes it possible for Linux netdevs.
* ovsdb-server: Avoid intermittent test failures due to lockfile log message.Ben Pfaff2011-04-011-3/+3
| | | | | | | | | Sometimes lockfile will emit a message saying that it took a little while to get the lock, which caused spurious test failures. This commit suppresses the message. With this change, I was able to run these tests continuously for some time without failures. This was a bug in the testsuite, not in the code under test.
* cfm: Allow time for CCM reception after cfm_configure();Ethan Jackson2011-04-011-14/+17
| | | | | | | | | | | | | | | | | | Before this (and the previous) patch, whenever cfm_configure was called it would set the fault_timer to expired. Thus, the next call to cfm_run would notice a lack of CCM reception and trigger a faulted status. This is a bug in and of itself, but normally would not be a big deal because cfm_configure should only be called infrequently (when the database changes). However due to an unrelated bug, cfm_configure() was getting called approximately once per second. This resulted in all monitors showing faults all of the time. This patch fixes the problem by not expiring the timer at cfm_configure(). Instead it gives it the appropriate fault_interval amount of time to miss heartbeats. Bug #5244.
* cfm: cfm_configure() only update when necessary.Ethan Jackson2011-04-011-7/+12
| | | | | | | | Calling cfm_configure often could cause timers to be reset resulting in unexpected behavior. This commit only updates when cfm configuration actually changed. Bug #5244.
* ovsdb: Truncate bad transactions from database log.Ben Pfaff2011-03-314-3/+77
| | | | | | | | | | | | | | | | | When ovsdb-server reads a database file that is corrupted at the transaction level (that is, the transaction is valid JSON and has the correct SHA-1 hash, but it does not describe a valid database transaction), then ovsdb-server should truncate it and overwrite it by valid transactions. However, until now, it didn't. Instead, it would keep the invalid transaction and possibly every transaction in the database file (depending on in what way the transaction was invalid), which would just cause the same trouble again the next time the database was read. This fixes the problem. An invalid transaction will be deleted from the database file at the first write to the database. Bug #5144. Bug #5149.
* ovsdb: Check that ovsdb-server truncates corrupted database logs.Ben Pfaff2011-03-311-0/+47
| | | | | | | | | | When ovsdb-server reads a database that is corrupted at the log level (that is, when ovsdb_log detects the corruption by checking the SHA-1 hash of the record or JSON parser error reporting), then writing to the database should discard the corrupted data and thereby fix the problem for future ovsdb-server runs. This already worked OK. This just adds an extra test.
* ovsdb: Raise database corruption log level from warning to error.Ben Pfaff2011-03-311-1/+1
| | | | | | | If there's database corruption then it indicates that something went wrong, e.g. the machine was powered-off by power failure. It's definitely something that the admin should know about. This sounds like an error to me, so use that log level.
* ovsdb: Force strong references to non-root tables to be persistent.Ben Pfaff2011-03-314-32/+107
| | | | | | | | | | | | | | | | | | | | | | When a strong reference to a non-root table is ephemeral, the database log can contain inconsistencies. In particular, if the column in question is the only reference to a row, then the row will be created in one logged transaction but the reference to it will not be logged (because it is ephemeral). Thus, any later occurrence of the row later in the log (to modify it, to delete it, or just to reference it) will yield a transaction error and reading the database will abort at that point. This commit fixes the problem by forcing any column with a strong reference to a non-root table to be persistent. The change to ovsdb_schema_from_json() looks bigger than it really is: it just swaps the order of two operations on the schema and updates their comments. Similarly for the update to ovs.db.DbSchema.__init__(). Bug #5144. Reported-by: Sujatha Sumanth <ssumanth@nicira.com> Bug #5149. Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
* ovsdb-types: Fix bug in ovsdb_base_type_is_ref().Ben Pfaff2011-03-311-2/+2
| | | | | | | | | | This function only worked properly inside OVSDB itself, because that is the only place where the 'refTable' member of ovsdb_base_type is set. Both inside and outside OVSDB, 'refTableName' is set for reference types, so it's better to check for that. This doesn't fix any existing bug because this function was only used inside OVSDB until now.
* ovs-brcompatd: Convert svecs to ssets.Ben Pfaff2011-03-311-30/+24
|
* bridge: Convert svecs to ssets.Ben Pfaff2011-03-311-6/+5
|
* ovs-openflowd: Use sset in place of svec.Ben Pfaff2011-03-313-49/+46
| | | | Also deletes svec_split() since this was the only user.
* ofproto: Change string sets in interface from svec to sset.Ben Pfaff2011-03-3111-65/+75
|
* ovsdb-parser: Use sset instead of svec for detecting unused members.Ben Pfaff2011-03-312-11/+9
| | | | Should be slightly cheaper than sorting a list (O(n) vs. O(n lg n)).
* netdev: Use sset instead of svec in netdev interface.Ben Pfaff2011-03-314-31/+30
|
* dpif: Use sset instead of svec in dpif interface.Ben Pfaff2011-03-316-49/+46
|
* Convert shash users that don't use the 'data' value to sset instead.Ben Pfaff2011-03-317-116/+109
| | | | | | In each of the cases converted here, an shash was used simply to maintain a set of strings, with the shash_nodes' 'data' values set to NULL. This commit converts them to use sset instead.