2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 22:05:19 +00:00
Commit Graph

1727 Commits

Author SHA1 Message Date
Ben Pfaff
e94b92baf6 ovs-ofctl: Fix return value of str_to_port_no().
The index into the array of ports returned in the OFPT_FEATURES_REPLY
message is not necessarily the same as the port number, so this fixes a
real bug.
2010-11-17 09:21:09 -08:00
Ben Pfaff
b8fa71021e ovs-vsctl: Make waiting for ovs-vswitchd to reload work again.
Bug introduced in commit e5e12280e "ovs-vsctl: Replicate only tables and
columns that are actually needed."

Reported-by: Paul Ingram <paul@nicira.com>
2010-11-16 12:23:12 -08:00
Ben Pfaff
e5e12280e1 ovs-vsctl: Replicate only tables and columns that are actually needed.
Until now, ovs-vsctl has always fetched a complete replica of the Open
vSwitch database at startup time.  This is a little expensive, but that is
not normally a problem because the database is small.   However, it can
cause problems when Open vSwitch is partially upgraded: if ovs-vsctl is
upgraded before the database, and new columns or tables were added to the
database schema in the newer version of Open vSwitch, then ovs-vsctl will
report an error and fail to work, because it cannot monitor the new
columns.  The same problem occurs if the database is upgraded before
ovs-vsctl and columns or tables were removed in the new version of Open
vSwitch.

This commit fixes the problem in the most common case, by making ovs-vsctl
only replicate the columns and tables in the database that it will actually
use during a given execution.  This will still fail if the database has
changed in major ways, but only if the changes would actually cause
problems for what ovs-vsctl is trying to do anyhow.

Bug #3388.
2010-11-16 09:15:40 -08:00
Ben Pfaff
ef73f86cd4 ovsdb-idl: Make selecting tables and columns to replicate more flexible.
Until now, by default the IDL replicated all tables and all columns in the
database, and a few functions made it possible to avoid replicating
selected columns.  This commit adds a mode in which nothing is replicated
by default and the client code is responsible for specifying each column
and table that it is interested in.  The following commit adds a user for
this mode.
2010-11-16 09:14:52 -08:00
Ben Pfaff
96fc46e8fd nicira-ext: New Nicira vendor action NXAST_NOTE.
Our controller group at Nicira has requested a way to annotate flows with
extra information beyond the flow cookie.  The new NXAST_NOTE action
provides such a way.

This new action is somewhat controversial.  Some have suggested that it
should be added another way (either as part of the Nicira Extended Match
or as a new component of the flow_mod and related messages).  Others think
that it has no place in the OpenFlow protocol at all and that an equivalent
should be implemented using the already available features of OVSDB.  So
it is possible that this extension will be deleted and the feature will
be reimplemented some other way (or not at all).

CC: Teemu Koponen <koponen@nicira.com>
CC: Jeremy Stribling <strib@nicira.com>
2010-11-15 09:41:41 -08:00
Ben Pfaff
8050b31d63 ofp-parse: Refactor flow parsing. 2010-11-11 11:01:50 -08:00
Ben Pfaff
049c8dc212 ofp-parse: Generalize parse_ofp_add_flow_str() as parse_ofp_flow_mod_str().
This generalization allows us to delete several lines of code from
ovs-ofctl.c.
2010-11-11 11:01:09 -08:00
Ben Pfaff
09246b99d1 ofproto: Implement Nicira Extended Match flexible flow match (NXM). 2010-11-09 17:08:09 -08:00
Ben Pfaff
94db54073e Add "Manager" and "manager_options" to allow options for OVSDB connections.
I'm retaining the "managers" column in the Open_vSwitch table for now, but
I hope that applications transition to using "manager_options" eventually
so that we could drop it.

CC: Andrew Lambeth <wal@nicira.com>
CC: Jeremy Stribling <strib@nicira.com>
2010-11-05 10:22:18 -07:00
Ben Pfaff
0bd0c6606a ofp-util: New functions make_nxmsg(), make_nxmsg_xid().
These functions slightly simplify constructing Nicira vendor extension
messages.
2010-11-05 09:25:38 -07:00
Ben Pfaff
9106d88c5b ovs-vsctl: Create bridge interface as type "internal".
The bridge device is always an internal interface, so it seems best to
actually mark it as one.  Jesse would like to eventually make the "type"
column mandatory for Interface records, so here's a step in the right
direction.
2010-11-04 13:47:26 -07:00
Ben Pfaff
d98e600755 vlog: Make client supply semicolon for VLOG_DEFINE_THIS_MODULE.
It's kind of odd for VLOG_DEFINE_THIS_MODULE to supply its own semicolon,
so this commit switches to the more common form.
2010-10-29 09:48:47 -07:00
Ben Pfaff
10a24935c9 xtoxll: Rename "byte-order" since it now include more than xtoxll.
Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-10-29 09:48:47 -07:00
Justin Pettit
b7b6e2c44e ovs-vsctl: Prevent double-free when retrying a transaction 2010-10-22 17:25:02 -07:00
Ben Pfaff
f74055e705 ovs-vsctl: Check for dirty reads within transactions.
OVSDB is transactional but it does not implement any form of locking.  This
means that read-modify-write operations must verify that the values that
they read are still in place before writing.  This commit adds such
checking.

Bug #2387.
Bug #3856.
Bug #3906.
2010-10-22 14:48:09 -07:00
Ben Pfaff
1588bb8d91 ovs-vsctl: Add context pointer to struct vsctl_info.
This will be needed in upcoming commits.
2010-10-22 14:48:09 -07:00
Ben Pfaff
093ca5b366 Fix bug in parsing large datapath IDs.
Datapath IDs are unsigned, but dpid_from_string() was parsing them as
signed integers, which caused high values to be capped at INT64_MAX.

Also, document that datapath IDs may not be all-zero.

Reported-by: Pankaj Thakkar <thakkar@nicira.com>
Reported-by: Teemu Koponen <koponen@nicira.com>
2010-10-21 10:40:20 -07:00
Ben Pfaff
4b6b46ce8a ovs-ofctl: Better document the meaning of "priority" in flow descriptions.
Reported-by: Reid Price <reid@nicira.com>
Bug #3905.
2010-10-21 10:40:20 -07:00
Ben Pfaff
cb49ee4fd1 docs: Make it clear that ovs-openflowd is an alternative to ovs-vswitchd.
Suggested-by: Vishal Swarankar <vishal.swarnkar@gmail.com>
2010-10-14 09:44:26 -07:00
Ben Pfaff
f1588b1fa1 datapath: Remove implementation of port groups.
The "port group" concept seems like a good one, but it has not been
used very much in userspace so far, so before we commit ourselves to
a frozen API that we must maintain forever, remove it.  We can always
add it back in later as a new kind of vport.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-10-11 12:40:11 -07:00
Justin Pettit
c5cd8b2ef1 ovs-openflowd: Don't segfault when no controllers specified
If no controllers are specified on the command-line, ovs-openflowd adds
a couple of its own.  The code that accounts for the controllers
correctly allocated space for them, but used the command-line count to
determine how many to set.  This led to a segfault when later code tried
to dereference them.

Reported-by: Derek Cormier <derek.cormier@lab.ntt.co.jp>
2010-10-07 23:51:02 -07:00
Justin Pettit
eedc0097f4 Add Nicira extension for modifying queue without transmitting
The OpenFlow OFPAT_ENQUEUE action sets a queue id and outputs the packet
in one shot.  There are times in which the queue should be set, but the
output port is not yet known.  This commit adds the NXAST_SET_QUEUE and
NXAST_POP_QUEUE Nicira extension actions to modify the queue
configuration without requiring a port argument.

CC: Jeremy Stribling <strib@nicira.com>
CC: Keith Amidon <keith@nicira.com>
2010-10-02 18:36:10 -07:00
Ben Pfaff
d4cdc6b4c4 ovs-controller: Improve QoS abilities.
This makes it a little easier to test Open vSwitch QoS features using
ovs-controller, by making it possible to assign queues on the basis of
input port, instead of just allowing a single queue for a whole switch.

CC: Michael Mao <mmao@nicira.com>
2010-10-01 13:41:40 -07:00
Ben Pfaff
ad67e56888 learning-switch: Introduce struct for configuration.
This should make extensions easier.
2010-10-01 13:09:05 -07:00
Ben Pfaff
09913dfd25 ovs-controller: Make --with-flows read the file only once, at startup.
A couple of people have reported that ovs-controller --with-flows is
confusing.  This seems to be because it doesn't read the file with the
flows until the first connection from a switch.  Then, if the file has a
syntax error, it exits.

This commit changes the behavior so that it reads the file immediately at
startup instead.
2010-10-01 13:09:05 -07:00
Ben Pfaff
0e581146fe ofp-parse: Add test. 2010-10-01 13:09:05 -07:00
Ben Pfaff
15f1f1b63a ofp-parse: Factor out duplicated code into new functions. 2010-10-01 13:08:33 -07:00
Ben Pfaff
d2805da2cb ovs-ofctl: Add "queue-stats" command to print queue stats. 2010-10-01 10:40:00 -07:00
Ben Pfaff
0c18b5a065 ovs-vsctl: Reduce log level for "Called as..." for read-only invocations.
When ovs-vsctl is not actually going to modify the database, it is less
interesting in the log, so we might as well only log it at "debug" level.

Suggested-by: Neil McKee <neil.mckee@inmon.com>
2010-10-01 10:22:03 -07:00
Ben Pfaff
1998cd4d3e ovs-vsctl: Factor out and optimize searching for a command by name.
The following commit will introduce a new function that wants to do this
a lot, so we might as well do it efficiently.
2010-10-01 10:18:51 -07:00
Ben Pfaff
bad973d7ae ovs-vsctl: Add many more usage examples. 2010-09-21 14:28:02 -07:00
Ben Pfaff
aed133bf9b ovs-vsctl: Allow "get" commands to create @names also.
This is useful for adding records that refer to other records by UUID, e.g.
   ovs-vsctl \
     -- set bridge br0 mirrors=@m \
     -- --id=@eth0 get port eth0 \
     -- --id=@eth0 get port eth1 \
     -- --id=@m create mirror name=mymirror select-dst-port=@eth0 \
                              select-src-port=@eth0 output-port=@eth1
2010-09-21 14:28:02 -07:00
Ben Pfaff
2a022368f4 Avoid shadowing local variable names.
All of these changes avoid using the same name for two local variables
within a same function.  None of them are actual bugs as far as I can tell,
but any of them could be confusing to the casual reader.

The one in lib/ovsdb-idl.c is particularly brilliant: inner and outer
loops both using (different) variables named 'i'.

Found with GCC -Wshadow.
2010-09-20 09:39:54 -07:00
Ben Pfaff
6b7b9d34c0 ovs-vsctl: Remove default timeout.
On overloaded XenServers the current default timeout of 5 seconds can
occasionally be reached, which causes VM startup to fail.  This commit
fixes the problem by removing the default timeout and changing each
invocation of ovs-vsctl within the tree to specify its own timeout,
if appropriate.

Bug #3573.
2010-09-17 14:37:51 -07:00
Ben Pfaff
a154533795 ovs-ofctl, ovs-controller: Disable flow idle timeout by default.
Until now, flows set up by ovs-ofctl and by "ovs-controller --with-flows"
by default expired after 60 seconds of inactivity.  This was surprising,
especially in the latter case where one is normally trying to set up
permanent flows.  Even in the former case, however, we can't think of a
good reason that flows added by ovs-ofctl should expire by default.  So
this commit make flows permanent by default.

Reported-by: Michael Mao <mmao@nicira.com>
2010-09-15 15:21:03 -07:00
Ben Pfaff
933df876ff ovs-ofctl: Add support for drop_spoofed_arp action.
Requested-by: Michael Mao <mmao@nicira.com>
2010-09-10 09:17:29 -07:00
Joe Perches
d295e8e97a treewide: Remove trailing whitespace
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
2010-08-30 13:23:08 -07:00
Ben Pfaff
eb07240a2a utilities: Remove ovs-wdt.
We used ovs-wdt at Nicira for a while when we were working on building
hardware switches.  We don't use it anymore, so remove it from the tree.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-08-25 10:03:41 -07:00
Ben Pfaff
1f0af7586e utilities: Remove ovs-monitor.
The ovs-monitor script is now more than adequately replaced by the
--monitor option to the various daemons.

CC: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2010-08-25 10:03:37 -07:00
Ben Pfaff
265fcdc746 ovs-parse-leaks: Add manpage.
CC: Simon Horman <horms@verge.net.au>
2010-08-25 08:10:06 -07:00
Ben Pfaff
812560d7ce Fix SSL boilerplate descriptions in manpages.
Some of the SSL boilerplate was specific to switches, but it was included
in OVSDB programs also.  Make it more generic.  Also document SSL options
in some manpages where they were missing.
2010-08-19 09:42:14 -07:00
Ben Pfaff
a946ed3942 Fix typos in manpages. 2010-08-19 09:42:14 -07:00
Ben Pfaff
a2a9d2d9df ovs-vsctl: Fix parsing of short SSL options.
The short versions of the SSL options (e.g. -p, -c, -C) did not work,
because they were not in the string passed to getopt_long().  This commit
fixes the problem and should avoid its recurrence with any other short
options that we add in the future.
2010-08-19 09:42:13 -07:00
Ben Pfaff
ba186119ca Remove vestigial support for Spanning Tree Protocol.
Open vSwitch has never properly supported IEEE 802.1D Spanning Tree
Protocol (STP), but it has various bits and pieces that claim to support
it.  This commit deletes them, to reduce the amount of dead code in the
tree.  We can always reintroduce it later if it proves to be a good idea.

Bug #1175.
2010-08-13 09:47:27 -07:00
Ben Pfaff
7d674866d2 ofproto: Add support for remote "service controllers".
CC: Dan Wendlandt <dan@nicira.com>
2010-08-06 17:00:11 -07:00
Ben Pfaff
67f6bdd73b ovs-openflowd: Fix support for multiple controllers.
The multiple controller support here has apparently never been tested.  I
still haven't tested it, but I fixed a few obvious problems in the source
code and in the manpage.
2010-08-06 16:49:14 -07:00
Ben Pfaff
99e5e05db3 ovs-pki: Create private keys with restricted permissions.
OpenSSL will happily create private keys world-writable, but we probably
should not do that.

CC: Keith Amidon <keith@nicira.com>
2010-08-06 13:32:56 -07:00
Ben Pfaff
ccc9fc5a70 ovs-pki: Create log directory if it does not exist.
Otherwise "ovs-pki init" can create the pkidir and then fail when it tries
to create the log file, if it is in a directory that does not exist.
2010-08-06 13:32:47 -07:00
Ben Pfaff
7cdc630f61 ovs-pki: Consistently write error messages to stderr. 2010-08-06 13:31:56 -07:00
Justin Pettit
31681a5d62 vswitchd: Move fail-mode config to Bridge table
Configuration of the fail-mode was an attribute of the Controller table.
However, it makes more sense as an attribute of the Bridge table, since
the behavior defines what a bridge should do if it can't connect to
*any* controller.  This commit makes the move.
2010-07-30 21:26:54 -07:00