2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-15 14:17:18 +00:00
Commit Graph

379 Commits

Author SHA1 Message Date
Ben Pfaff
3fe8050596 bridge: Enable system stats only if turned on in the database.
Most hypervisors have no use for this column, so populating it just wastes
CPU time.  It can still be enabled explicitly via other-config.

CC: Peter Balland <peter@nicira.com>
CC: David Tsai <dtsai@nicira.com>
Bug #5961.
NIC-397.
2011-06-21 13:02:28 -07:00
Ben Pfaff
ba489aa7a5 bridge: Avoid duplicate logging when netdev_get_etheraddr() fails.
get_etheraddr() in netdev-linux.c logs when the Ethernet address cannot be
obtained so there is no need to log again in the caller.

Bug #5844.
2011-06-17 13:38:31 -07:00
Ben Pfaff
4e51de4c40 bridge: Fix memory leak in port_configure(). 2011-06-07 13:21:26 -07:00
Ben Pfaff
98dbe2dded bridge: Avoid "cast increases required alignment of target type" warning.
This pointer arithmetic caused a warning on sparc.  One alternative would
be to add a cast through "void *", but it seems at least as reasonable to
just use a few macros to do direct assignments.
2011-05-26 09:03:05 -07:00
Ethan Jackson
48e1b7fb9b bridge: Interface may be configured with incorrect QoS.
Bug #5739.
2011-05-25 13:23:49 -07:00
Ethan Jackson
6f629657fe cfm: Require 'name' field for 'cfm' objects.
This commit also fixes a memory leak upon cfm_destroy() and
converts the 'all_cfms' list to a hash map.
2011-05-24 15:25:53 -07:00
Ethan Jackson
a56104575c cfm: Cleanup CFM module interface.
This patch makes the CFM module interface a bit more like the LACP
module interface.  In my opinion it's much cleaner.
2011-05-20 15:53:29 -07:00
Ethan Jackson
93b8df3853 cfm: Remove Maintenance_Point and Monitor tables.
In an effort to make CFM easier to understand and configure, this
patch removes the Maintenance_Point and Monitor tables from the
database.  As a consequence, users will only be able to configure
one remote maintenance point.  Furthermore, before this patch each
remote maintenance point maintained its own separate fault flag in
the database.  This flag is no longer reported, users will need to
infer the fault status from the global CFM fault flag.
2011-05-20 15:53:29 -07:00
Ethan Jackson
84c5d450aa cfm: No longer allow configuration of ma_name and md_name.
These settings added complexity to the database and CFM module
interface with negligible benefit.  This patch removes them in such
a way that they can easily be re-added in the (unlikely) event that
we need them in the future.
2011-05-20 15:53:29 -07:00
Ethan Jackson
9ac3fce4d5 cfm: Migrate cfm/show unixctl command to CFM module.
This patch moves the cfm/show unixctl show command from the bridge
to the CFM module.  This is more in line with how LACP does it, and
will make future patches easier to implement.
2011-05-20 15:53:28 -07:00
Ethan Jackson
1670c579a8 netdev: Take responsibility for polling MII registers.
This patch moves miimon logic from the bond module to netdev-linux.
This greatly simplifies the bonding code while adding minimal
complexity to netdev-linux.  The bonding code is so high level, it
really has no business worrying about how precisely slave status is
determined.
2011-05-20 12:55:36 -07:00
Ben Pfaff
b2fda3effc Merge 'next' into 'master'.
I know already that this breaks the statsfixes that were implemented by the
following commits:

827ab71c97 "ofproto: Datapath statistics accounted twice."
6f1435fc8f "ofproto: Resubmit statistics improperly account during..."

These were already broken in a previous merge.  I will work on a fix.
2011-05-18 14:01:13 -07:00
Ben Pfaff
2e28176147 bridge: Fill in ofport column of Interface records.
This was lost in the transition to the "next" branch.
2011-05-18 09:16:00 -07:00
Ben Pfaff
a7d7906945 bridge: Avoid double-free of bond fake ifaces.
Found by valgrind.
2011-05-16 13:03:49 -07:00
Ben Pfaff
76ed83fc3f bridge: Fix uninitialized bond_stable_ids in port_configure_bond().
The recent merge of "master" added a new bond_stable_ids member to
struct ofproto_bundle_settings, but neglected to initialize it.  This fixes
the problem.

Found and verified using valgrind.
2011-05-13 16:47:01 -07:00
Ben Pfaff
e3f55cb8b2 bridge: Keep default Ethernet address stable between runs.
In some circumstances the bridge can't find a stable physical Ethernet
address to use, so until now it has just picked a random Ethernet address.
In these circumstances, therefore, the bridge Ethernet address would change
from one ovs-vswitchd run to another.  But OVS does have a stable
identifier for a bridge: its UUID.  This commit changes to use that as the
default bridge Ethernet address.

The datapath ID is sometimes derived from the bridge Ethernet address, so
this change also makes the bridge Ethernet address more stable.

CC: Natasha Gude <natasha@nicira.com>
Bug #5594.
2011-05-12 13:26:57 -07:00
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
392730c42b "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