projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tunneling: Add support for tunnel ID.
[openvswitch]
/
ofproto
/
fail-open.c
diff --git
a/ofproto/fail-open.c
b/ofproto/fail-open.c
index 54a91cdfd76a7f518c24612c4da816955fc7b825..e866c571cf71a067b2b6c4a5120e18b20fcc833f 100644
(file)
--- a/
ofproto/fail-open.c
+++ b/
ofproto/fail-open.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009
, 2010
Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-76,6
+76,8
@@
struct fail_open {
struct rconn_packet_counter *bogus_packet_counter;
};
struct rconn_packet_counter *bogus_packet_counter;
};
+static void fail_open_recover(struct fail_open *);
+
/* Returns true if 'fo' should be in fail-open mode, otherwise false. */
static inline bool
should_fail_open(const struct fail_open *fo)
/* Returns true if 'fo' should be in fail-open mode, otherwise false. */
static inline bool
should_fail_open(const struct fail_open *fo)
@@
-155,7
+157,15
@@
fail_open_run(struct fail_open *fo)
void
fail_open_maybe_recover(struct fail_open *fo)
{
void
fail_open_maybe_recover(struct fail_open *fo)
{
- if (fail_open_is_active(fo) && rconn_is_admitted(fo->controller)) {
+ if (rconn_is_admitted(fo->controller)) {
+ fail_open_recover(fo);
+ }
+}
+
+static void
+fail_open_recover(struct fail_open *fo)
+{
+ if (fail_open_is_active(fo)) {
flow_t flow;
VLOG_WARN("No longer in fail-open mode");
flow_t flow;
VLOG_WARN("No longer in fail-open mode");
@@
-163,7
+173,7
@@
fail_open_maybe_recover(struct fail_open *fo)
fo->next_bogus_packet_in = LLONG_MAX;
memset(&flow, 0, sizeof flow);
fo->next_bogus_packet_in = LLONG_MAX;
memset(&flow, 0, sizeof flow);
- ofproto_delete_flow(fo->ofproto, &flow, O
FP
FW_ALL, FAIL_OPEN_PRIORITY);
+ ofproto_delete_flow(fo->ofproto, &flow, O
VS
FW_ALL, FAIL_OPEN_PRIORITY);
}
}
}
}
@@
-191,7
+201,7
@@
fail_open_flushed(struct fail_open *fo)
action.output.len = htons(sizeof action);
action.output.port = htons(OFPP_NORMAL);
memset(&flow, 0, sizeof flow);
action.output.len = htons(sizeof action);
action.output.port = htons(OFPP_NORMAL);
memset(&flow, 0, sizeof flow);
- ofproto_add_flow(fo->ofproto, &flow, O
FP
FW_ALL, FAIL_OPEN_PRIORITY,
+ ofproto_add_flow(fo->ofproto, &flow, O
VS
FW_ALL, FAIL_OPEN_PRIORITY,
&action, 1, 0);
}
}
&action, 1, 0);
}
}
@@
-235,6
+245,7
@@
void
fail_open_destroy(struct fail_open *fo)
{
if (fo) {
fail_open_destroy(struct fail_open *fo)
{
if (fo) {
+ fail_open_recover(fo);
/* We don't own fo->controller. */
switch_status_unregister(fo->ss_cat);
rconn_packet_counter_destroy(fo->bogus_packet_counter);
/* We don't own fo->controller. */
switch_status_unregister(fo->ss_cat);
rconn_packet_counter_destroy(fo->bogus_packet_counter);