2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00

139 Commits

Author SHA1 Message Date
Mehak Mahajan
f125905cdd Allow configuring DSCP on controller and manager connections.
The changes allow the user to specify a separate dscp value for the
controller connection and the manager connection. The value will take
effect on resetting the connections. If no value is specified a default
value of 192 is chosen for each of the connections.

Feature #10074
Requested-by: Rajiv Ramanathan <rramanathan@nicira.com>
Signed-off-by: Mehak Mahajan <mmahajan@nicira.com>
2012-03-23 18:13:08 -07:00
Ben Pfaff
da897f41cd ovsdb: Implement a "lock" feature in the database protocol.
This provides clients a way to coordinate their access to the database.
This is a voluntary, not mandatory, locking protocols, that is, clients
are not prevented from modifying the database unless they cooperate with
the locking protocol.  It is also not related to any of the ACID properties
of database transactions.  It is strictly a way for clients to coordinate
among themselves.

The following commit will introduce one user.
2011-07-26 16:50:09 -07:00
Ben Pfaff
e317253b13 ovsdb: Refactor jsonrpc-server to make the concept of a session public.
An upcoming commit will need to expose the concept of a database session
to the execution engine, to allow the execution engine to query the locks
held by the session.  This commit prepares for that by making sessions a
publicly visible data structure.
2011-07-26 16:50:09 -07:00
Ben Pfaff
a11f6164a8 ovsdb: Report the number of connections for inbound Managers.
Inbound managers (e.g. "ptcp:") can have multiple active connections, but
the database schema doesn't allow us to report the status of more than one
at a time.  This commit adds a status key-value pair that, when there is
more than one active connection, reports the number that are active.  This
at least helps to clarify the issue.
2011-07-26 16:50:09 -07:00
Ben Pfaff
87fcbc60f2 ovsdb-server: Reliably report status of inbound connections.
ovsdb_jsonrpc_server keeps track of its remotes in a shash indexed on the
remote name specified in the database Manager record, but
ovsdb_jsonrpc_server_get_remote_status() added the name returned by
jsonrpc_session_get_name() to the shash returned to the ovsdb-server code.
If that name happened to be different (which is entirely possible because
the latter returns a "canonicalized" name in some cases) then the
ovsdb-server code couldn't find it.  Furthermore, if an inbound (e.g.
"ptcp:") Manager got a connection and then lost it, the status info in
that Manager never got updated to reflect that, because the code considered
that that "couldn't happen" and didn't bother to do any updates.

This commit simplifies the logic.  Now ovsdb-server just asks for a single
status record at a time, using the name that is indexed in the
ovsdb_jsonrpc_server shash, avoiding that whole issue.
2011-07-26 16:50:09 -07:00
Ben Pfaff
f97ffebfb8 ovsdb: Log when remote connections are deconfigured.
Recently I helped debug a scenario where ovsdb-server connected to a remote
manager, then ovs-vsctl deleted the remote manager and soon after re-added
it.  The log was difficult to interpret because it showed two successful
connection attempts to the same remote without showing a reason why the
connection was dropped in the first place.  Adding this log message would
make it clear that the configuration changed to remove that remote
connection in the meantime.
2011-07-18 09:30:31 -07:00
Ben Pfaff
a9a2fba509 ovsdb: Remove useless "return;" in ovsdb_jsonrpc_session_get_status(). 2011-07-08 17:10:15 -07:00
Ben Pfaff
d3d8f1f7e5 Add missing "static" keywords.
Found by sparse.
2011-05-16 13:40:47 -07:00
Andrew Evans
5eda645e36 ovsdb-server: Report time since last connect and disconnect for each manager.
Only the time connected (if connected) or disconnected (if disconnected) is
currently reported for each manager. Change to reporting both in seconds since
the last connect and disconnect events respectively. An empty value indicates
no previous connection or disconnection.

This can help diagnose certain connectivity problems, e.g. flapping.

Requested-by: Peter Balland <peter@nicira.com>
Bug #4833.
2011-03-14 13:10:02 -07:00
Andrew Evans
a4613b01ab ovsdb: Change the way connection duration time is reported in Manager table.
Commit 0b3e7a8b71 (ovsdb-server: Write manager status information to Manager
table.) attempted to provide managers with the ability to debug manager-related
connection problems, but it turns out that reporting "time_in_state" is not
very useful, because the state is constantly changing. What people really want
is the time each manager has been connected or disconnected, depending on the
current connection state.

Replace "time_in_state" key with "time_connected" and "time_disconnected"
keys. Only one exists at a time, and time is in seconds.

Bug #4833.
2011-03-09 10:46:57 -08:00
Andrew Evans
0b3e7a8b71 ovsdb-server: Write manager status information to Manager table.
This commit makes the status of manager connections visible via the Manager
table in the database.  Two new columns have been created for this purpose:
'is_connected' and 'status'.  The former is a boolean flag, and the latter is a
string-string map which may contain the keys "last_error", "state", and
"time_in_state".

Requested-by: Keith Amidon <keith@nicira.com>
Reviewed by: Ben Pfaff.
Feature #3692.
2011-02-01 14:45:20 -08:00
Ben Pfaff
cbb7baddb8 ovsdb: Support replicating a table without including any columns.
The OVSDB wire protocol has a "monitor" feature that supports table
replication on a column-by-column basis.  This wire protocol in theory
supports replicating a table without replicating any columns in it.  In
such a case, the client only tracks the UUIDs of the rows in the table.
However, the ovsdb-server implementation did not support this possibility
properly.  This commit fixes the bug.
2010-11-16 09:12:02 -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
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
4e8e4213a8 Switch many macros from using CONTAINER_OF to using OBJECT_CONTAINING.
These macros require one fewer argument by switching, which makes code
that uses them shorter and more readable.
2010-10-01 10:25:29 -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
20aa445d66 ovsdb: Extend "monitor" to select different operations in a single table.
Until now, "monitor" has only allowed the client to choose the kinds of
changes that will be monitored on a per-table basis.  However, it makes
sense to be able to choose operations on a per-column basis.  The
immediate need for this is to make sure that the final statistics of
deleted Interface records are known at time of deletion, even though the
intermediate values of the statistics are not important.

CC: Jeremy Stribling <strib@nicira.com>
2010-07-01 09:47:46 -07:00
Ben Pfaff
31d0b6c942 ovsdb-server: Implement unixctl command to reconnect JSON-RPC connections.
This feature may be useful for debugging.

Feature #2222.
2010-06-24 12:56:30 -07:00
Ben Pfaff
0d11f523a3 ovsdb: Use port 6632 as a default port for database connections.
Until now we have required a port number to be specified explicitly for
database connections.  This commit adopts port 6632 as a default.
2010-04-12 11:15:15 -07:00
Ben Pfaff
17d18afbfd ovsdb: Check for changed columns only once per transaction commit.
Until now, each part of a transaction commit that is interested in whether
a column's value has changed has had to do a comparison of the old and new
values itself.  There can be several interested parties per commit
(generally one for file storage and one for each remove OVSDB connection),
so this seems like too much redundancy.  This commit adds a bitmap
to struct ovsdb_txn_row that tracks whether a column's value has actually
changed, to reduce this overhead.

As a convenient side effect of doing these checks up front, it then
becomes easily possible to drop txn_rows (and txn_tables and entire txns)
that become no-ops.  (This probably fixes bug #2400, which reported that
some no-ops actually report updates over monitors.)
2010-03-17 14:24:56 -07:00
Ben Pfaff
c69ee87c10 Merge "master" into "next".
The main change here is the need to update all of the uses of UNUSED in
the next branch to OVS_UNUSED as it is now spelled on "master".
2010-02-11 11:11:23 -08:00
Ben Pfaff
9cb53f2613 ovsdb: Add support for multiple databases to the protocol.
This also adds protocol compatibility to the database itself and to
ovsdb-client.  It doesn't actually add multiple database support to
ovsdb-server, since we don't really need that yet.
2010-02-09 14:25:32 -08:00
Ben Pfaff
23935e8bcb ovsdb-server: Free memory on exit.
It is not really important to free memory on program exit, but it makes it
easier to see real memory leaks.

Found with valgrind.
2010-02-02 15:21:09 -08:00
Ben Pfaff
e084f69017 ovsdb-server: Fix various memory leaks.
Some of these are serious leaks, in that they could leak some amount of
memory for every transaction processed by the database server.

Found with valgrind.
2010-02-02 15:21:09 -08:00
Ben Pfaff
108496163d stream: Remove spurious #includes from header file. 2010-01-06 14:32:22 -08:00
Ben Pfaff
0b1fae1b73 ovsdb-server: Make database connections configurable from database itself.
Most importantly this adds a "managers" column to the vswitch database
that specifies where the ovsdb-server should connect.
2010-01-04 10:05:51 -08:00
Ben Pfaff
4931f33ad9 ovsdb-server: Factor out complication by using jsonrpc_session. 2010-01-04 09:47:01 -08:00
Ben Pfaff
57972e2ed7 ovsdb-server: Remove write-only struct member. 2009-12-17 13:48:09 -08:00
Ben Pfaff
6dea5eaf5c ovsdb-server: Open --listen sockets before detaching.
This prevents a race condition in a command sequence that starts
ovsdb-server and then immediately connects to it with ovsdb-client.
2009-12-03 14:47:00 -08:00
Ben Pfaff
20bed8be25 jsonrpc: Make it easy to get a new JSON-RPC request's id. 2009-12-02 11:19:08 -08:00
Ben Pfaff
23f37a975e ovsdb-server: Fix crash for invalid parameters to "monitor" request.
Thanks to Jeremy Stribling <strib@nicira.com> for reporting the problem.
2009-11-18 11:32:16 -08:00
Ben Pfaff
a8425c53c5 ovsdb: Monitor support. 2009-11-17 16:02:46 -08:00
Ben Pfaff
22f156fd06 ovsdb-server: Ignore replies to echo requests.
Until this commit, ovsdb-server would send off echo requests when the
connection became idle, but then it would terminate the connection when
the reply arrived, because it didn't recognize that it was a reply to its
own request (!).
2009-11-16 16:56:07 -08:00
Ben Pfaff
b93d3b6cb2 ovsdb: Refactor JSON-RPC database server implementation.
This refactoring breaks up jsonrpc-server.c in a more modular fashion, in
preparation for adding code for table monitors.
2009-11-16 10:55:29 -08:00
Ben Pfaff
6e79e2104c ovsdb: Fix use of non-array for JSON-RPC parameters.
JSON-RPC requires that "params" be an array, but we weren't observing this
properly in the ovsdb specifications or code.

Thanks to Jeremy Stribling for pointing out the problem.
2009-11-16 09:20:40 -08:00
Ben Pfaff
6c2882f90c ovsdb-server: Reconnect to clients specified on --connect. 2009-11-12 12:58:53 -08:00
Ben Pfaff
c2bffba3ee ovsdb: Make JSON-RPC sessions other than the first work.
The number of open sessions wasn't being tracked properly, so closing a
JSON-RPC database session made it impossible to open any more.
2009-11-06 12:26:22 -08:00
Jeremy Stribling
dc268c788e ovsdb: Fix bug in JSON-RPC server. 2009-11-06 10:55:37 -08:00
Ben Pfaff
f85f8ebbfa Initial implementation of OVSDB. 2009-11-04 17:12:10 -08:00