summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2020-01-09 12:49:44 -0800
committerBen Pfaff <blp@ovn.org>2020-01-24 13:00:52 -0800
commit79eadafeb1b47a3871cb792aa972f6e4d89d1a0b (patch)
tree1398babc34fef8269a052529304335f855da89b9 /ofproto/ofproto.c
parent586cd3101e7fda54d14fb5bf12d847f35d968627 (diff)
downloadopenvswitch-79eadafeb1b47a3871cb792aa972f6e4d89d1a0b.tar.gz
ofproto: Do not delete datapath flows on exit by default.
Commit e96a5c24e853 ("upcall: Remove datapath flows when setting n-threads.") caused OVS to delete datapath flows when it exits through any graceful means. This is not necessarily desirable, especially when OVS is being stopped as part of an upgrade. This commit changes OVS so that it only removes datapath flows when requested, via "ovs-appctl exit --cleanup". Acked-by: Numan Siddique <numans@ovn.org> Tested-by: Numan Siddique <numans@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 08830d837..5d69a4332 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -1601,13 +1601,13 @@ ofproto_rule_delete(struct ofproto *ofproto, struct rule *rule)
}
static void
-ofproto_flush__(struct ofproto *ofproto)
+ofproto_flush__(struct ofproto *ofproto, bool del)
OVS_EXCLUDED(ofproto_mutex)
{
struct oftable *table;
/* This will flush all datapath flows. */
- if (ofproto->ofproto_class->flush) {
+ if (del && ofproto->ofproto_class->flush) {
ofproto->ofproto_class->flush(ofproto);
}
@@ -1710,7 +1710,7 @@ ofproto_destroy(struct ofproto *p, bool del)
return;
}
- ofproto_flush__(p);
+ ofproto_flush__(p, del);
HMAP_FOR_EACH_SAFE (ofport, next_ofport, hmap_node, &p->ports) {
ofport_destroy(ofport, del);
}
@@ -2288,7 +2288,7 @@ void
ofproto_flush_flows(struct ofproto *ofproto)
{
COVERAGE_INC(ofproto_flush);
- ofproto_flush__(ofproto);
+ ofproto_flush__(ofproto, false);
connmgr_flushed(ofproto->connmgr);
}