git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
monitor: Fix improper use of stubs.
[sliver-openvswitch.git]
/
ofproto
/
ofproto-dpif-governor.c
diff --git
a/ofproto/ofproto-dpif-governor.c
b/ofproto/ofproto-dpif-governor.c
index
a2ada30
..
459f871
100644
(file)
--- a/
ofproto/ofproto-dpif-governor.c
+++ b/
ofproto/ofproto-dpif-governor.c
@@
-18,7
+18,6
@@
#include "ofproto-dpif-governor.h"
#include "ofproto-dpif-governor.h"
-#include <assert.h>
#include <stdlib.h>
#include "coverage.h"
#include <stdlib.h>
#include "coverage.h"
@@
-54,13
+53,11
@@
enum { MAX_ELAPSED = 5000 }; /* In milliseconds. */
static void governor_new_generation(struct governor *, unsigned int size);
static void governor_new_generation(struct governor *, unsigned int size);
-/* Creates and returns a new governor named 'name' (which is used only for log
- * messages). */
+/* Creates and returns a new governor. */
struct governor *
struct governor *
-governor_create(
const char *name
)
+governor_create(
void
)
{
struct governor *g = xzalloc(sizeof *g);
{
struct governor *g = xzalloc(sizeof *g);
- g->name = xstrdup(name);
governor_new_generation(g, MIN_SIZE);
return g;
}
governor_new_generation(g, MIN_SIZE);
return g;
}
@@
-70,8
+67,7
@@
void
governor_destroy(struct governor *g)
{
if (g) {
governor_destroy(struct governor *g)
{
if (g) {
- VLOG_INFO("%s: disengaging", g->name);
- free(g->name);
+ VLOG_INFO("disengaging");
free(g->table);
free(g);
}
free(g->table);
free(g);
}
@@
-121,7
+117,7
@@
governor_should_install_flow(struct governor *g, uint32_t hash, int n)
bool install_flow;
uint8_t *e;
bool install_flow;
uint8_t *e;
- assert(n > 0);
+
ovs_
assert(n > 0);
/* Count these packets and begin a new generation if necessary. */
g->n_packets += n;
/* Count these packets and begin a new generation if necessary. */
g->n_packets += n;
@@
-177,19
+173,18
@@
governor_should_install_flow(struct governor *g, uint32_t hash, int n)
static void
governor_new_generation(struct governor *g, unsigned int size)
{
static void
governor_new_generation(struct governor *g, unsigned int size)
{
- assert(size >= MIN_SIZE && size <= MAX_SIZE);
- assert(is_pow2(size));
+
ovs_
assert(size >= MIN_SIZE && size <= MAX_SIZE);
+
ovs_
assert(is_pow2(size));
/* Allocate new table, if necessary. */
if (g->size != size) {
if (!g->size) {
/* Allocate new table, if necessary. */
if (g->size != size) {
if (!g->size) {
- VLOG_INFO("%s: engaging governor with %u kB hash table",
- g->name, size / 1024);
+ VLOG_INFO("engaging governor with %u kB hash table", size / 1024);
} else {
} else {
- VLOG_INFO("
%s:
processed %u packets in %.2f s, "
+ VLOG_INFO("processed %u packets in %.2f s, "
"%s hash table to %u kB "
"(%u hashes, %u setups, %u shortcuts)",
"%s hash table to %u kB "
"(%u hashes, %u setups, %u shortcuts)",
- g->n
ame, g->n
_packets,
+ g->n_packets,
(time_msec() - g->start) / 1000.0,
size > g->size ? "enlarging" : "shrinking",
size / 1024,
(time_msec() - g->start) / 1000.0,
size > g->size ? "enlarging" : "shrinking",
size / 1024,
@@
-200,9
+195,9
@@
governor_new_generation(struct governor *g, unsigned int size)
g->table = xmalloc(size * sizeof *g->table);
g->size = size;
} else {
g->table = xmalloc(size * sizeof *g->table);
g->size = size;
} else {
- VLOG_DBG("
%s:
processed %u packets in %.2f s with %u kB hash table "
+ VLOG_DBG("processed %u packets in %.2f s with %u kB hash table "
"(%u hashes, %u setups, %u shortcuts)",
"(%u hashes, %u setups, %u shortcuts)",
- g->n
ame, g->n
_packets, (time_msec() - g->start) / 1000.0,
+ g->n_packets, (time_msec() - g->start) / 1000.0,
size / 1024, g->n_flows, g->n_setups, g->n_shortcuts);
}
size / 1024, g->n_flows, g->n_setups, g->n_shortcuts);
}