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
ee4dd8eb94 bridge: Fix typo in comment.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-11-20 14:17:05 -08:00
Simon Horman
7beaa082d7 vswitchd: Configuration of allowed OpenFlow versions
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>
2012-11-19 13:04:11 -08:00
Justin Pettit
bef071a5fd bridge: Always "up" internal devices.
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>
2012-11-16 12:35:55 -08:00
Justin Pettit
05ba03e000 bridge: Introduce iface_is_internal() function.
This will have an additional caller in the future.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
2012-11-16 12:35:55 -08:00
Justin Pettit
b4f4b737f9 bridge: Open internal ports with the correct type.
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>
2012-11-16 12:35:55 -08:00
Simon Horman
1d9ffc175a ofproto, connmgr: Parameterise OpenFlow versions for adding controller
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>
2012-11-12 09:44:23 -08:00
Ethan Jackson
b099cd5f55 bridge: Fix a segmentation fault in bridge_init_ofproto().
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>
2012-11-06 12:40:05 -08:00
Ben Pfaff
d02a5f8ea4 ofproto: Report 0 Mbps when speed not available instead of 100 Mbps.
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>
2012-11-03 18:00:39 -07:00
Justin Pettit
acf6085512 ofproto-dpif: Use a single underlying datapath across multiple bridges.
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>
2012-11-01 22:54:28 -07:00
Justin Pettit
11a574a737 ofproto: Add type "run", "run_fast", and "wait" provider methods.
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>
2012-11-01 22:54:27 -07:00
Justin Pettit
b0408fcacc ofproto: Add initialization function.
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>
2012-11-01 22:54:27 -07:00
Justin Pettit
81816a5fe8 Allow the OpenFlow port to be requested for a port.
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>
2012-11-01 22:54:27 -07:00
Ethan Jackson
b363bae4f8 cfm: Scope CFM packets to key zero.
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>
2012-10-14 19:36:38 -07:00
Ben Pfaff
9cac519599 ofproto: Fix typo in macro name.
I like the sound of "evicton" but it isn't a real word.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2012-10-12 13:18:41 -07:00
Ethan Jackson
8cdec72569 idl: Optionally warn when writing to read-write columns.
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>
2012-09-27 17:23:17 -07:00
Ethan Jackson
4104aaf1b8 bridge: Omit alerts on the cfm_remote_opstate column.
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>
2012-09-20 09:17:40 -07:00
Ethan Jackson
079b594227 vswitchd: Respect other_config:stp-enable port setting.
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>
2012-08-29 16:23:07 -07:00
Ethan Jackson
0faed34652 bridge: Deprecate the null interface type.
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>
2012-08-28 18:27:05 -07:00
Ansis Atteka
6019f12410 stp: port_no counter is off by one
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>
2012-08-21 17:08:05 -07:00
Ethan Jackson
353079d005 bridge: Write certain statistics to the database instantly.
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>
2012-08-15 15:01:38 -07:00
Ethan Jackson
1c0333b6ba cfm: Expose remote CFM opstate in the database.
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>
2012-08-13 12:49:15 -07:00
Ethan Jackson
edce886c92 bridge: Segfault when missing Open vSwitch table.
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>
2012-07-18 11:17:07 -07:00
Ben Pfaff
35a22d8c10 system-stats: Run as part of worker process.
The stats gathering can be time-consuming in some cases, so it's better to
do it in the worker process.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-18 10:59:52 -07:00
Ben Pfaff
57c8677b51 system-stats: Use "smap" instead of "shash".
"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>
2012-07-18 10:51:02 -07:00
Ethan Jackson
9dbc190c81 ovsdb-server, ovs-vswitchd: Log version after daemonize_complete().
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>
2012-07-17 09:55:39 -07:00
Ben Pfaff
e825ace22c ovs-vswitchd: Log datapath ID in a more user-friendly way.
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>
2012-07-05 15:23:36 -07:00
Ethan Jackson
6b803ddc8f bridge: Run fast when adding and deleting ports.
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>
2012-06-22 15:12:37 -07:00
Ethan Jackson
a699f6143e lib: Utilize smaps in the idl.
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>
2012-06-14 16:41:44 -07:00
Ethan Jackson
79f1cbe9f8 lib: New data structure - smap.
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>
2012-06-14 15:09:31 -07:00
Ethan Jackson
37344ffa58 bridge: Simplify VLAN splinter memory management.
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>
2012-06-14 13:25:37 -07:00
Ben Pfaff
0d08568461 Add support for tracking and logging daemon memory usage.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:32:05 -07:00
Ethan Jackson
046f1f89e6 bridge: Ignore "null" interfaces as required.
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>
2012-05-21 13:20:18 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
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>
2012-05-02 17:08:02 -07:00
Ben Pfaff
cc0864659f vswitchd: Clean up iface_create().
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>
2012-04-24 18:08:44 -07:00
Ben Pfaff
5344c1ac92 vswitchd: Make reconfiguration update port configuration again.
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>
2012-04-24 18:08:43 -07:00
Ben Pfaff
01546f5d07 vswitchd: Make iface_create() return an indication of success.
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>
2012-04-24 18:08:42 -07:00
Ben Pfaff
2a485ee87c vswitchd: Factor code to configure netdevs out of iface_create().
An upcoming patch will need the same code in another function.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-24 18:08:41 -07:00
Ben Pfaff
b54441b366 vswitchd: Refactor iface_refresh_type() into iface_get_type().
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>
2012-04-24 18:08:40 -07:00
Ben Pfaff
7f81a52a98 vswitchd: Drop 'need_refresh' member from struct iface.
It's no longer useful.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-24 18:08:39 -07:00
Ben Pfaff
8b5da7a613 vswitchd: Push ofproto_port declaration down to inner blocks.
Just a tiny code cleanup.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-24 18:08:38 -07:00
Ethan Jackson
93f331d30d bridge: Ignore null interfaces as required.
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>
2012-04-23 09:30:33 -07:00
Ben Pfaff
5167b8709e vswitchd: Report actual port number, not -1, in "added interface" message.
CC: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-24 11:06:44 -07:00
Ethan Jackson
bae7208e91 bridge: Refactor bridge_reconfigure().
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>
2012-04-23 03:07:59 -07:00
Ethan Jackson
f5787280d4 vswitchd: Remove unused 'tag' from 'struct iface'.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-04-23 03:07:42 -07:00
Ethan Jackson
b20a8f7c11 lacp: Remove heartbeat mode.
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>
2012-04-17 13:36:32 -07:00
Ethan Jackson
bf83f7c82f lacp: Remove custom transmission intervals.
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>
2012-04-17 13:36:32 -07:00
Ethan Jackson
cea1576889 vswitch: Use consistent representation of DSCP bits.
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>
2012-04-17 13:36:01 -07:00
Ethan Jackson
c7e7bb21ff bridge: Rate limit port creations and deletions.
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>
2012-04-11 13:46:04 -07:00
Ethan Jackson
7e041ba514 bridge: Rate limit default address warnings.
This information is typically not more useful if displayed more
often.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-04-11 13:01:47 -07:00
Ben Pfaff
854a94d9d2 ovsdb-idl: Simplify transaction retry.
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>
2012-04-12 08:19:01 -07:00