2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

1135 Commits

Author SHA1 Message Date
Justin Pettit
2702241699 ofproto-dpif: Add ovs-appctl commands for ovs-dpctl functions.
These commands will be useful in a future commit that makes multiple
bridges share a single backing datapath.  The ovs-dpctl commands will
show information about the backing datapath, so it will be difficult to
determine which information belongs to which bridge.  The new "dpif/*"
ovs-appctl commands return information about the bridge--regardless of
how the backing datapath is configured.

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
Ansis Atteka
85340733d7 netdev-vport: Warn users that pmtud is deprecated
This is a complementary patch to the other one I sent out previously.
The purpose of it is to make it more obvious that tunnel pmtud is
deprecated and will be removed soon.

Requested-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-10-30 12:34:51 +02:00
Ansis Atteka
85b53b3110 netdev-vport: Disable Path MTU Discovery by default
In near future we will switch to the flow-based tunneling and drop path
MTU discovery support. This patch prepares for that by changing the default
PMTUD value from 'enabled' to 'disabled'.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
2012-10-26 21:35:38 +03: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
361906b1e2 config: Add explicit support for building on ESX.
The ESX userspace looks quite a bit like linux, but has some key
differences which need to be specially handled in the build.  To
distinguish between ESX and systems which use the linux datapath
module, this patch adds two new macros "ESX" and "LINUX_DATAPATH".
It uses these macros to disable building code on ESX which only
applies to a true Linux environment.  In addition, it adds a new
route-table-stub implementation which is required for the build to
complete successfully on ESX.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-10-09 15:23:47 -07:00
Pravin B Shelar
2de795adb9 datapath: 64-bit GRE support
Extend GRE to have a 64-bit key. Use GRE sequence number to
store upper 32-bits of the key, but this is not standard way of
using GRE sequence number.

Bug #13186
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2012-10-05 17:55:02 -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
Ethan Jackson
f6af6c0e1c bond: Deprecate stable bonds.
The stable bond mode is an obsolete attempt to replicate the
functionality contained in the bundle action.  They are ugly and of
questionable usefulness.  This patch deprecates them and schedules
their 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
1e95906159 bonding: Update bonding documentation in INTERNALS.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-08-17 16:18:04 -07:00
Ben Pfaff
b62ee96f07 vswitch.xml: balance-tcp can be rebalanced too.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-16 16:21:03 -07:00
Ben Pfaff
1c1440518a vswitch.xml: Generalize "carrier" to cover miimon also.
I believe that saying "carrier" here excludes the miimon case, which we'd
like to include also.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-16 16:21:03 -07:00
Ben Pfaff
629d868ce7 vswitch.xml: Document that active-backup works OK with multiple switches.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-16 16:21:02 -07:00
Ben Pfaff
d64e1870f4 vswitch.xml: active-backup and balance-slb bonds must be one-sided.
It doesn't work to hook up an active-backup bond on one switch to an
active-backup bond on another switch, because they might pick different
active interfaces and therefore not pass any traffic.

The same is true of balance-slb because multicast and broadcast
traffic is dropped on ingress to any interface other than the active
interface.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-08-16 16:21:02 -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
Ben Pfaff
7d48a4cca4 packets: First-hop router redundancy protocol MAC addresses are not BPDUs.
Commit c93f9a78c349 (packets: Update the reserved protocols list.) added
a number of first-hop router redundancy protocol MAC addresses to the
list of BPDU MAC addresses.  This means that packets destined to those MAC
addresses are dropped when other-config:forward-bpdu is set to false on a
bridge (the default setting).

However, this behavior is incorrect, because these MAC addresses are not
special in the way that, say, STP frames are special.  STP is a
switch-to-switch protocol that end hosts have no use for, but end hosts do
speak directly to routers on the MAC addresses assigned by VRRP and the
other protocols in this category.  Therefore, dropping packets in this
category means that end hosts can no longer talk to their first-hop router,
if that router is running one of these protocols.

This commit also refines the match used for EDP and EAPS, and adds Cisco
CFM to the protocols that are dropped.

After this commit, the following destination MACs are dropped:

    - 01:08:c2:00:00:00
    - 01:08:c2:00:00:01
    - 01:08:c2:00:00:02
    - 01:08:c2:00:00:03
    - 01:08:c2:00:00:04
    - 01:08:c2:00:00:05
    - 01:08:c2:00:00:06
    - 01:08:c2:00:00:07
    - 01:08:c2:00:00:08
    - 01:08:c2:00:00:09
    - 01:08:c2:00:00:0a
    - 01:08:c2:00:00:0b
    - 01:08:c2:00:00:0c
    - 01:08:c2:00:00:0d
    - 01:08:c2:00:00:0e
    - 01:08:c2:00:00:0f

    - 00:e0:2b:00:00:00
    - 00:e0:2b:00:00:04
    - 00:e0:2b:00:00:06

    - 01:00:0c:00:00:00
    - 01:00:0c:cc:cc:cc
    - 01:00:0c:cc:cc:cd
    - 01:00:0c💿cd:cd

    - 01:00:0c:cc:cc:c0
    - 01:00:0c:cc:cc:c1
    - 01:00:0c:cc:cc:c2
    - 01:00:0c:cc:cc:c3
    - 01:00:0c:cc:cc:c4
    - 01:00:0c:cc:cc:c5
    - 01:00:0c:cc:cc:c6
    - 01:00:0c:cc:cc:c7

Bug #12618.
CC: Ben Basler <bbasler@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-26 16:29:30 -07:00
Ben Pfaff
7792bfe075 vswitch.xml: Fix typo in documentation.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-23 10:31:40 -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
Ben Pfaff
70e4e586e4 worker: New library for breaking a daemon into multiple processes.
ovs-vswitchd is effectively a "soft real-time" process, because flows that
do not get set up quickly lead to packet loss or retransmission.  We've
done our best to keep it from blocking unnecessarily, but some operations
unavoidably block.  This new library allows a daemon to break itself up
into a main process and a worker process, connected by an RPC channel,
with the idea being that the main process will delegate any possibly
blocking operations to the worker.

This commit also modifies ovs-vswitchd to start a worker process, but it
does not actually introduce any uses for the worker process.  Upcoming
commits will add those.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-18 10:30:49 -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
Ethan Jackson
a890678229 userspace: Log version on startup.
It's convenient to have the OVS version directly in the logs so one
doesn't have to go digging through ovs-bugtool output to find it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-07-16 22:28:07 -07:00
Ben Pfaff
149ff68ac9 memory: Document the memory/show unixctl command.
Suggested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-13 10:25:27 -07:00
Ethan Jackson
fd0ca62bb1 cfm: Remove sequence fault reason.
Commit 2b540ecb (Added handling of previously ignored cfm faults.)
made the CFM code trigger a fault when a packet is received with an
out of order sequence number.  This means that if even one CFM
probe is dropped, a fault will be triggered because the next
received probe's sequence would be two greater than the last.  This
is in conflict with the 802.1ag requirement that 3.5 dropped probes
triggers fault.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-07-09 19:01: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
Ben Pfaff
ff459dd649 ovs-brcompatd: Fix sending replies to kernel requests.
Commit 7d7447 (netlink: Postpone choosing sequence numbers until send
time.) broke ovs-brcompatd because it prevented userspace replies to
kernel requests from using the correct sequence numbers.  This commit fixes
it.

Atzm Watanabe found the root cause and provided an alternative patch to
avoid the problem.

Reported-by: André Ruß <andre.russ@hybris.com>
Reported-by: Atzm Watanabe <atzm@stratosphere.co.jp>
Tested-by: Atzm Watanabe <atzm@stratosphere.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-07-05 08:41:03 -07:00
Ben Pfaff
908ff19af7 ovs-vswitchd: Call mlockall() from the daemon, not the parent or monitor.
mlockall(2) says:

       Memory  locks  are not inherited by a child created via fork(2) and are
       automatically removed  (unlocked)  during  an  execve(2)  or  when  the
       process terminates.

which means that --mlockall was ineffective in combination with --detach
or --monitor or both.  Both are used in the most common production
configuration of Open vSwitch, so this means that --mlockall has never been
effective in production.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-29 15:43:46 -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
Mehak Mahajan
0442efd9b1 Reapplying the dscp changes: No need to restart DB/OVS on changing dscp value.
This patch reapplies the changes that were reverted with the commit 59efa47
(Revert DSCP update changes.). It also addresses the problem introduced by
the original commits, cd8fca2 ((jsonrpc: Correctly setting the dscp value
before reconnect.) and b2e18d (No need to restart DB / OVS on changing
dscp value.), that caused numerous unit test failures on some systems (as
diagnosed by valgrind).
With this change there is no need to restart the DB or OVS on configuring a
different value for the manager or controller connection respectively. On
detecting a change in the dscp value on the socket, the previous socket is
closed and a new socket is created and connection is established with the new
configured dscp value.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-06-21 12:22:42 -07:00
Ben Pfaff
59efa47adf Revert DSCP update changes.
This reverts commit cd8fca2ba0a7d036da069a4484d501bdc7a6f611 (jsonrpc:
Correctly setting the dscp value before reconnect.) and commit
b2e18db292cd4962af3248f11e9f17e6eaf9c033 (No need to restart DB / OVS on
changing dscp value.), which on some systems causes numerous unit test
failures that valgrind diagnoses as:

Conditional jump or move depends on uninitialised value(s)
   at 0x805F63F: jsonrpc_session_set_dscp (jsonrpc.c:1061)
   by 0x804F45D: ovsdb_jsonrpc_server_set_remotes (jsonrpc-server.c:417)
   by 0x804B775: reconfigure_from_db (ovsdb-server.c:656)
   by 0x804C231: main (ovsdb-server.c:159)

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-06-20 09:59:09 -07:00
Mehak Mahajan
b2e18db292 No need to restart DB / OVS on changing dscp value.
With this change there is no need to restart the DB or OVS on configuring a
different value for the manager or controller connection respectively. On
detecting a change in the dscp value on the socket, the previous socket is
closed and a new socket is created and connection is established with the new
configured dscp value.

Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-06-09 09:27:53 -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
Ethan Jackson
38f7147c3e packets: Use RARPs for learning packets.
Traditionally Open vSwitch had used 802.2 SNAP packets to update
upstream switch learning tables when necessary.  This approach had
advantages in that debugging information could be embedded in the
packet helping hapless admins figure out what's going on.  However,
since both qemu and VMware use RARP for this purpose, it seems
appropriate to fall in line with the defacto standard.

Requested-by: Ben Basler <bbasler@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-07 17:25:30 -07:00
Ethan Jackson
c93f9a78c3 packets: Update the reserved protocols list.
The protocols added in this patch should be considered "reserved"
and not forward when "forward-bpdu" is false, nor should they be
mirrored.

Bug #11755.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-06 18:22:53 -07:00
Ethan Jackson
05be4e2c6a packets: Generalize reserved RSPAN protocols.
Open vSwitch refuses to mirror certain destination addresses in
addition to those classified by eth_addr_is_reserved().  Looking
through the uses of eth_addr_is_reserved(), one finds that no
callers should be using the additional addresses which mirroring
drops.  This patch folds the additional addresses dropped in the
mirroring code, into the more general eth_addr_is_reserverd()
function.

This patch also changes the implementation in a way that is
slightly less efficient, but much easier to read and extend int he
future.

Bug #11755.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-06-06 17:43:33 -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
Ben Pfaff
ea523221d4 vlog: Take advantage of relaxed "-v" syntax through the tree.
The vlog manpage implies that writing ANY explicitly is obsolete, but
examples elsewhere in the documentation and code still tend to add it.
This removes them.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-22 10:17:06 -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
Pravin B Shelar
749ae95042 datapath: Fix Tunnel options TOS
Use DSCP bits from ToS set on tunnel.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>

Bug #8822
2012-05-21 12:18:50 -07:00
Ben Pfaff
aed2db181b vswitch.xml: Describe current default fail_mode.
We are thinking about changing the default, so this leaves that open
for the future.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-16 12:36:23 -07:00