2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 21:07:47 +00:00

663 Commits

Author SHA1 Message Date
Ben Pfaff
0079481775 Merge 'master' into 'next'. 2011-05-12 12:05:42 -07:00
Ben Pfaff
8b05efc6b4 Remove unneeded #include directives. 2011-05-11 12:35:09 -07:00
Ben Pfaff
abe529af47 ofproto: Break apart into generic and hardware-specific parts.
In addition to the changes to ofproto, this commit changes all of the
instances of "struct flow" in the tree so that the "in_port" member is an
OpenFlow port number.  Previously, this member was an OpenFlow port number
in some cases and an ODP port number in other cases.
2011-05-11 12:35:09 -07:00
Ben Pfaff
f79e673f3d ofproto: Complete abstraction by adding enumeration and deletion functions.
This eliminates the final reference from bridge.c directly into the dpif
layer, which will make it easier to change the implementation of ofproto
to support other lower layers.
2011-05-11 12:26:08 -07:00
Ben Pfaff
892815f564 ofproto: Improve abstraction by using OpenFlow port numbers in interface.
Until now, ofproto has used a mix of datapath and OpenFlow port numbers in
its client interface.  This commit changes it to use OpenFlow port numbers
exclusively, to raise the level of abstraction.

Most of this commit boils down to simple search-and-replace with a few
call to ofp_port_to_odp_port() sprinkled in.  The addition of ofproto_port
is one exception.  An ofproto_port is almost the same as a dpif_port; the
difference is just that its port number is an OpenFlow port number instead
of a datapath port number.
2011-05-11 12:26:08 -07:00
Ben Pfaff
fa066f015f bridge: Move packet processing functionality into ofproto.
Until now, packet processing in ovs-vswitchd has been split between two
components: ofproto, for basic OpenFlow functionality, and bridge, for
OFPP_NORMAL processing.  This architecture will not work as Open vSwitch
starts to support a wider variety of underlying hardware, because it
imposes a model in which the bridge needs to be able to look at every
exact-match flow within a OpenFlow flow, which most hardware doesn't
support.

Therefore, this commit moves all of the packet processing code in
bridge into ofproto, as preparation for generalizing further.
2011-05-11 12:26:06 -07:00
Ben Pfaff
bf8f2167fd stream-ssl: Improve messages when configuring SSL if it is unsupported.
Previously, if --private-key or another option that requires SSL support
was used, but OVS was built without OpenSSL support, then OVS would fail
with an error message that the specified option was not supported.  This
confused users because it made them think that the option had been removed:
    http://openvswitch.org/pipermail/discuss/2011-April/005034.html

This commit improves the error message: OVS will now report that it was
built without SSL support.  This should be make the problem clear to users.

Reported-by: Aaron Rosen <arosen@clemson.edu>
Feature #5325.
2011-05-10 09:17:37 -07:00
Ethan Jackson
daa8bd2bf8 bridge: Don't configure QoS without Queues.
It doesn't make sense to create a QoS object without any queues.
Before this patch, OVS would configure the QoS object and as a
result drop all traffic going through the affected interface.  With
this patch, OVS will simply clear QoS configuration on the
interface.

Bug #5583.
2011-05-06 17:04:41 -07:00
Ethan Jackson
cc8d12f936 lacp: New "lacp-heartbeat" mode.
This commit creates a new heartbeat mode for LACP.  This mode
treats LACP as a protocol simply for monitoring link status.  It
strips out most of the sanity checks built into the protocol.
Addition of this mode makes "lacp-force-aggregatable" and
"lacp-strict" options obsolete so they are removed.
2011-05-06 13:48:41 -07:00
Ethan Jackson
632e2b95c9 bond: Create new "bond-stable-id".
Stable bonding mode needs an ID to guarantee consistent slave
selection decisions across ovs-vswitchd instances.  Before this
patch, we used the lacp-port-id for this purpose.  However, LACP
places restrictions on how lacp-port-ids can be allocated which may
be inconvenient.  This patch creates a special purpose
bond-stable-id other_config setting which allows users to tweak
this value directly.
2011-05-06 13:48:41 -07:00
Ben Pfaff
35c33856b4 ofproto: Rename ofproto_iface_*() functions to ofproto_port_*().
This makes ofproto use the term "port" consistently for a single
purpose (which is unfortunately different from the term "interface"
used in the OVS database, but at least it is now internally
consistent).
2011-05-04 10:20:42 -07:00
Ben Pfaff
66da9beffd bridge: Reorder configuration.
This loses the bridge_run_one() before iface_configure_cfm(), which means
that CFM configuration can now take two reconfigurations in a row.  That's
a regression that we had earlier, which had been fixed previously by commit
392730c42bb "bridge: Run once before configuring CFM".  It will, however,
be fixed again in a later commit.
2011-05-04 10:20:41 -07:00
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