mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 07:15:17 +00:00
ovs-vsctl: Fix performance problem.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "ovsdb-data.h"
|
||||
#include "ovsdb-error.h"
|
||||
#include "ovsdb-idl-provider.h"
|
||||
#include "poll-loop.h"
|
||||
#include "shash.h"
|
||||
#include "util.h"
|
||||
|
||||
@@ -800,6 +801,14 @@ ovsdb_idl_txn_destroy(struct ovsdb_idl_txn *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 *
|
||||
where_uuid_equals(const struct uuid *uuid)
|
||||
{
|
||||
|
@@ -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 *);
|
||||
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 *);
|
||||
void ovsdb_idl_txn_abort(struct ovsdb_idl_txn *);
|
||||
|
||||
|
@@ -1479,6 +1479,7 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step)
|
||||
while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) {
|
||||
ovsdb_idl_run(idl);
|
||||
ovsdb_idl_wait(idl);
|
||||
ovsdb_idl_txn_wait(txn);
|
||||
poll_block();
|
||||
}
|
||||
printf("%03d: commit, status=%s\n",
|
||||
|
@@ -954,6 +954,7 @@ do_vsctl(int argc, char *argv[], struct ovsdb_idl *idl)
|
||||
while ((status = ovsdb_idl_txn_commit(txn)) == TXN_INCOMPLETE) {
|
||||
ovsdb_idl_run(idl);
|
||||
ovsdb_idl_wait(idl);
|
||||
ovsdb_idl_txn_wait(txn);
|
||||
poll_block();
|
||||
}
|
||||
ovsdb_idl_txn_destroy(txn);
|
||||
|
Reference in New Issue
Block a user