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

213 Commits

Author SHA1 Message Date
Ben Pfaff
f5cd6874f1 Avoid writes to variables that are never read back.
Found by clang.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-14 09:37:18 -07:00
Raju Subramanian
e0edde6fee Global replace of Nicira Networks.
Replaced all instances of Nicira Networks(, Inc) to Nicira, Inc.

Feature #10593
Signed-off-by: Raju Subramanian <rsubramanian@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-05-02 17:08:02 -07:00
Ben Pfaff
a341ee57ee ovs-vsctl: Speed up port management operations with many ports.
This makes a sequence of 10,000 "add-port" operations on a single ovs-vsctl
command line about 4X faster.  It makes a sequence of 10,000 "del-port"
operations on a single command line over 2X faster.

It works by not repopulating the cache of relationships between bridges,
ports, and interfaces after most operations, instead updating them
incrementally in-place.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:44 -07:00
Ben Pfaff
286a2e825b ovs-vsctl: Remove 'ctrl', 'n_ctrl' from struct vsctl_bridge.
Only the controller commands used these members and they didn't even help
those commands very much.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:43 -07:00
Ben Pfaff
753cb20f03 ovs-vsctl: Remove 'fail_mode' member from struct vsctl_bridge.
It's only used in cmd_get_fail_mode(), which can easily look it up for
itself, so there's no benefit to storing it in every vsctl_bridge record.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:40 -07:00
Ben Pfaff
5ce5a6b57c ovs-vsctl: Merge struct vsctl_info into struct vsctl_context.
To speed up management operations with many ports, we need to preserve the
cache of bridges, ports, and interfaces from one operation to the next.
One necessary step is to push the "struct vsctl_info" that did the caching
up from the individual functions that need it into a more global structure.
This commit does that, merging it into struct vsctl_context.

This commit also modifies do_vsctl(), the top-level control code in
ovs-vsctl, to keep this part of the vsctl_context unchanged from running
one command to the next.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 14:27:23 -07:00
Ben Pfaff
7da6c3a690 ovs-vsctl: Verify VLAN bridge controllers in cmd_get_controller().
A VLAN bridge uses its parent's controllers, so checking the controller
should verify the parent's set of controllers.

The change to verify_controllers() isn't necessary; it just deletes
the check for a null 'bridge' because verify_controllers() can no
longer be called with a null 'bridge'.

This fixes a bug, but it is unlikely to ever have caused a real problem for
users.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 12:55:01 -07:00
Ben Pfaff
d655c728e3 ovs-vsctl: Verify correct record in cmd_get_fail_mode() for VLAN bridges.
A VLAN bridge uses its parent's fail-mode, so checking the fail-mode should
verify the parent's bridge record.

This fixes a bug, but it is unlikely to ever have caused a real problem for
users.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-19 12:53:47 -07:00
Ben Pfaff
94fbe1aae2 ovsdb-idl: Improve ovsdb_idl_txn_increment() interface.
The previous interface was just bizarre.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-12 08:28:13 -07:00
Ben Pfaff
854a94d9d2 ovsdb-idl: Simplify transaction retry.
Originally the IDL transaction state machine had a return value
TXN_TRY_AGAIN to signal the client to wait for a change in the database and
then retry its transaction.  However, this logic was incomplete, because
it was possible for the database to change before the reply to the
transaction RPC was received, in which case the client would wait for a
further change.  Commit 4fdfe5ccf84c (ovsdb-idl: Prevent occasional hang
when multiple database clients race.) fixed the problem by breaking
TXN_TRY_AGAIN into two status codes, TXN_AGAIN_WAIT that meant to wait for
a further change and TXN_AGAIN_NOW that meant that a change had already
occurred so try again immediately.

This is correct enough, but it is more complicated than necessary.  It is
simpler and just as correct to use a single "try again" status that
requires the client to wait for a change relative to the database contents
*before* the transaction was committed.  This commit makes that change.
It also changes ovsdb_idl_run()'s return type from bool to void because
its return type is hardly useful anymore.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-04-12 08:19:01 -07:00
Ben Pfaff
e49190c493 Fix minor memory leaks found by valgrind.
All of these leaks are in normally short-lived programs, so none of them
is very important.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-28 14:54:48 -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
Ben Pfaff
5341d04613 ovs-vsctl: Allow "fake bridges" to be created for VLAN 0.
A fake bridge for VLAN 0 is useful, because it provides a way to create
access ports for VLAN 0.  There is no good reason to prevent it.

NIC-464.
Reported-by: Rob Hoes <Rob.Hoes@citrix.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-03-20 15:47: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
Ethan Jackson
b5fcae5027 ovs-vsctl: Clarify br-exists usage.
Requested-by: Niklas Andersson <nandersson@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
2012-03-15 11:48:22 -07: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
Ben Pfaff
2a9537e2ab ovs-vsctl: Add set relational operators to "find" command.
Requested-by: Shih-Hao Li <shli@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-01-11 09:56:11 -08:00
Ben Pfaff
4fdfe5ccf8 ovsdb-idl: Prevent occasional hang when multiple database clients race.
When a client of the IDL tries to commit a read-modify-write transaction
but the database has changed in the meantime, the IDL tells its client to
wait for the IDL to change and then try the transaction again by returning
TXN_TRY_AGAIN.  The "wait for the IDL to change" part is important because
there's no point in retrying the transaction before the IDL has received
the database updates (the transaction would fail in the same way all over
again).

However, the logic was incomplete: the database update can be received
*before* the reply to the transaction RPC (I think that in the current
ovsdb-server implementation this will always happen, in fact).  When this
happens, the right thing to do is to retry the transaction immediately;
if we wait, then we're waiting for an additional change to the database
that may never come, causing an indefinite hang.

This commit therefore breaks the "try again" IDL commit status code
into two, one that means "try again immediately" and another that means
"wait for a change then try again".  When an update is processed after a
transaction is committed but before the reply is received, the "try again
now" tells the IDL client not to wait for another database change before
retrying its transaction.

Bug #5980.
Reported-by: Ram Jothikumar <rjothikumar@nicira.com>
Reproduced-by: Alex Yip <alex@nicira.com>
2011-10-31 09:15:14 -07:00
Justin Pettit
070723f9fe ovs-vsctl: Print warning for invalid controller and manager targets. 2011-10-12 14:58:52 -07:00
Ben Pfaff
a892775d03 ovs-vsctl: Improve usage message.
Bug #7332.
Reported-by: Gordon Good <ggood@nicira.com>
2011-09-15 15:43:10 -07:00
Justin Pettit
55d5bb44cb util: Introduce get_program_version function.
Useful in an upcoming commit.
2011-08-04 11:15:43 -07:00
Ben Pfaff
c1a543a8d6 vlog: Add a new log level "off".
Until now, "emer" has effectively been "off" because no messages were ever
logged at "emer" level.  Justin points out that it is useful to use "emer"
for messages that indicate a fatal error.  This commit makes that change
and adds a new "off" level to really turn off all logging to a facility.
2011-08-01 13:23:19 -07:00
Ben Pfaff
06b6d65132 vswitchd: Prevent multiple ovs-vswitchd processes from acting together.
Once in a while someone reports a problem caused by running multiple
ovs-vswitchd processes at the same time.  This fixes the problem by
requiring ovs-vswitchd to obtain a database lock before taking any actions.
2011-07-26 16:50:09 -07:00
Ben Pfaff
48a695011b ovs-vsctl: Log better warnings for duplicate ports and interfaces.
The database prevents multiple ports or interfaces with a single name, but
duplicates can still occur if, for example, two bridges' "ports" columns
both point to a single Port record.  The existing warning just says in this
case that the database contains a duplicate port name.  This prompts users
to dump the Port table to look for the duplicate.  Of course there isn't
one, so then they ask me to point out the problem.

This commit improves the log message to point out the actual problem.
2011-07-26 09:47:03 -07:00
Ben Pfaff
2096903b45 ovsdb-idl: Plug hole in state machine.
The state machine didn't have a proper state for "not yet committed or
aborted", which meant that destroying an ovsdb_idl_txn without committing
or aborting it caused a segfault.  This fixes the problem by adding a new
state TXN_UNCOMMITTED to the state machine.

This is related to commit 79554078d "ovsdb-idl: Fix bad logic in
ovsdb_idl_txn_commit() state transitions", which fixed a related bug.

Bug #2438.
2011-06-21 15:09:56 -07:00
Ben Pfaff
ffd66ea9e4 ovs-vsctl: New "comment" command.
This allows processes that call ovs-vsctl to add remarks that explain their
intentions.
2011-06-07 17:05:42 -07:00
Ben Pfaff
9b1735a720 ovs-vsctl: Add "show" command for printing an overview of configuration. 2011-05-24 13:03:58 -07:00
Ethan Jackson
93b8df3853 cfm: Remove Maintenance_Point and Monitor tables.
In an effort to make CFM easier to understand and configure, this
patch removes the Maintenance_Point and Monitor tables from the
database.  As a consequence, users will only be able to configure
one remote maintenance point.  Furthermore, before this patch each
remote maintenance point maintained its own separate fault flag in
the database.  This flag is no longer reported, users will need to
infer the fault status from the global CFM fault flag.
2011-05-20 15:53:29 -07:00
Ben Pfaff
e3c1773370 Consistently write null pointer constants as NULL instead of 0.
Found with sparse.
2011-05-16 13:40:47 -07:00
Ben Pfaff
bf8f2167fd stream-ssl: Improve messages when configuring SSL if it is unsupported.
Previously, if --private-key or another option that requires SSL support
was used, but OVS was built without OpenSSL support, then OVS would fail
with an error message that the specified option was not supported.  This
confused users because it made them think that the option had been removed:
    http://openvswitch.org/pipermail/discuss/2011-April/005034.html

This commit improves the error message: OVS will now report that it was
built without SSL support.  This should be make the problem clear to users.

Reported-by: Aaron Rosen <arosen@clemson.edu>
Feature #5325.
2011-05-10 09:17:37 -07:00
Ben Pfaff
6d5abe9434 ovs-vsctl: Issue warning for likely erroneous "get" commands.
Suggested-by: Reid Price <reid@nicira.com>
Feature #5527.
2011-05-10 09:10:16 -07:00
Ben Pfaff
b3c01ed330 Convert shash users that don't use the 'data' value to sset instead.
In each of the cases converted here, an shash was used simply to maintain
a set of strings, with the shash_nodes' 'data' values set to NULL.  This
commit converts them to use sset instead.
2011-03-31 16:42:01 -07:00
Ethan Jackson
16f4f61d0f ovs-vsctl: Remove dead assignment.
Noticed this last night while playing around with the clang static
analyzer.
2011-03-29 11:13:30 -07:00
Ethan Jackson
e2f8f83671 ovs-vsctl: Remove dead code.
Coverity #10710.
2011-03-29 10:45:29 -07:00
Ethan Jackson
28a14bf3d8 ovs-vsctl: Back out garbage collection changes.
Garbage collection introduced in
c5f341ab193b9126dffef8c77bf8ed35e91290fd changed ovs-vsctl so that
it would allow the garbage collector to reclaim unused tables
instead of manually deleting them itself.  Since garbage collection
runs at transaction completion, undeleted tables would hang around
and could conflict with future actions in a given transaction.
This commit backs out this change.

The following command is an example of something that would have
failed before this commit.

ovs-vsctl -- add-br b \
-- del-br b           \
-- add-br b           \
-- set Interface b other_config:test=test
2011-03-16 16:57:11 -07:00
Ben Pfaff
c5f341ab19 ovsdb: Implement garbage collection. 2011-03-10 11:24:00 -08:00
Ben Pfaff
0dc66db95b ovsdb-data: Expose guts of ovsdb_symbol_table() to clients.
ovs-vsctl will, in upcoming commits, want to more closely examine its
ovsdb_symbol_table structures.  This could be done by providing a more
complete API, but it doesn't seem worth it to me.  This commit instead goes
the other way, exposing the internals to clients.  This commit also
eliminates the ovsdb_symbol_table_find_uncreated() function, which
ovs-vsctl can now implement itself.
2011-03-10 11:24:00 -08:00
Ben Pfaff
e9387de4a2 ovsdb-data: Rename 'used' to 'created' in struct ovsdb_symbol.
The name 'created' better reflects the actual meaning of this member: in
both ovsdb and ovs-vsctl, it is true if a row has been created with the
symbol's UUID and false otherwise.
2011-03-10 11:24:00 -08:00
Ben Pfaff
28a3b753fa ovs-vsctl: Check for uncreated symbols earlier.
The check for uncreated symbols does not rely on anything that happens
during transaction commit, so there is no point in allowing the transaction
to be sent to the database server, only to fail there, before reporting
the problem locally.
2011-03-10 11:23:59 -08:00
Ben Pfaff
1611cf3f5a ovs-vsctl: Clarify that uuid_from_string() shouldn't fail in post_create().
Coverity #10701.
2011-02-23 15:14:42 -08:00
Ben Pfaff
4a433a0fc5 ovs-vsctl: Simplify parse_column_key_value().
Coverity pointed out some inconsistencies on tests for whether columnp and
keyp were nonnull.  These tests were, at best, confusing, but in fact every
caller always passed nonnull for both parameters, so this commit drops all
of those tests.

Coverity #10715, 10710.
2011-02-23 15:14:42 -08:00
Justin Pettit
cea0c39367 ovs-vsctl: Free "columns" in cmd_find().
Coverity #10730
2011-02-23 11:08:20 -08:00
Justin Pettit
a6c8e0d9e9 ovs-vsctl: Check "key" is valid before dereferencing in get_external_id().
Coverity #10716
2011-02-22 10:14:53 -08:00
Andrew Evans
289df16d29 ovsdb: Remove 'managers' column from 'Open vSwitch' table.
We had retained but deprecated the use of the older 'managers' column in the
'Open vSwitch' table for compatibility with applications that might still use
it, but that created more problems than it solved. This commit removes the
'managers' column from the schema, and removes all references to it from the
code, init scripts, documentation, and tests.
2011-02-18 11:09:29 -08:00
Ben Pfaff
ae9a3235bf ovs-vsctl: Improve documentation and --help output. 2011-02-15 12:24:28 -08:00
Ben Pfaff
e051b42c41 ovs-vsctl: Add formatting options for the "list" and "find" commands.
The default format is the same as before (which the testsuite verifies).
The most important use for the new formatting options is --bare, which
outputs a format that is easy to parse from a shell script.  An upcoming
patch will start using that.
2011-02-08 16:10:34 -08:00
Ben Pfaff
0a140468dd ovs-vsctl: Add new "find" command.
This allows listing records that match specified criteria, instead
of just records that have specific names.

This will be used in an upcoming patch, along with --columns, to
list all of the interfaces whose type is 'internal'.
2011-02-08 16:01:28 -08:00
Ben Pfaff
9591fefeea ovs-vsctl: Add --columns options to "list" command.
This allows the user to list just selected columns from a table,
for example just the "name" column.

This will become more useful as additional formatting options
are added in upcoming commits.
2011-02-08 16:01:28 -08:00
Ben Pfaff
f158c54a98 ovs-vsctl: Fix spelling of "satisfied" in function name.
Suggested-by: Ethan Jackson <ethan@nicira.com>
2011-02-08 16:01:28 -08:00
Andrew Evans
24b8b259bb ovs-vsctl: Add commands to get/delete/set manager connections. 2011-02-07 23:13:48 -08:00