Ethan Jackson [Tue, 26 Apr 2011 22:39:58 +0000 (15:39 -0700)]
lacp: Allow configurable aggregation keys.
Users will the ability to manually set aggregation keys on a
per-slave basis in order to use some of the more advanced LACP
features. Most notably, LACP controlled active-backup bonding
requires fine grained aggregation key configuration.
Ben Pfaff [Tue, 26 Apr 2011 16:42:18 +0000 (09:42 -0700)]
Remove support for obsolete "tun_id_from_cookie" extension.
The "tun_id_from_cookie" OpenFlow extension predated NXM and supports only
a fraction of its features. Nothing (at Nicira, anyway) uses it any
longer. Support for it had been broken since January and it took until a
few days ago for anyone to complain, so it cannot be too important. This
commit removes it.
Ben Pfaff [Thu, 21 Apr 2011 23:34:51 +0000 (16:34 -0700)]
bond: Be more careful about adding and removing netdevs in the monitor.
The code was careless about updating the netdev_monitor. Newly added
slaves weren't added to the monitor until the next bond_reconfigure() call,
and netdevs were never removed from the monitor.
Ben Pfaff [Thu, 21 Apr 2011 23:25:41 +0000 (16:25 -0700)]
ofproto: Adjust netdev_monitor when switching netdevs.
This fixes a segfault in the "ofproto - mod-port" test. The segfault
should not occur--there must be a bug in the netdev_monitor or possibly
the netdev_dummy implementation--but the netdev_monitor_remove() and
netdev_monitor_add() calls are definitely wanted here in any case to ensure
that the new netdev, not the old one, is what gets monitored.
Ben Pfaff [Wed, 13 Apr 2011 18:10:44 +0000 (11:10 -0700)]
bridge: Tolerate missing Port and Interface records for local port.
Until now, ovs-vswitchd has been unable to configure IP addresses and
routes for bridges whose Bridge records lack a Port and an Interface
record for the bridge's local port (e.g. OFPP_LOCAL, the port with the
same name as the bridge itself). When such a bridge was reconfigured,
ovs-vswitchd would output a log message that worried people.
This commit fixes the internal limitation that led to the message being
printed.
Ben Pfaff [Wed, 20 Apr 2011 20:48:11 +0000 (13:48 -0700)]
ofproto: Rework and fix bugs in port change detection.
The OpenFlow port change detection code in update_port() is supposed to
send out an OFPT_PORT_STATUS message whenever an OpenFlow port is added or
removed or changes in some way. This commit fixes a number of bugs that
have persisted until now.
First, if a port with a given name is removed from the datapath and a new
port with the same name but a different port number is added to the
datapath, then update_port() would report this as a port "modify" change.
Reporting this as a "modify" seems likely to confuse controllers, which
have no reason to realize that the old port was deleted and may not
understand why a port that has not been reported as added would be
modified. (This scenario is more likely than before, because the Linux
datapath implementation no longer quickly reuses port numbers. This
problem has actually been reported in testing.) This commit fixes the
problem by changing update_port() to report a "delete" of the old port
followed by an "add" of the new port.
Second, suppose that a datapath initially has "eth1" on port 1 and "eth2"
on port 2. Then, "eth1" gets removed and "eth2" is reassigned to port 1.
If update_port() is first passed "eth2", then the old implementation would
have sent out an OpenFlow "modify" notification instead of "delete"
followed by "add", which is the same as the previous scenario. But as a
further wrinkle, it would have failed to remove "eth1", which meant that we
ended up with two "ofports" with port number 1! This commit fixes this
problem too.
Reported-by: David Tsai <dtsai@nicira.com>
Bug #5466.
NIC-372.
Ben Pfaff [Wed, 20 Apr 2011 20:03:45 +0000 (13:03 -0700)]
ofproto: Consistently use netdev's name instead of ofp_phy_port name.
There are at least two ways to get an ofport's name: from the netdev using
netdev_get_name() or from the ofp_phy_port's 'name' member. Some code used
one, some used the other. This switches all relevant code to use only
netdev_get_name(), because the 'name' member in ofp_phy_port is
fixed-length and thus a long name could be truncated.
This isn't a problem under Linux since the maximum length of a network
device's name under Linux is the same as the field width in ofp_phy_port.
Ethan Jackson [Wed, 20 Apr 2011 22:53:58 +0000 (15:53 -0700)]
bond: BM_STABLE consistent hashing.
This patch converts stable bonds from modulo n based hashing to
Highest Random Weight based hashing. This hashing strategy only
redistributes 1/n_slaves traffic when a slave is enabled or
disabled. It also turns out to have a vastly simpler
implementation.
Ethan Jackson [Wed, 20 Apr 2011 00:19:25 +0000 (17:19 -0700)]
bond: Give stable bonds one tag.
Stable bonds require all flows to be revalidated when anything
changes. Instead of giving each slave a tag, and ORing them
together. This commit creates one tag representing the entire
bond. This will cause less false positives when deciding which
flows to revalidate.
Ben Pfaff [Mon, 11 Apr 2011 18:22:39 +0000 (11:22 -0700)]
bridge: Avoid memory leak from RSPAN mirrors in bridge_destroy().
Mirrors that output to ports will be destroyed when their output ports are
destroyed, but mirrors that output to VLANs ("RSPAN" mirrors) don't get
automatically destroyed like this and we need to take care of them in a
separate loop.
Ethan Jackson [Tue, 19 Apr 2011 21:11:23 +0000 (14:11 -0700)]
bond: bond_stb_enable_slave() never triggered.
bond_stb_enable_slave() depended on bond->stb_slaves being
nonnull. However, bond_stb_enable_slave() is responsible for
initializing this parameter. Thus none of it's logic ever ran.
Ethan Jackson [Mon, 18 Apr 2011 19:48:59 +0000 (12:48 -0700)]
lacp: Remove LACP_[FAST|SLOW]_TIME_RX macros.
The receive rate for a LACP packets is simply 3 times the
transmission rate. It doesn't make sense to maintain separate
macros for these values especially since future patches will allow
arbitrary transmission rates.
Ben Pfaff [Mon, 18 Apr 2011 17:11:43 +0000 (10:11 -0700)]
ofp-util: Properly handle "tun_id"s in tun_id_from_cookie flows.
Just setting the tun_id field isn't enough--it's also necessary to set
the tun_id_mask. Otherwise the call to cls_rule_zero_wildcarded_fields()
at the end of ofputil_cls_rule_from_match() will zero out the tun_id again.
This was broken by commit 8368c090cab "Implement arbitrary bitwise masks
for tun_id field" back in January. (This makes me wonder whether we can
drop support for tun_id_from_cookie now.)
Ben Pfaff [Mon, 18 Apr 2011 18:24:50 +0000 (11:24 -0700)]
socket-util: Properly set socket permissions in make_unix_socket().
Under Linux, at least, bind and fchmod interact for Unix sockets in a way
that surprised me. Calling fchmod() on a Unix socket successfully sets the
permissions for the socket's own inode. But that has no effect on any
inode that has already been created in the file system by bind(), because
that inode is not the same as the one for the Unix socket itself.
However, if you bind() *after* calling fchmod(), then the bind() takes the
permissions for the new inode from the Unix socket inode, which has the
desired effect.
This also adds a more portable fallback for non-Linux systems.
Ethan Jackson [Sat, 16 Apr 2011 00:03:37 +0000 (17:03 -0700)]
bridge: LACP port ID and system ID in database.
Extremely advanced users may want fine grained control over the
LACP port and system IDs of a bond. This would be extremely
unusual for the average user, so this patch puts the configuration
parameters in other_config of the relevant tables.
Ethan Jackson [Mon, 18 Apr 2011 22:13:34 +0000 (15:13 -0700)]
lacp: New "strict" lacp mode.
When LACP negotiations are unsuccessful, OVS falls back to standard
balance-slb bonding. In some cases, users may want to require
successful LACP negotiations for any slaves to be enabled at all.
This patch implements a new "strict" mode which disables all slaves
when LACP negotiations are unsuccessful.
Ben Pfaff [Thu, 7 Apr 2011 21:39:36 +0000 (14:39 -0700)]
vlog: Fix VLOG and VLOG_RL macros' treatment of LEVEL argument.
These macros expanded the LEVEL argument without protecting it with
parentheses, which meant that an argument like 'cond ? VLL_DBG : VLL_WARN'
did not have the desired effect (and caused a GCC warning).
This commit fixes the problem and avoids expanding LEVEL more than once,
too.
Ben Pfaff [Fri, 8 Apr 2011 19:52:23 +0000 (12:52 -0700)]
bridge: Fix VLAN selection mirroring logic.
The logic here did not make sense. A packet arriving on a port is mirrored
if the port is a mirroring source port AND (not OR) the packet is in one of
the VLANs that is mirrored.
This test has been here since the mirroring code was introduced. It seems
to me that it was never correct.
Ben Pfaff [Tue, 29 Mar 2011 18:16:31 +0000 (11:16 -0700)]
bridge: Reintroduce log message that was lost (and wrong).
Setting the 'mac' in the Interface record for a bridge's local port has
always been ineffective, but the log message was suppressed because of a
check at too high of a level. This commit fixes the problem. It also
fixes the wording of the log message, which has been obsolete since the
introduction of the database.
Finally, it seems better to check for the local port before checking for a
multicast address, so this reverses the order of the checks.
Ben Pfaff [Tue, 5 Apr 2011 19:17:08 +0000 (12:17 -0700)]
daemon: Reduce log level of "pid file is stale" message.
This message will appear repeatedly when ovs-vswitchd is running, if there
is any stale pidfile in /var/run/openvswitch, because ovs-vswitchd reads
all of the pidfiles in that directory periodically to update statistics.
Ben Pfaff [Tue, 5 Apr 2011 22:58:06 +0000 (15:58 -0700)]
ofproto: Avoid memory leak in classifier on destruction.
ofproto_flush_flows() flushes the flow table but then it reintroduces flows
required by fail-open or in-band. These are then leaked when the
classifier is destroyed a little later.
This fixes the problem by not reintroducing these flows when ofproto is
being destroyed.
Ethan Jackson [Wed, 13 Apr 2011 23:06:50 +0000 (16:06 -0700)]
bridge: Report lacp_slave_is_current() in the database.
Whether or not a given slave is current with its LACP protocol
messages can be very interesting to a controller. If an interface
is not current, it usually indicates a connectivity problem or
misconfiguration of some sort.
Ethan Jackson [Fri, 15 Apr 2011 19:57:30 +0000 (12:57 -0700)]
bridge: Generalize CFM rate limiter.
In future patches, lacp status will need to be written to the
database in a rate limited manner. It doesn't make sense to run
two parallel rate limiters. This patch renames the CFM rate
limiter to something more generic.
Ben Pfaff [Fri, 15 Apr 2011 16:40:50 +0000 (09:40 -0700)]
bridge: Properly test for out-of-range values.
This code was trying to check for priorities greater than UINT16_MAX and
reset them, but it assigned the value to a uint16_t before it checked it,
which of course hid the problem.
Fixes the following GCC warning:
vswitchd/bridge.c:3034: warning: comparison is always false due to limited
range of data type
Ben Pfaff [Fri, 15 Apr 2011 16:39:08 +0000 (09:39 -0700)]
Avoid warnings about comparisons that are always true.
The range of "enum" types varies from one ABI to another. If the enums
being tested in these functions happen to be 16 bits wide, then GCC may
issue a warning because, in such a case, the comparison is always true.
Using an int instead of a uint16_t avoids that particular problem and
should suppress the warning.
Fixes the following reported warnings:
lib/ofp-print.c:240: warning: comparison is always true due to limited
range of data type
lib/ofp-util.c:1973: warning: comparison is always false due to limited
range of data type
Ben Pfaff [Fri, 15 Apr 2011 16:31:36 +0000 (09:31 -0700)]
Fix calls to ctype functions.
The ctype functions often need casts to be fully C standards compliant.
Here's the full explanation that I used to post to comp.lang.c from time
to time when the issue came up:
With the to*() and is*() functions, you should be careful to cast
`char' arguments to `unsigned char' before calling them. Type `char'
may be signed or unsigned, depending on your compiler or its
configuration. If `char' is signed, then some characters have
negative values; however, the arguments to is*() and to*() functions
must be nonnegative (or EOF). Casting to `unsigned char' fixes this
problem by forcing the character to the corresponding positive value.
This fixes the following warnings from some version of GCC:
lib/ofp-parse.c:828: warning: array subscript has type 'char'
lib/ofp-print.c:617: warning: array subscript has type 'char'
Ethan Jackson [Thu, 14 Apr 2011 23:50:26 +0000 (16:50 -0700)]
bond: Completely pull LACP module out of bond.
The bonding code only needs to know whether a given slave may be
enabled, and whether LACP has been negotiated on the bond. Instead
of passing in the LACP handle and letting the bond query this
information. This patch passes in the information directly.
Ethan Jackson [Fri, 15 Apr 2011 00:37:29 +0000 (17:37 -0700)]
bond: Create new 'stable_id' parameter.
For BM_STABLE bonds, instead of choosing the sort key in the
qsort() comparator, this patch makes it a configuration setting of
each slave. This will help wrest LACP out of the bonding code
further in future patches.
Ethan Jackson [Thu, 14 Apr 2011 00:58:26 +0000 (17:58 -0700)]
bond: Give bridge control over LACP module.
Before this patch, the bonding code had taken over responsibility
for running the LACP module. However, the bonding code only needs
the LACP module for some basic status queries. LACP and bonding
are actually logically parallel modules and do not really have a
parent child relationship. Furthermore, we need to be able to run
LACP on non-bonded interfaces which the existing approach
prevented. This patch gives control of the LACP module back to the
bridge.
Ethan Jackson [Thu, 14 Apr 2011 22:24:18 +0000 (15:24 -0700)]
lacp: Remove enabled flag.
The enabled flag in the LACP module was only used to set the
Collecting and Distributing flags in the LACP protocol. It was
intended to be set by the bonding code to mimic its enabled flag.
The spec is relatively vague on the precise meaning of these flags,
and most implementations do something completely different with
them. For these reasons, it seems acceptable to remove the enabled
flag for the sake of simplicity. A slave is now Collecting and
Distributing if it is attached, or LACP couldn't be negotiated.
Ethan Jackson [Tue, 12 Apr 2011 22:15:32 +0000 (15:15 -0700)]
bond: Use bond_enable_slave at slave registration.
Slave registration should go through the normal slave enabling
facilities instead of doing it by hand. Before this patch, newly
created slaves would have no tag associated with them.
Furthermore, any further changes to how slaves are enabled would
not be picked up by the registration code.
Ethan Jackson [Wed, 13 Apr 2011 20:56:37 +0000 (13:56 -0700)]
bond: Reset bond_entry's during massive flow revalidations.
When all flows in a bond are revalidated, stale bond_entry's can
cause incorrect load balancing. These issues will naturally
resolve themselves overtime. However, it's better to deal with
them immediately.
Ethan Jackson [Wed, 13 Apr 2011 01:28:04 +0000 (18:28 -0700)]
bond: Revalidate flows when bond_is_tcp_hash() changes;
If LACP causes the return of bond_is_tcp_hash to change for
whatever reason, all flows should be revalidated because they will
have a different hash result.
Ethan Jackson [Wed, 13 Apr 2011 00:53:24 +0000 (17:53 -0700)]
bond: Reconfigure flows when bond mode changes.
Changes in the bonding mode can cause drastic changes in flow
assignments to slaves. This commit causes all flows in a bridge
to be revalidated when bond_reconfigure() changes its bonding mode.
This approach is a bit aggressive, but bond reconfiguration
shouldn't happen often.
Ben Pfaff [Tue, 12 Apr 2011 18:43:11 +0000 (11:43 -0700)]
configure: Add option --enable-Werror to add -Werror to CFLAGS.
-Werror is useful for development, but it screws up configure because it's
impossible to guess what new warnings compilers will add in the future.
This commit adds a new configure option to add CFLAGS after the configure
checks are done.
The use of AC_CONFIG_COMMANDS_PRE is based on Eric Blake's suggestion on
the autoconf mailing list: "AC_CONFIG_COMMANDS_PRE probably fits the bill
as the ideal macro to use for guaranteeing that you inject your shell code
at the last possible moment."
Ben Pfaff [Tue, 12 Apr 2011 18:31:58 +0000 (11:31 -0700)]
ovsdb-idl: Suppress "delete" operations for garbage-collected tables.
Deciding what delete operations to issue on garbage-collected tables has
been a bit of a difficult issue for ovs-vsctl. When garbage collection was
introduced in commit c5f341a "ovsdb: Implement garbage collection",
ovs-vsctl did not issue any deletions for these tables at all. As a side
effect, ovs-vsctl did not notice that records were going to be deleted.
That meant that when multiple commands were issued in one ovs-vsctl run,
ovs-vsctl could get confused by apparent duplicate records that did not
in fact exist. Commit 28a14bf "ovs-vsctl: Back out garbage collection
changes" fixed the problem by putting all of the explicit deletions back
into ovs-vsctl.
However, adding these explicit deletions had the price that it then became
(again) impossible to use ovs-vsctl commands to delete duplicates, for
example to use "ovs-vsctl del-br" to delete a bridge that points to the
same Port records that some other Bridge record also does. This commit
makes that possible again, by implementing a compromise:
* Internally, ovs-vsctl deletes the records that it believes should be
deleted.
* ovsdb-idl suppresses the deletions when it makes the RPC call into
the database server.
Bug #5358. Reported-by: Henrik Amren <henrik@nicira.com>
Ben Pfaff [Tue, 12 Apr 2011 17:02:40 +0000 (10:02 -0700)]
debian: Do not call obsolete command "ovs-ofctl status" in ovs-bugtool.
This command was removed in commit 9b45d7f5d (ofproto: Get rid of archaic
"switch status" OpenFlow extension) but I didn't notice that ovs-bugtool
uses that command and forgot to remove it at the time.
Bug #5360. Reported-by: Michael Mao <mmao@nicira.com> Reported-by: Keith Amidon <keith@nicira.com>
Ben Pfaff [Fri, 8 Apr 2011 23:37:22 +0000 (16:37 -0700)]
dpif-linux: Avoid segfault on netdev_get_stats() without kernel module.
netdev_linux_get_stats() calls into netdev_vport_get_stats(), which in
turn attempts a transaction on genl_sock. If the kernel module isn't
loaded, then genl_sock won't be there, and in any case there's nothing that
guarantees that it's been initialized yet.
This fixes the problem by ensuring that dpif_linux was initialized properly
before attempting a transaction on genl_sock.
Ben Pfaff [Fri, 8 Apr 2011 23:34:17 +0000 (16:34 -0700)]
netdev-linux: Fix netdev_send() to tap device.
Commit 76c308b50d3 "netdev-linux: Support 'send' for netdevs opened with
NETDEV_ETH_TYPE_NONE" broke sending packets to tap devices. Sending a
packet to a tap device with an AF_PACKET socket causes that packet to be
looped back to be received on the tap device again, which obviously isn't
useful.
Ben Pfaff [Fri, 8 Apr 2011 23:44:31 +0000 (16:44 -0700)]
netdev-linux: Avoid "cleverness" in swap_uint64().
Obviously correct code is easier on everyone. As the C FAQ says:
20.15c: How can I swap two values without using a temporary?
A: The standard hoary old assembly language programmer's trick is:
a ^= b;
b ^= a;
a ^= b;
But this sort of code has little place in modern, HLL
programming. Temporary variables are essentially free,
and the idiomatic code using three assignments, namely
int t = a;
a = b;
b = t;
is not only clearer to the human reader, it is more likely to be
recognized by the compiler and turned into the most-efficient
code (e.g. using a swap instruction, if available). The latter
code is obviously also amenable to use with pointers and
floating-point values, unlike the XOR trick. See also questions
3.3b and 10.3.
Ben Pfaff [Wed, 30 Mar 2011 00:05:52 +0000 (17:05 -0700)]
bridge: Monitor fewer OVSDB columns.
By omitting columns that ovs-vswitchd does not use at all, and omitting
alerts for columns that ovs-vswitchd writes to but does not read, we can
save CPU time and bandwidth.
Ben Pfaff [Fri, 1 Apr 2011 17:50:52 +0000 (10:50 -0700)]
ovsdb-idl: Fix atomicity of writes that don't change a column's value.
The existing ovsdb_idl_txn_commit() drops any writes that don't change a
column's value from what was last reported by the database. But this isn't
a valid optimization, because it breaks the atomicity of transactions.
Suppose columns A and B initially have values 1 and 2. Client 1 writes
value 1 to both columns in one transaction. Client 2 writes value 2 to
both columns in another transaction. The only possible valid results for
any serial ordering of transactions are 1,1 or 2,2. But if both clients
drop writes to columns that they have not modified, then 2,1 also becomes
possible (because client 1 just writes to B and client 2 just writes to A).
However, for write-only columns we can optimize this out because the IDL
can assume it is the only client writing to a column.
Andrew Evans [Thu, 7 Apr 2011 19:43:18 +0000 (19:43 +0000)]
datapath: Update netdev_frame_hook() for 2.6.39 rx handler API change.
netdev_rx_handler_register() changed the type of the skb argument to the
callback function as well as the return type. Special-case
netdev_frame_hook() to do the right thing on 2.6.39 and later.
Signed-off-by: Andrew Evans <aevans@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Ethan Jackson [Thu, 7 Apr 2011 00:23:40 +0000 (17:23 -0700)]
cfm: Fix broken fault logic.
If the last receive time for a remote MP was before the last fault
check, the CFM code would not declare a fault. This is, of course,
exactly the wrong response.
Ethan Jackson [Mon, 4 Apr 2011 23:55:34 +0000 (16:55 -0700)]
dpif-linux: Choose port numbers more prudently.
Before this patch the kernel chose the lowest available number for
newly created datapath ports. This patch moves the port number
choosing responsibility to user space, and implements a least
recently used port number queue in an attempt to avoid reuse.
Ethan Jackson [Sat, 2 Apr 2011 00:37:56 +0000 (17:37 -0700)]
bond: Choose slaves randomly.
When the bonding library encounters a flow it hasn't seen before,
it assigns it to the active slave and waits for load balancing to
move it to a more appropriate place. This commit causes it to
first attempt a random slave.
Ben Pfaff [Mon, 4 Apr 2011 17:59:19 +0000 (10:59 -0700)]
daemon: Avoid races on pidfile creation.
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.
Ben Pfaff [Thu, 31 Mar 2011 16:44:30 +0000 (09:44 -0700)]
daemon: Integrate checking for an existing pidfile into daemonize_start().
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.
Ben Pfaff [Thu, 31 Mar 2011 21:52:36 +0000 (14:52 -0700)]
stream-ssl: Use out_of_memory() to abort due to lack of memory.
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.
Ben Pfaff [Fri, 1 Apr 2011 20:47:51 +0000 (13:47 -0700)]
xenserver: Fix up iface-id after it changes or disappears too.
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>
Ben Pfaff [Thu, 24 Mar 2011 19:30:51 +0000 (12:30 -0700)]
bridge: Change "struct dst" from containing a dp_ifidx to a struct iface *.
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.
Ben Pfaff [Wed, 30 Mar 2011 18:03:16 +0000 (11:03 -0700)]
bridge: Break bonding implementation out into library.
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.
Ben Pfaff [Wed, 23 Mar 2011 17:47:15 +0000 (10:47 -0700)]
bridge: Simplify and clean up bond slave enable/disable.
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.