2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00
Commit Graph

551 Commits

Author SHA1 Message Date
Ben Pfaff
6f90b8f402 bridge: Factor code out of bridge_reconfigure().
This is almost entirely code motion.  I only made minor style changes as
I moved code around.
2011-05-04 10:20:04 -07:00
Ben Pfaff
e8192d80ba bridge: Get rid of bridge_get_all_ifaces(), bridge_fetch_dp_ifaces().
The bridge_get_all_ifaces() function is rather odd.  It creates an shash
index over the "struct iface"s within a bridge, but there's already an
index over them (the 'iface_by_name' hmap in struct bridge) that the
iface_lookup() function searches.  The only value it adds is to put the
names of bond fake ifaces into the index, but that's hardly worth it.  We
can just search the existing hash table as needed, instead.

The bridge_fetch_dp_ifaces() function is also odd.  It fetches the entire
mapping from port number to name from the dpif again, although this has
already been done twice already.  We can just merge this in with the second
iteration.

This commit makes both of those changes.
2011-05-04 10:18:23 -07:00
Ben Pfaff
764072fd84 bridge: Change all_bridges from list to hmap (indexed by name).
This is more convenient for looking up a bridge by name.  That makes
reconfiguration a little bit simpler, because there is no longer a need to
build a temporary index of existing bridges.  I don't see any downsides.
2011-05-04 10:15:32 -07:00
Ben Pfaff
b5827b24c7 bridge: Eliminate direct dependencies on dpif.
The 'ofp_portp' argument of the new function ofproto_port_add() is always
set to NULL in this commit, but a future commit will use nonnull values.
2011-05-04 10:15:31 -07:00
Ben Pfaff
ebea37cc67 bridge: Change 'iface_by_name' from shash to hmap.
This avoids having duplicate copies of interface names (inside the shash)
and it isn't any harder to work with.
2011-05-04 10:12:06 -07:00
Ben Pfaff
be6255a825 bridge: Use bridge name, instead of dpif name, in log messages.
This reduces the number of direct references to the dpif, which
future commits will eliminate from the bridge code.
2011-05-04 10:12:05 -07:00
Ben Pfaff
c3effea5f6 bridge: Inline iterate_and_prune_ifaces() and remove it.
The main reason that iterate_and_prune_ifaces() existed was because it was
somewhat inconvenient to iterate across all of the interfaces, especially
if anything needed to be deleted.  Now that we've switched from arrays to
lists and hmaps, it's a bit easier, and certainly it's easier to read code
when there aren't any callbacks involved, so inline what this was doing.

This was the only remaining caller of iterate_and_prune_ifaces() so this
removes that function as well as the callback.
2011-05-04 10:12:05 -07:00
Ben Pfaff
7ae792355f bridge: Avoid extra iteration through all "struct iface"s.
There's no reason to do these separately as far as I can see.
2011-05-04 10:12:03 -07:00
Ethan Jackson
e1ce3f2dcc 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.
2011-04-26 17:54:33 -07:00
Ethan Jackson
da2f7b8ff5 lacp: New other_config setting "lacp-force-aggregatable".
In some extremely advanced situations, one may want to force
non-bondable slaves to advertise themselves as bondable.  This
patch adds that capability.

Also includes some minor code cleanup.
2011-04-26 17:51:09 -07:00
Ethan Jackson
672d18b296 bond: New bond-hash-basis setting. 2011-04-26 11:05:28 -07:00
Ethan Jackson
84b3286420 bridge: Create new "null" interface type.
Null interfaces are completely ignored by Open vSwitch.
2011-04-26 11:05:18 -07:00
Ben Pfaff
2a4ae6357e mac-learning: Change mac_learning_set_flood_vlans() to not take ownership.
These new semantics are less efficient in the case where the flood_vlans
actually changed, but that should be very rare.

There are no advantages to this change on its own, but upcoming commits
will add multiple layers between the code supplying the flood_vlans and
actually calling mac_learning_set_flood_vlans().  Consistency in this
multilayered interface seems valuable, and the rest of it does not transfer
ownership from the caller to the callee.
2011-04-25 17:11:29 -07:00
Ben Pfaff
0fb7b9156a vlan-bitmap: New data structure. 2011-04-25 17:11:29 -07:00
Ben Pfaff
08fd19f01b bridge: Move logic for flushing flows and standalone mode into connmgr.
This improves the abstraction behind ofproto and connmgr.

Some of this could even go into fail_open, but I'm not sure that it would
make anything easier to understand.
2011-04-25 17:11:29 -07:00
Ben Pfaff
a01fbfafd4 bridge: Remove slaves from the bond before closing their netdevs.
A bond slave has a pointer to its iface's netdev, so we don't want it to
keep that pointer after the bridge closes the netdev.

This is becoming a bit of a mess so perhaps we need reference counting for
netdevs (although Jesse didn't like the idea when I proposed it before).
2011-04-21 16:37:38 -07:00
Ben Pfaff
cfea354b81 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.

Bug #5385.
2011-04-21 13:35:16 -07:00
Ben Pfaff
f76e2dfc8a 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.
2011-04-20 10:41:23 -07:00
Ethan Jackson
cdcf42c664 lacp: Implement custom timing mode.
With this patch, the LACP module may be manually configured to use
an arbitrary transmission rate set in the database.
2011-04-19 13:49:36 -07:00
Ethan Jackson
abd4a95de3 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.
2011-04-19 11:19:46 -07:00
Ethan Jackson
206018136a 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.
2011-04-19 10:33:19 -07:00
Ben Pfaff
5621d47b9e 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.
2011-04-19 09:32:18 -07:00
Ben Pfaff
ede2fd6d78 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.
2011-04-19 09:32:18 -07:00
Ben Pfaff
8bbc128e92 bridge: Initialize mirrors' uuid member.
Otherwise mirrors get destroyed and re-created on every reconfiguration.
2011-04-19 09:32:18 -07:00
Ethan Jackson
a8172aa378 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.
2011-04-18 10:48:48 -07:00
Ethan Jackson
815cd5837b 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.
2011-04-18 10:48:48 -07:00
Ben Pfaff
b5a2538963 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

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
2011-04-18 10:32:50 -07:00
Ethan Jackson
abf754896e bridge: Destroy bond when port is destroyed. 2011-04-15 12:19:27 -07:00
Ethan Jackson
4d6fb5ebd0 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.
2011-04-15 12:19:26 -07:00
Ethan Jackson
e1e9054895 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.
2011-04-15 11:15:57 -07:00
Ethan Jackson
5827ce14d0 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.
2011-04-15 11:04:04 -07:00
Ethan Jackson
59d7b2b656 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.
2011-04-12 17:53:24 -07:00
Ethan Jackson
3b6a2571f0 autopath: Create the autopath action.
The newly created autopath action will be the way OpenFlow
interacts with the existing bonding infrastructure.
2011-04-11 15:56:20 -07:00
Ben Pfaff
62f3aaedac 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.
2011-04-08 13:56:56 -07:00
Ethan Jackson
392730c42b bridge: Run once before configuring CFM.
CFM configuration requires the ofproto_run function to have been
executed at least once in order to guarantee that the relevant
ports exist.

Bug #5303.
2011-04-06 16:59:22 -07:00
Ben Pfaff
0b0bd9c9e3 bridge: Avoid partitioning the dst set.
Scanning the dsts twice seems may be a little more efficient than
partitioning it, and it now seems more straightforward to me.
2011-04-01 15:52:21 -07:00
Ben Pfaff
c38e3405d9 bridge: Separate mirroring logic from forwarding logic.
In my opinion this is easier to understand than the way that these
two logically separate steps were previously entangled.
2011-04-01 15:52:21 -07:00
Ben Pfaff
d55c25660b 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.
2011-04-01 15:52:20 -07:00
Ben Pfaff
402f2858db bridge: Get rid of 'n_ifaces' member of struct port.
If it doesn't exist then it can't have the wrong value.
2011-04-01 15:52:20 -07:00
Ben Pfaff
f620b43af1 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.
2011-04-01 15:52:20 -07:00
Ben Pfaff
207079c429 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.

Bug #5121.
2011-04-01 15:52:20 -07:00
Ben Pfaff
e34c9ddcc8 bridge: Drop obsolete comment.
It's quite clear that we don't support double tagging now.
2011-04-01 15:52:20 -07:00
Ben Pfaff
cbbb244d5f bridge: Improve comment. 2011-04-01 15:52:20 -07:00
Ben Pfaff
090f7f5048 bridge: Change Ethernet address array from 8 bytes to ETH_ADDR_LEN bytes.
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.
2011-04-01 15:52:20 -07:00
Ben Pfaff
79efe70efc bridge: Avoid redundant dpif_flow_flush().
ofproto_create() also calls dpif_flow_flush() very soon afterward.  This
seems more clearly in ofproto's domain anyhow.
2011-04-01 15:52:20 -07:00
Ben Pfaff
bb5bc6c042 lacp: Encapsulate configuration into new structs.
This makes it easier to pass configuration between modules.
2011-04-01 15:52:20 -07:00
Ben Pfaff
7a6735157c bridge: Drop LACP configuration members from struct iface and struct port.
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.
2011-04-01 15:52:20 -07:00
Ben Pfaff
5de1bb5cc9 packets: New function snap_compose(); rename compose_packet() for consistency.
The following commit will introduce the first use of snap_compose().
2011-04-01 15:52:19 -07:00
Ben Pfaff
9759479ab6 bridge: Convert svecs to ssets. 2011-03-31 16:42:01 -07:00
Ben Pfaff
81e2083fe6 ofproto: Change string sets in interface from svec to sset. 2011-03-31 16:42:01 -07:00