summaryrefslogtreecommitdiff
path: root/ovsdb
Commit message (Collapse)AuthorAgeFilesLines
* ovsdb: Force columns that contain weak references to be immutable.Ben Pfaff2016-04-112-9/+21
| | | | | | | | | | An immutable weak reference is a hole in the constraint system: if referenced rows are deleted, then the weak reference needs to change. Therefore, force columsn that contain weak references to be mutable. Reported-by: "Elluru, Krishna Mohan" <elluru.kri.mohan@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Ryan Moats <rmoats@us.ibm.com>
* ovsdb: Use previous snapshot size as an additional factor for compaction.Ben Pfaff2016-03-312-9/+31
| | | | | | | | | | | | | | Until now, the minimum database size before automatically compacting has been 10 MB, regardless of the inherent size of the data in the database. A couple of people have pointed out that this won't scale well to larger databases. This commit changes this criterion to 4 times the previously compacted size of the database, with 10 MB as a minimum. The 4x factor is suggested by Diego Ongaro's thesis, "Consensus: Bridging Theory and Practice", section 5.1.2 "When to snapshot". Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
* ovsdb: Improve error message from ovsdb_log_open() open failure.Ben Pfaff2016-03-301-1/+1
| | | | | | | | | | | Previously, error messages ended up looking like: ovsdb-tool: I/O error: create: $DBFILE failed (File exists) which is hard to understand. This commit changes them to: ovsdb-tool: I/O error: $DBFILE: create failed (File exists) which makes more sense. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* list: Rename all functions in list.h with ovs_ prefix.Ben Warren2016-03-307-49/+49
| | | | | | | This attempts to prevent namespace collisions with other list libraries Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* list: Remove lib/list.h completely.Ben Warren2016-03-306-6/+6
| | | | | | | | All code is now in include/openvswitch/list.h. Signed-off-by: Ben Warren <ben@skyportsystems.com> Acked-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Remove unused "struct ovsdb_log_read_cbdata".Ben Pfaff2016-03-281-7/+0
| | | | | Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
* Move lib/dynamic-string.h to include/openvswitch directoryBen Warren2016-03-198-8/+8
| | | | | Signed-off-by: Ben Warren <ben@skyportsystems.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-server: Add Json cache count to memory/showAndy Zhou2016-03-101-0/+5
| | | | | | | | Add the size of json cache to the data reported by ovsdb-server appctl "memory/show" command. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-server: Fix a reference count leak bugandy zhou2016-03-083-7/+12
| | | | | | | | | | | | | | | | | | | | | When destroying an ovsdb_jsonrpc_monitor, the jsonrpc monitor still holds a reference count to the monitors 'changes' indexed with 'unflushed' transaction id. The bug is that the reference count was not decremented as it should in the code path. The bug caused 'changes' that have been flushed to all jsonrpc clients to linger around unnecessarily, occupying increasingly large amount of memory. See "Reported-at" URL for more details. This bug is tricky to find since the memory is not leaked; they will eventually be freed when monitors are destroyed. Reported-by: Lei Huang <huang.f.lei@gmail.com> Reported-at: http://openvswitch.org/pipermail/dev/2016-March/067274.html Signed-off-by: Andy Zhou <azhou@ovn.org> Tested-by: Han Zhou <zhouhan@gmail.com> Acked-by: Han Zhou <zhouhan@gmail.com> Acked-by: Liran Schour <lirans@il.ibm.com>
* ovsdb-server: Refactoring and clean up remote status reporting.Andy Zhou2016-02-281-17/+41
| | | | | | | | | | | | When reporting remote status, A listening remote will randomly pick a session and report its session status. This does not seem to make much sense. It is probably better to leave those fields untouched. Update ovs-vswitchd.conf.db(5) to match the change in implementation. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: avoid unnecessary call to ovsdb_monitor_get_update()Andy Zhou2016-02-241-0/+4
| | | | | | | | | | | | Optimizing ovsdb_jsonrpc_mintor_flush_all() by avoiding calling ovsdb_monitor_get_update() on monitors that do not have any unflushed updates. This change saves CPU cycles on ovsdb-server's main loop, but should not introduce any client visible changes. Reported-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Liran Schour <lirans@il.ibm.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: rename variables in ovsdb_monitor_get_update()Andy Zhou2016-02-241-10/+10
| | | | | | | | | 'prev_txn' and 'next_txn" are more confusing than 'unflushed' and 'unflushed_next'. Rename them. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Liran Schour <lirans@il.ibm.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Fix one off error in tracking monitor changesAndy Zhou2016-02-241-2/+15
| | | | | | | | | | | | | | | | | | dbmon's changes should be stored with the next transaction number, rather than the current transaction number. This bug causes the changes of a transaction stored in a monitor to be unnoticed by the jsonrpc connections that is responsible for flush the monitor content. However, the bug was not noticed until it was exposed by a later optimization patch: "avoid unnecessary call to ovsdb_monitor_get_update()." The lack of optimization means that the update is still generated when 'unflushed' equals to n_transactions + 1, which should have indicated the monitor has been flushed already. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Liran Schour <lirans@il.ibm.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-server: Eliminating max session limitandy zhou2016-02-101-21/+14
| | | | | | | | | | | | | | | This patch removes limits on number of concurrent sessions allowed by ovsdb-server. Historically, it was not an design goal for OVSDB server to support very high number of sessions. The imposed limit reflects those design choices. Work is now underway to improve OVSDB scalability since supporting large of number of sessions is important for OVN, Removing this limit makes scalability testing possible. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Han Zhou <zhouhan@gmail.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: Fix memory leak reported by valgind.William Tu2016-02-101-0/+1
| | | | | | | | | Testcase 1429: ovsdb-server/add-db and remove-db. xmemdup0 (util.c:142) main (ovsdb-client.c:133) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Fix typo in libovsdb's pkg-config.Ansari, Shad2016-02-051-1/+1
| | | | | | | | Fix typo in the library name of pkg-config of libovsdb. Reported-by: Javier Albornz <javier.albornoz@hpe.com> Signed-off-by: Shad Ansari <shad.ansari@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-server: fix monitor counters reported by memory/showAndy Zhou2016-02-054-1/+12
| | | | | | | | | | | | | | Commit 4c2809787cdbc774 (ovsdb-monitor: add json cache) introduced an optimization that allows jsonrpc session to share monitors. However, the memory/show implementation was not updated to match the implementation; it still assumes that each jsonrpc session uses its own monitor, thus are likely to over reporting the number. This patch fix the bug and reports the actual number of monitor used by the ovsdb-server. Signed-off-by: Andy Zhou <azhou@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-idl: Add support for column tracking in IDL.Shad Ansari2016-01-121-4/+11
| | | | | | | | | | Recent IDL change tracking patches allow quick traversal of changed rows. This patch adds additional support to track changed columns. It allows an IDL client to efficiently check if a specific column of a row was updated by IDL. Signed-off-by: Shad Ansari <shad.ansar@hpe.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: Fix memory leak reported by valgrind.William Tu2016-01-111-0/+3
| | | | | | | | | | | | | | | | testc ase 1427: ovsdb-server combines updates on backlogged connections. valgrind reports two leaks: unixctl_server_create (unixctl.c:250) do_monitor__ (ovsdb-client.c:918) and json_create (json.c:1406) json_integer_create (json.c:262) json_clone (json.c:413) do_monitor__ (ovsdb-client.c:958) Signed-off-by: William Tu <u9012063@gmail.com> Acked-by: Andy Zhou <azhou@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: Fix memory leak reported by valgrind.William Tu2016-01-111-0/+14
| | | | | | | | | | | | | | test case 1427: ovsdb-server combines updates on backlogged connections. ovsdb_column_set_add (column.c:233) add_column (ovsdb-client.c:730) parse_monitor_columns (ovsdb-client.c:787) add_monitored_table (ovsdb-client.c:872) do_monitor__ (ovsdb-client.c:945) Reported-by: William Tu <u9012063@gmail.com> Reported-at: http://openvswitch.org/pipermail/dev/2016-January/064161.html Signed-off-by: Andy Zhou <azhou@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: Fix memory leak reported by valgrind.William Tu2016-01-111-0/+1
| | | | | | | | | | | | | | | Test case 1508-1514: OVSDB -- ovsdb-server monitors, call stacks: ovsdb_schema_create (ovsdb.c:34) ovsdb_schema_from_json (ovsdb.c:196) fetch_schema (ovsdb-client.c:375) do_monitor__ (ovsdb-client.c:920) main (ovsdb-client.c:152) Fix by adding ovsdb_schema_destroy(). Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: Fix memory leak reported by valgrind.William Tu2016-01-041-4/+8
| | | | | | | | | | | | | | | | Free memory allocated from table_add_column and table_add_row. Test case: vsctl-bashcomp - basic verification/argument completion(7,8) Call stack is below: xrealloc (util.c:123) table_add_column (table.c:146) or table_add_row (table.c:172) do_list_tables (ovsdb-client.c:449) main (ovsdb-client.c:151) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com> [blp@ovn.org removed an unneeded "if"] Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-server: Fix memory leak using perf counter without initialization.William Tu2015-12-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | perf_counter_accumulate() is invoked without perf_counters_init() being called first, which leads to a memory leak reported by Valgrind (test cases 104, 106, and 107). A call trace is below: xmalloc (util.c:112) shash_add_nocopy__ (shash.c:109) shash_add_nocopy (shash.c:121) shash_add (shash.c:129) shash_add_once (shash.c:136) shash_add_assert (shash.c:146) perf_counter_init (perf-counter.c:86) perf_counter_accumulate (perf-counter.c:95) ovsdb_txn_commit (transaction.c:850) ovsdb_file_open__ (file.c:217) open_db (ovsdb-server.c:418) main (ovsdb-server.c:263) Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Co-authored-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: separate json cache for different monitor versionsHan Zhou2015-12-181-6/+20
| | | | | | | | | | | | | | Cached json objects were reused when sending notifications to clients. This created a problem when there were different versions of monitors coexisting. E.g. clients expecting version2 notification would receive messages with method == "update2" but payload in version1 format, which end up failure of processing the updates. This patch fixes the issue by including version in cache node. Signed-off-by: Han Zhou <zhouhan@gmail.com> Acked-by: Andy Zhou <azhou@ovn.org> Signed-off-by: Andy Zhou <azhou@ovn.org>
* jsonrpc-server: Use prototype style for ovsdb_jsonrpc_disable_monitor2().Ben Pfaff2015-12-151-1/+1
| | | | | | | | | | Without "void", this is a pre-ANSI style function definition that has subtly different semantics. Found by sparse. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
* ovsdb: test ovs-vswitchd for backward compatibilityAndy Zhou2015-12-113-1/+33
| | | | | | | | | | | | | | | | | | Add test to make sure ovs-vswitchd fall back to use the "monitor" method when connecting to an older ovsdb-server that does not support "monitor2". For testing backward compatibility, add an ovs-appctl command: "ovsdb-server/disable-monitor2". This command will restart all currently open jsonrpc connections, but without support for 'monitor2' JSON-RPC method for the new connections. There is no corresponding enable command, since this feature is only useful for testing. 'monitor2' will be available when ovsdb-server restarts. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: support monitor2Andy Zhou2015-12-113-13/+168
| | | | | | | | Add monitor2 option to ovsdb-client. See ovsdb-client(1) manpage patch for details. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: enable jasonrpc-server to service monitor2 requestAndy Zhou2015-12-111-6/+33
| | | | | | | | ovsdb-server now accepts the new "monitor2" request. The next patch will switch IDL to use monitor2 by default. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: generate update2 notification for a monitor2 sessionAndy Zhou2015-12-114-27/+219
| | | | | | | | | | Add functions that can generate "update2" notification for a "monitor2" session. "monitor2" and "update2" are RFC 7047 extensions described by ovsdb-server(1) manpage. See the manpage changes for more details. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb: refactor, add ovsdb_monitor_max_columns()Andy Zhou2015-12-111-10/+17
| | | | | | | This function will have multiple callers in later patches. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@ovn.org>
* ovsdb-client: Add optional table and columns to dump commandBert Vermeulen2015-12-012-22/+56
| | | | | | | | | | | Adding a table to the dump command's arguments retrieves only that table. One or more columns after the table retrieve only those columns. Default behavior is unchanged. Signed-off-by: Bert Vermeulen <bert@biot.com> [blp@ovn.org updated documentation and usage] Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb-idl: Add support for change tracking.Shad Ansari2015-11-231-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ovsdb-idl notifies a client that something changed; it does not track which table, row changed in what way (insert, modify or delete). As a result, a client has to scan or reconfigure the entire idl after ovsdb_idl_run(). This is presumably fine for typical ovs schemas where tables are relatively small. In use-cases where ovsdb is used with schemas that can have very large tables, the current ovsdb-idl notification mechanism does not appear to scale - clients need to do a lot of processing to determine the exact change delta. This change adds support for: - Table and row based change sequence numbers to record the most recent IDL change sequence numbers associated with insert, modify or delete update on that table or row. - Change tracking of specific columns. This ensures that changed rows (inserted, modified, deleted) that have tracked columns, are tracked by IDL. The client can directly access the changed rows with get_first, get_next operations without the need to scan the entire table. The tracking functionality is not enabled by default and needs to be turned on per-column by the client after ovsdb_idl_create() and before ovsdb_idl_run(). /* Example Usage */ idl = ovsdb_idl_create(...); /* Track specific columns */ ovsdb_idl_track_add_column(idl, column); /* Or, track all columns */ ovsdb_idl_track_add_all(idl); for (;;) { ovsdb_idl_run(idl); seqno = ovsdb_idl_get_seqno(idl); /* Process only the changed rows in Table FOO */ FOO_FOR_EACH_TRACKED(row, idl) { /* Determine the type of change from the row seqnos */ if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_DELETE) >= seqno)) { printf("row deleted\n"); } else if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_MODIFY) >= seqno)) printf("row modified\n"); } else if (foo_row_get_seqno(row, OVSDB_IDL_CHANGE_INSERT) >= seqno)) printf("row inserted\n"); } } /* All changes processed - clear the change track */ ovsdb_idl_track_clear(idl); } Signed-off-by: Shad Ansari <shad.ansari@hp.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ovsdb: Fix outdated comment for function description.Justin Pettit2015-10-221-3/+1
| | | | | Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* ovsdb: Destroy allocated hmap.Justin Pettit2015-10-221-0/+1
| | | | | Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* ovsdb-server: Destroy allocated shash.Justin Pettit2015-10-221-0/+1
| | | | | Signed-off-by: Justin Pettit <jpettit@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* lib/daemon: support --user option for all OVS daemonAndy Zhou2015-09-302-3/+5
| | | | | | | | | | OVS daemons can now support --user option to run as a non-root user with less privileges. See the manpage patch for more descriptions. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovsdb: Update _version more accurately in transaction commit.Ben Pfaff2015-09-041-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | The _version column in each OVSDB row is supposed to be updated whenever any other column in the row changes. However, the transaction code was not careful to do this only when a row actually changed--there were other cases where a row was considered at transaction commit time and _version updated even though the row did not actually change. For example, ovsdb_txn_adjust_atom_refs() calls find_or_make_txn_row(), which calls ovsdb_txn_row_modify(), which updates _version, but ovsdb_txn_adjust_atom_refs() doesn't actually update any data. One way to fix this would be to carefully consider and adjust all the code that looks at transaction rows. However, this seems somewhat error prone and thus difficult to test. This commit takes a different approach: it drops the code that adjusts _version on the fly, instead replacing it by a final pass over the database at the end of the commit process that checks for each row whether any columns changed and updates _version at that point if any did. That seems pretty foolproof to me. Reported-by: RishiRaj Maulick <rishi.raj2509@gmail.com> Reported-at: http://openvswitch.org/pipermail/dev/2015-August/059439.html Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com> Tested-by: RishiRaj Maulick <rishi.raj2509@gmail.com>
* ovsdb: Remove misleading OVS_UNUSED from ovsdb_monitor_change_cb().Ben Pfaff2015-08-311-1/+1
| | | | | | | | | This function does use this parameter. (This does not change any behavior.) Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* ovsdb-server: Add the ability to push peer-cert.Gurucharan Shetty2015-08-212-0/+8
| | | | | | | | | | In OVN, ovsdb-server is the daemon that manages the databases and can be called as the central controller. So it would be nice for ovsdb-server to be able to push its self-signed certificate to all the other nodes where ovn-controller runs. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Makefiles: Clean and do not distribute IDL-generated files.Ben Pfaff2015-07-221-0/+1
| | | | | | | | | | | | | | | | | | IDL-generated files don't need to be distributed, and distributing them puts them in the source directory rather than the build directory, which causes "make distcheck" to fail if any of them need to be remade. To prevent this, this commit this removes them from ..._SOURCES, moving them into nodist_..._SOURCES. IDL-generated files all need to be cleaned, so this commit adds all of them to CLEANFILES wholesale via a single CLEANFILES += $(OVSIDL_BUILT) line in ovsdb/automake.mk, removing the individual additions from various makefiles. With this commit, "make distcheck" passes for me. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Aaron Conole <aaron@bytheb.org>
* ovsdb: Add per transaction commit instruction counterAndy Zhou2015-07-171-2/+12
| | | | | | | | | | | | | | | | | | | | | | Measure user space only instruction counters for commit each transaction. This measurement is mainly useful for tuning OVSDB internal implementation, such as how OVSDB scales over number of client connections. A simple usage example: ovs-appctl -t ovsdb-server ovsdb-server/perf-counters-clear ovs-vsctl add-port br0 p3 ovs-appctl -t ovsdb-server ovsdb-server/perf-counters-show ovsdb_txn_commit 2 906922 453461.0 The commands above show that the 'add-port br p3' command caused ovsdb to execute 2 transactions. Each transaction takes 453461 instructions, total 906922 instructions. The number will vary based on number of ovsdb clients connected. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* nroff: Fix style of names.Ben Pfaff2015-07-061-12/+12
| | | | | | | | | | | | | The recommended Google Python style is multi_word_names, not multiWordNames. There are lots of other places where the style could be improved. I started here because I was working in this code anyway and because this code is only used at build time and not installed, so that it can't break any third-party code. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Justin Pettit <jpettit@nicira.com>
* ovsdb: Flush JSON cache only when necessaryAndy Zhou2015-06-231-2/+11
| | | | | | | | | | | Currently, JSON cache is always flushed whenever the monitor receives a transaction. This patch improves the JSON cache efficiency by only flush the JSON cache when a transaction causes client visible changes, avoiding unnecessary flushes. Suggested-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovsdb: Only update monitor when necessaryAndy Zhou2015-06-231-1/+71
| | | | | | | | Some DB modification transactions won't affect the columns of a monitor. Skip those updates. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovsdb: add ovsdb_monitor_row_update_type()Andy Zhou2015-06-231-4/+10
| | | | | | | | The logic of determining row update type will be useful in the following patch. Make it into a function. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* Makefiles: Stop distributing files because building them requires Python.Ben Pfaff2015-06-231-1/+0
| | | | | | | | | | | | A long time ago, the Open vSwitch build did not depend on Python (whereas the runtime did), so the "make dist" based distribution included the results of Python build tools. Later, the build began using Python, but the distribution still included some of those results, because no one had gone to the trouble of changing them. This commit changes the Makefiles not to distribute Python-generated files but instead to just generate them at build time. Signed-off-by: Ben Pfaff <blp@nicira.com>
* ovsdb-monitor: add json cacheAndy Zhou2015-06-083-24/+103
| | | | | | | | | | | | | | | | | | | Although multiple jsonrpc monitors can share the same ovsdb monitor, each change still needs to translated into json object from scratch. This can be wasteful if multiple jsonrpc monitors are interested in the same changes. Json cache improves this by keeping an copy of json object generated for transaction X to current transaction. When jsonrpc is interested in a change, the cache is searched first, if an json object is found, a copy of it is handed back, skipping the regeneration process. Any commit to the monitor will empty the cache. This can be further optimized to not throw away the cache if the updated tables and columns are not being monitored. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovsdb-monitor: allow multiple jsonrpc monitors to share a single ovsdbAndy Zhou2015-06-083-15/+141
| | | | | | | | | | | | | | | | | monitor Store ovsdb monitor in a global hmap. If a newly created ovsdb monitor object monitors the same tables and columns as an existing one, the existing monitor will be reused. With this patch, jsonrpc monitor and ovsdb monitor now have N:1 mapping. The goals are to: 1) Reduce the cost of maintaining duplicated monitors. 2) Allow for create Json cache for the same updates. Json cache will be introduced in the following patch. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovsdb-monitor: refactor ovsdb_monitor_create()Andy Zhou2015-06-081-5/+12
| | | | | | | | Add ovsdb_monitor_add_jsonrpc_monitor(). This change will allow ovsdb_monitor to be reference counted. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
* ovsdb-monitor: allow multiple of 'ovsdb_monitor_changes' in each ovsdb ↵Andy Zhou2015-05-291-40/+86
| | | | | | | monitor table Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>