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

1727 Commits

Author SHA1 Message Date
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
Ben Pfaff
ce5a3e38da ovs-vsctl: Support references among records at creation time.
This makes it easy to create a bunch of records that are all related to
each other in a single ovs-vsctl invocation.  It adds an example to the
ovs-vsctl manpage.
2010-06-17 10:30:18 -07:00
Ben Pfaff
4a0335937f ovs-vsctl: Add support for command options that accept arguments. 2010-06-17 10:30:18 -07:00
Ben Pfaff
ef1e753e5d ovs-vsctl: Update manpage. Use same order as ovs-vswitchd.conf.db.5. 2010-06-17 10:30:18 -07:00
Ben Pfaff
8d49c47a5d ovs-vsctl: Fix assert-fail when an error occurs and "create" command used.
When the "create" command is used, post_create() calls
ovsdb_idl_txn_get_insert_uuid(), which asserts that the transaction
completed successfully.  This makes it clear that postprocess functions
should only run when the transaction completes successfully.  (Currently
post_create() is the only postprocess function.)
2010-06-17 10:30:18 -07:00
Ben Pfaff
f19f25a44b ovs-vsctl: Fix spelling error in log message. 2010-06-17 10:26:13 -07:00
Ben Pfaff
eb15cdbbea ofproto: Make OpenFlow connection log messages name the datapath.
Until now, log messages about OpenFlow connections have named the target
of the connection, e.g. "tcp:1.2.3.4:5555", but they have not named the
datapath.  Most often, every datapath has the same target, so this can
make it difficult to tell which connection is going wrong.  Usually, that
isn't important, because all connections with the same target will have the
same problems, but it's probably better to be more informative.

This commit changes the log messages to include the datapath name, so that
"tcp:1.2.3.4:5555" becomes, e.g., "xenbr0<->tcp:1.2.3.4:5555".

Requested-by: Keith Amidon <keith@nicira.com>
2010-06-08 10:38:57 -07:00
Ben Pfaff
9794e80604 rconn: Drop rconn_new(), rconn_new_from_vconn() functions.
There are enough rconn functions without these helpers, which weren't used
much in practice.
2010-06-08 10:35:53 -07:00
Ben Pfaff
58bdd0925e rconn: Drop 'name' arg to rconn_new_from_vconn(), rconn_connect_unreliably().
The 'name' argument to these functions is actively unhelpful, because none
of the callers provided a better name than the one provided by
vconn_get_name().  So drop it.
2010-06-08 10:35:53 -07:00
Jesse Gross
1e82e503c5 netdev: Remove may_create/may_open flags.
The most recent revision of the netdev library added may_create
and may_open flags to explicitly state the intent of the caller as
to whether the device should already be in use.  This was simply
a sanity check for users of the netdev library and the configuration.
At this point the netdev library and its users are well behaved and
should no longer need to be checked.  Additional checks have also
been added for incorrect configuration that mean the netdev library
is no longer the primary line of defense.

These flags themselves create problems because it is not always
easy for a library to know what the state of devices should be.
This is particularly a problem for ovs-openflowd, which expects
ports to be added by ovs-dpctl.  Fixing this either requires that
the checks are so permissive to be useless or ugly hacks to get
around them.  Since they are no longer needed, just remove the
checks.

This commit restores the previous behavior of ovs-openflowd to
not require that ports be specified on the command line or
cleaned up after use.

Bug #2652

CC: Natasha Gude <natasha@nicira.com>
CC: Jean Tourrilhes <jt@hpl.hp.com>
CC: 蒲彦 <yan.p.bjtu@gmail.com>
2010-06-01 17:27:45 -07:00
Ben Pfaff
7089685a9e Build ovs-wdt or nlmon utilities only on Linux.
These utilities are Linux-specific.
2010-05-26 15:36:58 -07:00
Ben Pfaff
9d82ec478d Always #include <sys/socket.h> before <net/if.h>.
FreeBSD 8.0's <net/if.h> requires <sys/socket.h> to be included first,
even though I don't see any such requirement in POSIX.
2010-05-26 15:27:01 -07:00
Ben Pfaff
e2bfacb6e4 ofproto: Prefer "master" and "other" connections for snooping over "slave".
This makes "ovs-ofctl snoop" and anything else that connects to the
switch's "snoop" socket typically more useful in the presence of multiple
controllers, since the "master" connection is the one with the most
interesting traffic.

Suggested-by: Justin Pettit <jpettit@nicira.com>
2010-05-13 09:43:39 -07:00
Ben Pfaff
0caf6bde24 ovs-ofctl: Add "snoop" command.
The "snoop" command does roughly the same thing as "monitor", but it is
easier to use in the common case where one just wants to look at the
OpenFlow controller connection for a bridge.  Instead of, for example,
   ovs-ofctl monitor unix:/var/run/openvswitch/br0.snoop
one merely types
   ovs-ofctl snoop br0
2010-05-11 12:44:58 -07:00
Ben Pfaff
7f1089b503 ovs-ofctl: "monitor" command takes no more than 2 arguments
The "monitor" command would accept 3 arguments and ignore the third one.
Reject such usage instead.
2010-05-11 12:22:17 -07:00
Ben Pfaff
a6bc4a03a4 ovs-ofctl: Fix usage message for "monitor" command.
The "monitor" command takes at most two arguments, and the second one is
optional, so express that correctly.
2010-05-11 12:20:58 -07:00
Ben Pfaff
d01600a208 ovs-vsctl: Add sFlow to supported set of tables.
Somehow this one got left out accidentally.

Reported-by: Neil McKee <neil.mckee@inmon.com>
2010-05-05 10:38:24 -07:00
Justin Pettit
18ee958b7b ovs-vsctl: Add emergency reset command
Add the "emer-reset" command, which is used to clear the configuration of
items likely to have been configured by the manager.  This will leave
the core networking configuration as it was.
2010-04-30 16:53:29 -07:00
Ben Pfaff
537eeb9ccf ovs-ofctl: Document that "actions" must be last in flow specifications.
Bug #2447.
Reported-by: Reid Price <reid@nicira.com>
2010-04-21 13:29:03 -07:00
Ben Pfaff
33e01d3a2b ovs-openflowd: Prefer --fail=standalone|secure over --fail=open|closed.
The "standalone" and "secure" terminology is less confusing.

This retains support for "open" and "closed" but does not document it.
2010-04-20 11:14:58 -07:00
Ben Pfaff
76ce943239 Add support for multiple OpenFlow controllers on a single bridge.
With this commit, Open vSwitch permits a bridge to have any number of
OpenFlow controllers.  When multiple controllers are configured, Open
vSwitch connects to all of them simultaneously.  Details of configuration
are in the vswitch schema documentation.

OpenFlow 1.0 does not specify how multiple controllers coordinate in
interacting with a single switch, so more than one controller should be
specified only if the controllers are themselves designed to coordinate
with each other.

An upcoming commit will provide a simple means for coordination between
multiple controllers.

Feature #2495.
2010-04-20 11:01:44 -07:00
Ben Pfaff
79c9f2ee78 ofproto: Bundle all controller-related settings into a struct.
Many ofproto settings are controller-related.  Upcoming commits will add
to ofproto the ability to support multiple controllers, so it is important
to be able to refer to controller settings as a group.  Hence, this commit
bundles them into a new "struct ofproto_controller".
2010-04-20 11:01:44 -07:00
Ben Pfaff
fb0d597fb6 ovs-openflowd: Remove documentation for obsolete --mgmt-id option.
Also remove unused OPT_MGMT_ID enum.
2010-04-20 11:01:44 -07:00
Jesse Gross
659586efcf tunneling: Add support for tunnel ID.
Add a tun_id field which contains the ID of the encapsulating tunnel
on which a packet was received (0 if not received on a tunnel).  Also
add an action which allows the tunnel ID to be set for outgoing
packets.  At this point there aren't any tunnel implementations so
these fields don't have any effect.

The matching is exposed to OpenFlow by overloading the high 32 bits
of the cookie as the tunnel ID.  ovs-ofctl is capable of turning
on this special behavior using a new "tun-cookie" command but this
command is intentially undocumented to avoid it being used without
a full understanding of the consequences.
2010-04-19 09:11:51 -04:00