File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2008, 2009 Nicira Networks.
2+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -76,6 +76,8 @@ struct fail_open {
7676 struct rconn_packet_counter * bogus_packet_counter ;
7777};
7878
79+ static void fail_open_recover (struct fail_open * );
80+
7981/* Returns true if 'fo' should be in fail-open mode, otherwise false. */
8082static inline bool
8183should_fail_open (const struct fail_open * fo )
@@ -155,7 +157,15 @@ fail_open_run(struct fail_open *fo)
155157void
156158fail_open_maybe_recover (struct fail_open * fo )
157159{
158- if (fail_open_is_active (fo ) && rconn_is_admitted (fo -> controller )) {
160+ if (rconn_is_admitted (fo -> controller )) {
161+ fail_open_recover (fo );
162+ }
163+ }
164+
165+ static void
166+ fail_open_recover (struct fail_open * fo )
167+ {
168+ if (fail_open_is_active (fo )) {
159169 flow_t flow ;
160170
161171 VLOG_WARN ("No longer in fail-open mode" );
235245fail_open_destroy (struct fail_open * fo )
236246{
237247 if (fo ) {
248+ fail_open_recover (fo );
238249 /* We don't own fo->controller. */
239250 switch_status_unregister (fo -> ss_cat );
240251 rconn_packet_counter_destroy (fo -> bogus_packet_counter );
Original file line number Diff line number Diff line change @@ -679,6 +679,9 @@ ofproto_destroy(struct ofproto *p)
679679 return ;
680680 }
681681
682+ /* Destroy fail-open early, because it touches the classifier. */
683+ ofproto_set_failure (p , false);
684+
682685 ofproto_flush_flows (p );
683686 classifier_destroy (& p -> cls );
684687
@@ -697,7 +700,6 @@ ofproto_destroy(struct ofproto *p)
697700 switch_status_destroy (p -> switch_status );
698701 in_band_destroy (p -> in_band );
699702 discovery_destroy (p -> discovery );
700- fail_open_destroy (p -> fail_open );
701703 pinsched_destroy (p -> miss_sched );
702704 pinsched_destroy (p -> action_sched );
703705 netflow_destroy (p -> netflow );
You can’t perform that action at this time.
0 commit comments