2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 13:58:14 +00:00
Commit Graph

1150 Commits

Author SHA1 Message Date
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
Justin Pettit
1a048029a0 vswitchd: Remove default controller config from Open_vSwitch table
An OpenFlow controller is normally associated with a bridge.  It was
possible to define a default controller in the Open_vSwitch table that
would be used if one was not associated with a bridge.  This was seldom
used and mostly just caused confusion.  This commit removes that
support, so an OpenFlow controller must always be associated with a
bridge.
2010-07-30 21:26:54 -07:00
Ben Pfaff
5682f72331 ovs-ofctl: Add support for OpenFlow enqueue action. 2010-07-30 16:04:17 -07:00
Justin Pettit
882c239990 ovs-controller: Add ability to define default flows
Add support for the --with-flows option, which allows default flows to
be read from a file and pushed to connecting switches.
2010-07-30 00:05:33 -07:00
Justin Pettit
aaaa7553a9 learning-switch: Add ability to define default flows
Add an argument to the function to create a learning switch, which
defines default flows to be pushed down to connecting switches.  It does
nothing to enforce that they remain intact.  It only pushes flows on
switch connection.
2010-07-30 00:05:33 -07:00
Justin Pettit
f22716dcca ofp-parse: Break string-to-openflow parsing into library functions
An upcoming commit will add the ability to load OpenFlow rules into
ovs-controller.  Break out string-to-openflow parsing so that
ovs-ofctl and ovs-controller can use the same code.
2010-07-30 00:05:33 -07:00
Ben Pfaff
480ce8abca vlog: Make the vlog module catalog program-specific.
Until now, the collection of vlog modules supported by a given OVS program
was not specific to that program.  That means that, for example, even
though ovs-dpctl does not have anything to do with jsonrpc, it still has
a vlog module for it.  This is confusing, at best.

This commit fixes the problem on some systems, in particular on ones that
use GCC and the GNU linker.  It uses the feature of the GNU linker
described in its manual as:

    If an orphaned section's name is representable as a C identifier then
    the linker will automatically see PROVIDE two symbols: __start_SECNAME
    and __end_SECNAME, where SECNAME is the name of the section.  These
    indicate the start address and end address of the orphaned section
    respectively.

Systems that don't support these features retain the earlier behavior.

This commit also fixes the annoyance that modifying lib/vlog-modules.def
causes all sources files that #include "vlog.h" to recompile.
2010-07-21 15:47:09 -07:00
Ben Pfaff
5136ce492c vlog: Introduce VLOG_DEFINE_THIS_MODULE for declaring vlog module in use.
Adding a macro to define the vlog module in use adds a level of
indirection, which makes it easier to change how the vlog module must be
defined.  A followup commit needs to do that, so getting these widespread
changes out of the way first should make that commit easier to review.
2010-07-21 15:47:09 -07:00
Ben Pfaff
9200fb9ef9 vlog: Remove explicit calls to vlog_init().
This is no longer necessary.
2010-07-21 15:47:09 -07:00
Ben Pfaff
ff8bb7e76b timeval: Make time_init() static and remove calls to it.
Since the timeval module now initializes itself on-demand, there is no
longer any need to initialize it explicitly, or to provide an interface to
do so.
2010-07-21 15:47:09 -07:00
Ben Pfaff
611e9a3562 ovs-controller: Add support for OpenFlow queues.
Before, ovs-controller always sent packets using OFPAT_OUTPUT, which always
uses the default OpenFlow queue.  To help me debug the Open vSwitch QoS
implementation, I want to be able to send packets on other queues, so
this commit adds that feature.
2010-07-20 11:22:36 -07:00
Jesse Gross
af9af3e21d ovs-vsctl: Fix unitialized variables.
The compiler pointed out two variables that it thought were used
without being initialized.  The first was just a spurious warning
but the second could result in an unitialized pointer being freed.
This fixes both of those issues.
2010-07-16 10:32:13 -07:00
Ben Pfaff
e111e681e3 ovs-vsctl: Do not allow record names to be abbreviated.
It's pretty risky to allow record names to be abbreviated.  If eth1 through
eth20 all exist, and then someone deletes eth1, then until now an ovs-vsctl
command that mentioned eth1 would actually use eth10.  This is too much of
a caveat to let loose on unsuspecting scripts, so this commit removes that
functionality.
2010-07-16 09:32:11 -07:00
Ben Pfaff
4f1361e857 ovs-vsctl: Make --help capitalization and spelling more consistent.
Reported-by: Reid Price <reid@nicira.com>
Bug #3175.
2010-07-14 17:07:28 -07:00
Ben Pfaff
8c3c2f3000 ovsdb-idl: Transition to better interfaces for reading table columns.
The existing ovsdb_idl_txn_read() was somewhat difficult and expensive to
use, because it always made a copy of the data in the column.  This was
necessary at the time it was introduced, because there was no way for it
to return a "default" value for columns that had not yet been populated
without allocating data and hence requiring the caller to free it.

Now that ovsdb_datum_default() exists, this is no longer required.  This
commit introduces a pair of new functions, ovsdb_idl_read() and
ovsdb_idl_get(), that return a pointer to existing data and do not do any
copying.  It also transitions all of ovsdb_idl_txn_read()'s callers to
the new interfaces.
2010-07-12 10:13:53 -07:00
Ben Pfaff
c6c9e1e36f ovs-pki: Allow generating certificates with duplicate subjects.
Without this setting, the certificate authorities that ovs-pki creates will
not allow two switches or two controllers to have the same name.  This
causes problem in testing, since it's often convenient to test with short,
common names like "tmp".

(If you need to fix a PKI that you already created, in addition to
modifying ca.cnf you will need to make the same change to index.txt.attr.)

CC: Pierre Ettori <pettori@nicira.com>
2010-06-29 16:40:26 -07:00
Ben Pfaff
4e312e694f doc: Change "-" to "\-" in appropriate places.
The newer manpages tend to get this right more often than the old ones,
but there were lots of places that needed to be corrected.
2010-06-29 14:29:40 -07:00
Ben Pfaff
7db03f7c0e ovs-vsctl: Add "wait-until" command.
The "wait-until" command causes ovs-vsctl to wait until a specified
condition becomes true.

Requested-by: Sajjad Lateef <slateef@nicira.com>
2010-06-29 09:54:10 -07:00
Ben Pfaff
53de028597 ovs-vsctl: Make partial matches on record names optional.
The wait-until command to be added to ovs-vsctl in an upcoming commit
doesn't really want to wait for partial matches: if I'm waiting for br1
to be created I really don't want to be fooled by br10.  So this commit
adds infrastructure to avoid such partial matches.
2010-06-29 09:33:13 -07:00
Ben Pfaff
e89e5374be ovs-vsctl: Prepare for more flexible database argument parsing.
The wait-until command to be added in an upcoming commit needs to support
!=, <, >, <=, and >= operators in addition to =, so this commit adds that
infrastructure.
2010-06-29 09:33:13 -07:00
Ben Pfaff
87b23a01ed ovs-vsctl: Allow commands to tell ovs-vsctl to try again later.
The "wait-until" command to be introduced in an upcoming commit needs to
be able to tell the ovs-vsctl main loop to try again later, since the
condition that it is looking for has not yet been satisfied.  This commit
adds the infrastructure for this.  (It's being broken out into a separate
commit because it modifies scattered code in ovs-vsctl.c and thus might
be easier to review this way.)
2010-06-29 09:33:13 -07:00
Ben Pfaff
0b3f272539 ovs-ofctl: Warn about flows not in normal form.
Lots of people get this wrong.

Bug #185.
2010-06-28 11:27:02 -07:00
Ben Pfaff
f40a9b61e2 ovs-vsctl: Make "ovs-vsctl get <table> <record> _uuid" work.
Requested-by: Sean Brady <sbrady@gtfservices.com>
2010-06-24 17:12:57 -07:00
Ben Pfaff
26b3154062 ovs-vsctl: Add details to documentation for "emer-reset" command.
Someone asked me what emer-reset really does and I had to look in the
source code to find out.  It's kinder just to document it.
2010-06-24 13:05:13 -07:00
Ben Pfaff
4ea21243f5 ovsdb-idl: Simplify usage of ovsdb_idl_run().
It makes client code simpler if ovsdb_idl_run() simply lets the caller
know whether anything changed.
2010-06-23 12:43:02 -07:00
Ben Pfaff
506051fcb5 Use shash_destroy_free_data() to simplify a few scattered pieces of code. 2010-06-23 12:43:02 -07:00
Ben Pfaff
c1c9c9c4b6 Implement QoS framework.
ovs-vswitchd doesn't declare its QoS capabilities in the database yet,
so the controller has to know what they are.  We can add that later.

The linux-htb QoS class has been tested to the extent that I can see that
it sets up the queues I expect when I run "tc qdisc show" and "tc class
show".  I haven't tested that the effects on flows are what we expect them
to be.  I am sure that there will be problems in that area that we will
have to fix.
2010-06-17 15:04:12 -07:00
Ben Pfaff
fa37b408ea vconn: Move OpenFlow utility functions into new file ofp-util.c.
The main purpose of the vconn code is to ship OpenFlow messages across
network connections.  Over time a large number of utility functions related
to OpenFlow messages have also crept into vconn.c, but that's really
logically separate.  This commit breaks those functions out into a new
file.
2010-06-17 10:30:18 -07:00