Versions may be configured using the protocols column of
the bridge table. The protocols column is a set which accepts zero
or more of the values: 'OpenFlow10' and 'OpenFlow12'.
If the protocols column is empty, then OpenFlow10 is used.
This default is consistent with the behaviour of ovs-vswtichd
prior to this patch.
Signed-off-by: Simon Horman <horms@verge.net.au>
[blp@nicira.com adjusted comments and documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
The kernel datapath automatically "up"s internal devices, but this
wasn't happening for the userspace datapath. This change has the bridge
module always "up" them.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Use the new ofproto function that returns how a port should be opened
based on the datapath type. This fixes a problem with internal ports
being attached to userspace datapaths.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Allow allowed Open Flow versions to be passed rather
than relying on hard-coded defaults.
This is in preparation for allowing configuration of the
allowed OpenFlow versions.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
When the database is initially created there may no be rows in the
Open_vSwitch table. In this case, the ovsrec_open_vswitch passed
to bridge_init_ofproto() is NULL and causes a segmentation fault.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
When a link is down, or when a link has no speed because it is not a
physical interface, Open vSwitch previously reported that its rate is 100
Mbps as a default. This is counterintuitive, however, so this commit
changes Open vSwitch behavior to report 0 Mbps when a link is down or its
speed is otherwise unavailable.
Bug #13388.
Reported-by: Hiroshi Tanaka <htanaka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit switches to using a single backing datapath (called
"ovs-datapath") for all bridges of that datapath's type. Previously,
resources couldn't be shared across bridges, since each was in its own
datapath. This change will allow sharing of tunnels and cheaper patch
ports to be added in the future.
Since bridges share a common datapath, the ovs-dpctl commands won't
provide bridge-specific information. Users wishing to have that
information should use the new "ovs-appctl dpif/*" commands as
documented in ovs-vswitchd(8).
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Add the ability for ofproto providers to have top-level "run",
"run_fast", and "wait" methods, similar to the current ofproto ones.
There are no current users, but this will be useful in a future commit.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
A future commit will make all bridges of a particular dpif share a
single backing datapath. In order to handle restart, the datapath will
need to have some idea of what the initial state looks like. Otherwise,
it won't know which ports belong to which bridges and orphaned ports may
never be cleaned up.
This commit introduces an initialization method to ofproto, which takes
as an argument a high-level description of the bridges and ports. An
ofproto provider can then use this information to initialize its state.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
A new "ofport_request" column makes it possible to request the OpenFlow
port number when adding a port.
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Before this patch, when a tunnel is configured with key=flow, CFM
didn't verify that incoming packets had the appropriate key of
zero. This could cause the CFM module to consume packets which
weren't actually intended for it.
Bug #13542.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
ovs-vswitchd should only write to write-only columns. Furthermore,
writing to a column which is not write-only can cause serious
performance degradations. This patch causes ovs-vswitchd to log
and reject writes to read-write columns.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
This column should be write only, otherwise every call to update it
has to make a trip to the database. Since this column is updated
every time through the run loop as part of refresh_instant_stats(),
this patch fixes a significant performance degradation.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Commit a699f614 (lib: Utilize smaps in the idl.) broke the
other_config:stp-enable port setting in two ways. First, it
changed the default if the setting was missing to disabled.
Second, if the setting was present, it did the opposite of what the
user configured.
Bug #13122.
Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
It's not entirely clear what problem the null interface type is
trying to solve, nor how it could be of use to any controller.
This patch deprecates it, and schedules its removal for February
2013. If there are concerns, please email dev@openvswitch.org.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
This counter was off by one, because port_num
should be less than STP_MAX_PORTS.
This caused an assert hit later in stp_get_port().
Issue: 13059
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Traditionally the bridge has written interface and port statistics
to the database in a rate limited fashion. This makes a lot of
sense for statistics which are either constantly changing, or are
expensive to collect. However, some statistics were rate limited
which have neither of these properties. Furthermore some of these
statistics (most notably carrier) could be very useful to a
controller if updated promptly.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
A controller may want to know the remote CFM opstate of a given CFM
enabled interface. This patch makes this data available in the
database.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
The enable_system_stats() function calls smap_get_bool() on the
ovsrec_open_vswitch passed to it. This was segmentation faulting
when 'null_cfg' defined in bridge_reconfigure() was used because
there was no Open vSwitch table.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
"smap" is now the appropriate data structure for a string-to-string map.
Also changes ovsdb_datum_from_shash() into ovsdb_datum_from_smap() since
system-stats related code was the only client.
Signed-off-by: Ben Pfaff <blp@nicira.com>
This fixes unit tests, and generally seems more correct.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
[blp@nicira.com added the change to ovs-vswitchd]
Signed-off-by: Ben Pfaff <blp@nicira.com>
The layering between ofproto and ovs-vswitchd caused the datapath ID to be
logged in a needlessly confusing way. First, ofproto would log its
default datapath ID:
using datapath ID 0000505400000004
then the bridge code would immediately determine the datapath ID that it
wanted and call ofproto_set_datapath_id(), which would log the change
datapath ID changed to 0000111122223333
This commit stops logging the default datapath ID, which is never actually
visible in OpenFlow. This should make the log files easier to understand.
Bug #12164.
Reported-by: Jacob Cherkas <jcherkas@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Adding and deleting ports can be extremely expensive so it makes
sense to get important work done before and after doing it.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
String to string maps are used all over the Open vSwitch database.
Before this patch, they were implemented in the idl as parallel
string arrays. This strategy has proven a bit cumbersome. With
this patch, string to string maps are implemented using the smap
library.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
A smap is a string to string hash map. It has a cleaner interface
than shash's which were traditionally used for the same purpose.
This patch implements the data structure, and changes netdev and
its providers to use it.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Before this patch, the VLAN splinter memory management operated on
blocks of memory instead of ovsrec_ports. This strategy is
problematic in future patches when more than simply calling
'free()' needs to be done to destroy splinter ports. This patch
solves the problem by keeping track of entire ovsrec_ports instead
of just the memory allocated to create them.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Commit bae7208e91a0 (bridge: Refactor bridge_reconfigure().)
introduced a regression in which the switch would attempt to
instantiate "null" interfaces in the datapath. This would, of
course, fail and trigger a warning. Though harmless, these
warnings confused users.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.
Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
iface_create() did its work in an order that meant it had to do a lot more
cleanup on error paths than is otherwise needed. This commit reorders the
work to avoid this extra cleanup.
bridge_ofproto_port_del() is no longer used after the refactoring so this
commit deletes it.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Commit bae7208e91a0 (bridge: Refactor bridge_reconfigure().) introduced
a regression in bridge reconfiguration. Previously, reconfiguration would
update the configuration of each bridge port, so that if the controller
(or the admin) changed a port's options, then that change would propagate
to the datapath. Following that commit, that no longer happened.
This commit restores that feature.
Bug #10972.
Reported-by: Michael Hu <mhu@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This is the minimal change that gets the job done. There are much nicer
ways to do this, but I'll leave that refactoring for later in the series.
The return value will have its first user in an upcoming commit.
Signed-off-by: Ben Pfaff <blp@nicira.com>
The calculation that this function does will need to be used in a
context where no "struct iface" is available in an upcoming commit.
Signed-off-by: Ben Pfaff <blp@nicira.com>
This issue has been around for quite some time. It doesn't really
cause problems beyond some spurious warnings.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
The existing bridge_reconfigure() implementation is suboptimal.
When adding lots of new ports, on every pass through the run loop
it allocates a bunch of "struct iface"s and "struct port"s, only to
destroy them when out of time. Additionally, when there are errors
adding or deleting ports, it can fail to converge. Instead it will
attempt and fail to add the same set of ports forever.
This patch rewrites bridge_reconfigure() using a new strategy.
Whenever the database changes, some initial bookkeeping is done,
and a list of future work is compiled. The bridge begins whittling
down this list, and stops processing database changes until
finished.
Bug #10902.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
The LACP heartbeat mode was used to monitor interfaces for
connectivity. It turns out that LACP is inferior to CFM for this
purpose. For the sake of simplicity this patch removes the
feature.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Open vSwitch allowed users to set a custom LACP PDU transmission
interval. This turned out to be an ill conceived idea which was
more confusing than useful. This patch reverts Open vSwitch to the
behavior supported in the LACP specification: two transmission
intervals, fast and slow.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
There are two sensible ways to represent the 6 DSCP bits of an IP
packet. One could represent them as an integer in the range 0 to
63. Or one could represent them as they would appear in the tos
field (0 to 63) << 2. Before this patch, OVS had used the former
method for the DSCP bits in the Queue Table, and the latter for the
DSCP in the Controller and Manager tables. Since the ability to
set DSCP bits in the Controller and Manager tables is so new that
it hasn't been released yet, this patch changes it to use the
existing style employed in the Queue table. Hopefully this should
make the code and configuration less confusing.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
In some datapaths, adding or deleting OpenFlow ports can take quite
a bit of time. If there are lots of OpenFlow ports which needed to
be added in a run loop, this can cause Open vSwitch to lock up and
stop setting up flows while trying to catch up. This patch lessons
the severity of the problem by only doing a few OpenFlow port adds
or deletions per run loop allowing other work to be done in
between.
Bug #10672.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Originally the IDL transaction state machine had a return value
TXN_TRY_AGAIN to signal the client to wait for a change in the database and
then retry its transaction. However, this logic was incomplete, because
it was possible for the database to change before the reply to the
transaction RPC was received, in which case the client would wait for a
further change. Commit 4fdfe5ccf84c (ovsdb-idl: Prevent occasional hang
when multiple database clients race.) fixed the problem by breaking
TXN_TRY_AGAIN into two status codes, TXN_AGAIN_WAIT that meant to wait for
a further change and TXN_AGAIN_NOW that meant that a change had already
occurred so try again immediately.
This is correct enough, but it is more complicated than necessary. It is
simpler and just as correct to use a single "try again" status that
requires the client to wait for a change relative to the database contents
*before* the transaction was committed. This commit makes that change.
It also changes ovsdb_idl_run()'s return type from bool to void because
its return type is hardly useful anymore.
Signed-off-by: Ben Pfaff <blp@nicira.com>