2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-28 12:58:00 +00:00

663 Commits

Author SHA1 Message Date
Ansis Atteka
a65084987b vswitchd: Remove port from datapath if it becomes non-operational
If kernel module rejects config changes then vswitchd sets the ofport
column to -1, but does not remove the non-operational port from the
datapath. This patch fixes this problem.

ovs-vsctl add-br ovsbr
ovs-vsctl add-port ovsbr p1
ovs-vsctl add-port ovsbr p2
ovs-vsctl set Interface p1 options:remote_ip=2.1.1.1 options:key=123 type=gre
ovs-vsctl set Interface p2 options:remote_ip=1.1.1.1 options:key=123 type=gre
ovs-vsctl set Interface p2 options:remote_ip=2.1.1.1 options:key=123 type=gre
ovs-dpctl show #observe that p2 does not appear here anymore

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-04-09 10:19:42 -07:00
Mehak Mahajan
3967a833e4 Granular link health statistics for cfm.
The changes display the cfm_health of an interface.  The cfm_health
is an exponential weighted moving average of the health of all
remote_mpids.  The value can vary from 0 to 100, 100 being very healthy
and 0 being unhealthy.

Feature #10363
Requested-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-04-05 14:41:37 -07:00
Mehak Mahajan
222d3ba460 Revert "Granular link health statistics for cfm."
Missed commiting one line of change.
This reverts commit c75b7e39d973cc9f4869c84d48eeb3b66afb2971.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-04-05 14:40:52 -07:00
Mehak Mahajan
c75b7e39d9 Granular link health statistics for cfm.
The changes display the cfm_health of an interface.  The cfm_health
is an exponential weighted moving average of the health of all
remote_mpids.  The value can vary from 0 to 100, 100 being very healthy
and 0 being unhealthy.

Feature #10363
Requested-by: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-04-05 13:34:47 -07:00
Ben Pfaff
6e492d8145 Rearrange structures to better fit valgrind's memory leak heuristics.
valgrind's memory leak detector considers a pointer to the head of a memory
block to be "definitely" a pointer to that memory block but a pointer to
the interior of a memory block only "possibly" a pointer to that memory
block.  Open vSwitch hmap_node and list data structures can go anywhere
inside a structure; if they are in the middle of a structure then valgrind
considers pointers to them to be possible leaks.  Therefore, this commit
moves some of these from the middle of data structures to the head, to
reduce valgrind's uncertainty.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-28 14:55:27 -07:00
Ben Pfaff
eaa67ba8d5 Avoid possibly including an old vswitch-idl.h.
Codes that uses #include "vswitch-idl.h" can get an older version of this
header, because this header file moved from vswitchd/ to lib/ and the
older generated file might still be present.

This helps out two ways:

     * "make clean" will delete the generated files from their old
       locations.

     * Use #include "lib/vswitch-idl.h" to explicitly avoid including the
       files from their old locations.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-27 15:57:52 -07:00
Mehak Mahajan
f125905cdd Allow configuring DSCP on controller and manager connections.
The changes allow the user to specify a separate dscp value for the
controller connection and the manager connection. The value will take
effect on resetting the connections. If no value is specified a default
value of 192 is chosen for each of the connections.

Feature #10074
Requested-by: Rajiv Ramanathan <rramanathan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-03-23 18:13:08 -07:00
Pravin B Shelar
c1f15723c0 vswitchd: Do not refresh existing iface on new device addition.
There is no need to refresh status and stats for existing devices
if iface mtu is missing in ovs-db as missing MTU could just mean
error in last MTU read for that device.
So we can refresh stats for devices which are just created.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-23 14:14:24 -07:00
Ethan Jackson
f67f13545e idl: New helpers for accessing string maps.
This removes some boilerplate from the bridge.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-22 16:27:04 -07:00
Ethan Jackson
0acaddd05f bridge: Shorten long lines.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-22 11:28:58 -07:00
Pravin B Shelar
2c2ea5a88a netdev: Rename netdev->get_status() to netdev->get_drv_info().
get_status actually returns driver information, so get_drv_info()
is better name.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
2012-03-22 10:58:32 -07:00
Ethan Jackson
189cb9e468 cfm: Support random VLAN tag for CCM PDUs.
CCM PDUs may take a different path through the network depending on
the VLAN tag they carry.  In order to exercise these paths, it
may be advantageous to use a random VLAN tag.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-19 18:03:36 -07:00
Ethan Jackson
6e037e3ca6 idl: Move vswitch-idl to libopenvswitch.
This is cleaner then having multiple programs build the idl
independently.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-19 10:52:53 -07:00
Ben Pfaff
6c0386119d netdev: Abstract "features" interface away from OpenFlow 1.0.
netdev_get_features() and other functions have always used OpenFlow 1.0
"enum ofp_port_features" bits as part of their interface.  This commit
switches over to using an internally defined interface that is not tied
directly to any OpenFlow version, making evolution of each side of the
interface easier in the future.

Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-07 14:05:09 -08:00
Ben Pfaff
e56365a56e bridge: Remove unwanted ports at time of ofproto creation.
The reconfiguration code only deleted unwanted ports for bridges that had
been created in previous (re)configurations.  In fact, we should run this
step even for bridges that are newly added, e.g. to delete ports that
were added by a previous run of ovs-vswitchd and deleted from the database
between runs.

Before this commit, the following left "int" in datapath br0.  After this
commit, "int" is properly deleted:

1. With ovs-vswitchd running:
      # ovs-vsctl add-br br0
      # ovs-vsctl add-port br0 int -- set interface int type=internal
2. Kill ovs-vswitchd, then:
      # ovs-vsctl --no-wait -- del-port br0 int
3. Restart ovs-vswitchd.

Bug #9957.
Reported-by: Hiroshi Tanaka <htanaka@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-05 13:08:35 -08:00
Ben Pfaff
8bddb894d9 bridge: Drop log message when a QoS record lacks a default queue.
Apparently we're planning to use this configuration regularly at Nicira.

Bug #7413.
Requested-by: Bryan Fulton <bryan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-29 10:43:50 -08:00
Ethan Jackson
bde9f75de1 unixctl: New JSON RPC back-end.
The unixctl library had used the vde2 management protocol since the
early days of Open vSwitch.  As Open vSwitch has matured, several
Python daemons have been added to the code base which would benefit
from a unixctl implementations.  Instead of implementing the old
unixctl protocol in Python, this patch changes unixctl to use JSON
RPC for which we already have an implementation in both Python and
C.  Future patches will need to implement a unixctl library in
Python on top of JSON RPC.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-02-21 00:02:20 -08:00
Ben Pfaff
2c999774c1 vswitchd: Always configure a default queue for QoS.
When an interface has QoS configured but no default queue (queue 0), OVS
has until now installed that QoS configuration literally, which causes all
packets destined for this default queue to be dropped.  This behavior is
usually both unexpected and undesirable.

This commit changes behavior so that, when no default queue is configured,
OVS uses a default "empty" configuration for the default queue.  This
behavior should be more acceptable when QoS is slightly misconfigured.

I tested that, without this patch, configuring only queue 1 causes "tc
class show" to show only queue 1 (handle 1:2) for linux-htb and linux-hfsc,
and that with this patch it shows configurations for both queue 0 (handle
1:1) and queue 1.

Bug #5583.
Feature #7413.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-16 16:33:14 -08:00
Ben Pfaff
9886b6620e vswitchd: Add "enable-async-messages" setting for controllers.
An OpenFlow connection can start receiving asynchronous messages such as
"packet-ins" immediately at connect time.  If there is a lot of traffic on
the network then this can swamp the controller before it gets a chance to
set up an initial flow table.  This setting overrides this OpenFlow
behavior, changing it so that the connection initially enables no
asynchronous messages at all.  The controller can enable any messages that
it actually wants when it is ready for them.

Feature #7086.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-09 14:07:08 -08:00
Ethan Jackson
b93803967e cfm: Expose detailed fault status in the database.
The cfm_fault column of the database is the logical OR of a number
of reasons that CFM can be in a faulted state.  A controller may
want to have more specific information in which case it can look at
the cfm_fault_status column which this patch adds.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-02-08 21:26:29 -08:00
Ethan Jackson
a7aa2d3cab cfm: Support high priority CCM broadcasts.
Bug #9015.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-02-02 19:45:40 -08:00
Ben Pfaff
e764773ccb vswitchd: Make the MAC entry aging time configurable.
NICS-11.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-01 15:04:51 -08:00
Ben Pfaff
254750ceb2 Add support for limiting the number of flows in an OpenFlow flow table.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-02-01 14:15:17 -08:00
Ethan Jackson
bc1b010c2b bond: Allow users to disable rebalancing.
Bond rebalances come with a risk of packet reordering which some
users may find unacceptable.

Requested-by: Ben Basler <bbasler@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-30 13:04:41 -08:00
Ethan Jackson
fe4a02e4fa stp: Allow manual topology change events.
Users may want to force the network to flush its MAC tables by
manually triggering a topology change event due to some event in
the system.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-25 13:11:07 -08:00
Ethan Jackson
4df08875a5 bond: Change default bond_mode to active-backup.
As promised, post version 1.4 the default bond_mode is changing to
active-backup with this commit.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-16 18:14:56 -08:00
Ethan Jackson
a9bf011b82 lacp: Enforce valid lacp-system-id configuration.
With this patch, when a user attempts to configure LACP with an
invalid system ID, OVS will fail to create the bond and warn.
This behavior seems safer then defaulting to the bridge Ethernet
address which may surprise users.

Bug #8710.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-01-16 18:14:56 -08:00
Ben Pfaff
45c580a348 vswitchd: Also consider access port VLANs as "in use" for VLAN splinters.
It's natural to add an access port to a bridge and expect that trunk ports
will then immediately start to work properly with that VLAN without
additional configuration.  This change makes that happen.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-03 13:34:47 -08:00
Ansis Atteka
5bd3162068 vswitchd: fix "implicit declaration of function" build warning.
Included stream.h header file for connmgr.c and bridge.c files.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Reported-by: Ben Pfaff <blp@nicira.com>
2011-12-21 10:06:54 -08:00
Ansis Atteka
ac4c900d4b vswitchd: In-band rules for Controller are missing after executing force-reload-kmod command
In current implementation vswitchd adds Controller in-band rules only if
there is a route in kernel routing table that might route traffic to the
Controller. But, when executing force-reload-kmod command, network
configuration (e.g. assigned IP addresses, routes) are flushed away,
hence Controller in-band rules are not added.

This commit fixes this limitation and allows vswitchd to add Controller
in-band rules even if there are no routes in the kernel routing table.

Issue: #8625

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2011-12-19 17:54:13 -08:00
Ben Pfaff
0e15264f96 unixctl: Implement quoting.
The protocol used by ovs-appctl has a long-standing bug that there
is no way to distinguish "ovs-appctl a b c" from "ovs-appctl 'a b c'".
This isn't a big deal because none of the current commands really
want to accept arguments that include spaces, but it's kind of a silly
limitation.

At the same time, the internal API is awkward because every user is
stuck doing its own argument parsing, which is no fun.

This commit fixes both problems, by adding shell-like quoting to the
protocol and modifying the internal API from one that passes a string
to one that passes in an array of pre-parsed strings.  Command
implementations may now specify how many arguments they expect.  This
simplifies some command implementations significantly.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-19 14:53:34 -08:00
Ethan Jackson
4c57c3bcfc bond: Warn of imminent default bond_mode change.
Post version 1.4.*, we are planning to change the default bond_mode
from balance-slb to active-backup.  This commit warns users of the
change so that they can prepare.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2011-12-16 12:50:09 -08:00
Ben Pfaff
acaf148661 bridge: Enable support for access and native VLAN ports on bonds.
Since Open vSwitch's inception we've disabled the use of bonds as access
ports, for no particularly good reason.  This also unintentionally
prevented bonds from being used as native VLAN ports.

This commit removes the code that prevented using bonds these ways

Reported-and-tested-by: "Michael A. Collins" <mike.a.collins@ark-net.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-12 14:44:23 -08:00
Ben Pfaff
7c70698f01 bridge: Avoid use-after-free with VLAN splinters and multiple bridges.
The VLAN splinters feature uses a "pool" to track and free allocated
blocks.  There's only one pool, but the implementation was freeing all of
the blocks in it for every bridge during reconfiguration, not just once for
each reconfiguration, so caused a use-after-free when there was more than
one bridge and a bridge other than the last one in the list of bridges had
a VLAN splinter port.

Bug #8671.
Reported-by: Michael Mao <mmao@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2011-12-09 20:47:27 -08:00
Ethan Jackson
69fdadb1a9 lacp: Require non-zero system ID.
It's a bug if LACP is configured with a system ID of zero.  This
patch assert fails in this case.
2011-11-30 14:52:00 -08:00
Ethan Jackson
e567943d3b bridge: Honor lacp-system-id other_config setting.
The bridge code was completely ignoring the lacp-system-id setting.

Future patches will add tests which would have caught this issue.

Bug #8516.
2011-11-30 13:44:08 -08:00
Ben Pfaff
f145afdc20 bridge: Configure datapath ID earlier.
The design intent is for LACP ports to use the datapath ID as the default
system ID when none is specifically configured.  However, the datapath ID
is not available that early.  This commit makes it available earlier.

This commit does not fix another bug that prevents the LACP system ID from
being set properly (nothing sets it at all, in fact, so it always uses 0).

Build and unit tested only.
2011-11-30 13:25:36 -08:00
Ethan Jackson
4bee05c217 bridge: Remove redundant newline. 2011-11-30 11:20:52 -08:00
Ben Pfaff
5fcc0d004a ofproto: Add "fast path".
The key to getting good performance on the netperf CRR test seems to be to
handle the first packet of each new flow as quickly as possible.  Until
now, we've only had one opportunity to do that on each trip through the
main poll loop.  One way to improve would be to make that poll loop
circulate more quickly.  My experiments show, however, that even just
commenting out the slower parts of the poll loop yield minimal improvement.

This commit takes another approach.  Instead of making the poll loop
overall faster, it invokes the performance-critical parts of it more than
once during each poll loop.

My measurements show that this commit improves netperf CRR performance by
24% versus the previous commit, for an overall improvement of 87% versus
the baseline just before the commit that removed the poll_fd_woke().  With
this commit, ovs-benchmark performance has also improved by 13% overall
since that baseline.
2011-11-28 10:35:15 -08:00
Justin Pettit
9d24de3bca ovs-vswitchd: Track packet and byte statistics sent on mirrors.
This commit adds support for tracking the number of packets and bytes
sent through a mirror.  The numbers are kept in the new "statistics"
column on the mirror table in the "tx_packets" and "tx_bytes" keys.
2011-11-23 23:22:53 -08:00
Ben Pfaff
52a90c29ab Implement new "VLAN splinters" feature.
The "VLAN splinters" feature works around buggy device drivers in old Linux
versions.

This feature is deprecated.  When broken device drivers are no longer in
widespread use, we will delete this feature.

I tested earlier versions of this commit, but I have not tested this
version.

See ovs-vswitchd.conf.db(5) for more information.
2011-11-23 17:03:31 -08:00
Ben Pfaff
03eae5f86c vswitchd: Remove special case for VLAN devices.
We introduced this special case before the XenServer integration was
complete.  At that point, we were using VLAN devices on XenServer, with a
separate bridge for each VLAN, so we needed this special case.  But no
version of OVS for any supported XenServer version uses VLAN devices this
way, so we can delete the special case.
2011-11-23 13:19:53 -08:00
Ben Pfaff
a70e4b2a0a bridge: Fix incorrect comments. 2011-11-23 13:19:53 -08:00
Ben Pfaff
5490f250fd bridge: Avoid reading other_config columns with ovsdb_idl_get().
ovsdb_idl_get() doesn't work with synthetic records.  Upcoming commits
will start synthesizing more ports and interfaces, so we should avoid
using ovsdb_idl_get().

In the long term it's probably a good idea to come up with a better way
to do synthetic database records, one that causes less trouble.

Bug #8457.
2011-11-23 13:17:38 -08:00
Ethan Jackson
8b36f51e0f vswitch: Implement dscp column of the Queue table.
The dscp column of the queue table instructs Open vSwitch to mark
all traffic egressing the queue with the given DSCP bits in its tos
field.

Bug #7046.
2011-11-23 12:06:54 -08:00
Ben Pfaff
5e9ceccdb6 Implement a new port setting "other-config:priority-tags".
Linux hosts (and probably others) tend to ignore priority-tagged frames, so
this new setting allows Open vSwitch to suppress sending them.

Reported-by: Michael Mao <mmao@nicira.com>
Bug #8320.
2011-11-17 17:11:53 -08:00
Justin Pettit
80740385d2 stp: Track BPDU tx and rx counts.
When debugging spanning tree, it's useful to have counters about how
many BPDUs have been sent and received.  This commit keeps track of
these counters and stores them in a new "statistics" column of the Port
table.

Feature #8103
2011-11-15 09:29:08 -08:00
Ethan Jackson
75a4ead16d cfm: Support tagged CCM PDUs.
This patch also causes eth_compose() to set the l2 and l3 pointers
of the packets which it modifies.
2011-11-03 14:01:33 -07:00
Ethan Jackson
06b592bcbe vswitch: Don't update STP on synthetic ports.
This can cause ovs-vswitchd to crash.

Bug #8007.
Reported-by: Krishna Miriyala <krishna@nicira.com>
2011-10-26 11:50:56 -07:00
Justin Pettit
21f7563cef ovs-vswitchd: Add support for 802.1D STP.
Still alpha quality, since only tested for interoperability with Linux
bridge's STP implementation.
2011-10-22 16:16:08 -07:00