2
0
mirror of https://github.com/openvswitch/ovs synced 2025-09-01 14:55:18 +00:00

ovs-vsctl: Fix performance problem.

This commit is contained in:
Ben Pfaff
2009-12-09 13:29:02 -08:00
parent dfbe07ba61
commit 586bb84a49
4 changed files with 12 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#include "ovsdb-data.h" #include "ovsdb-data.h"
#include "ovsdb-error.h" #include "ovsdb-error.h"
#include "ovsdb-idl-provider.h" #include "ovsdb-idl-provider.h"
#include "poll-loop.h"
#include "shash.h" #include "shash.h"
#include "util.h" #include "util.h"
@@ -800,6 +801,14 @@ ovsdb_idl_txn_destroy(struct ovsdb_idl_txn *txn)
free(txn); free(txn);
} }
void
ovsdb_idl_txn_wait(const struct ovsdb_idl_txn *txn)
{
if (txn->status != TXN_INCOMPLETE) {
poll_immediate_wake();
}
}
static struct json * static struct json *
where_uuid_equals(const struct uuid *uuid) where_uuid_equals(const struct uuid *uuid)
{ {

View File

@@ -42,6 +42,7 @@ const char *ovsdb_idl_txn_status_to_string(enum ovsdb_idl_txn_status);
struct ovsdb_idl_txn *ovsdb_idl_txn_create(struct ovsdb_idl *); struct ovsdb_idl_txn *ovsdb_idl_txn_create(struct ovsdb_idl *);
void ovsdb_idl_txn_destroy(struct ovsdb_idl_txn *); void ovsdb_idl_txn_destroy(struct ovsdb_idl_txn *);
void ovsdb_idl_txn_wait(const struct ovsdb_idl_txn *);
enum ovsdb_idl_txn_status ovsdb_idl_txn_commit(struct ovsdb_idl_txn *); enum ovsdb_idl_txn_status ovsdb_idl_txn_commit(struct ovsdb_idl_txn *);
void ovsdb_idl_txn_abort(struct ovsdb_idl_txn *); void ovsdb_idl_txn_abort(struct ovsdb_idl_txn *);

View File

@@ -1479,6 +1479,7 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step)
while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) { while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) {
ovsdb_idl_run(idl); ovsdb_idl_run(idl);
ovsdb_idl_wait(idl); ovsdb_idl_wait(idl);
ovsdb_idl_txn_wait(txn);
poll_block(); poll_block();
} }
printf("%03d: commit, status=%s\n", printf("%03d: commit, status=%s\n",

View File

@@ -954,6 +954,7 @@ do_vsctl(int argc, char *argv[], struct ovsdb_idl *idl)
while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) { while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) {
ovsdb_idl_run(idl); ovsdb_idl_run(idl);
ovsdb_idl_wait(idl); ovsdb_idl_wait(idl);
ovsdb_idl_txn_wait(txn);
poll_block(); poll_block();
} }
ovsdb_idl_txn_destroy(txn); ovsdb_idl_txn_destroy(txn);