When ovn-controller implemented incremental processing, the set of patched datapaths was revised on each trip through the main loop, so it was necessary to notice datapaths that shouldn't exist anymore and remove them.
With incremental processing gone, the set of patched datapaths is built and torn down on every trip through the main loop, so there will never be any stale datapaths. This commit retires the concept. Signed-off-by: Ben Pfaff <[email protected]> --- ovn/controller/ovn-controller.h | 2 -- ovn/controller/patch.c | 34 ---------------------------------- 2 files changed, 36 deletions(-) diff --git a/ovn/controller/ovn-controller.h b/ovn/controller/ovn-controller.h index 4dcf4e5..78c8b08 100644 --- a/ovn/controller/ovn-controller.h +++ b/ovn/controller/ovn-controller.h @@ -68,8 +68,6 @@ struct patched_datapath { struct hmap_node hmap_node; struct uuid key; /* UUID of the corresponding datapath. */ bool local; /* 'True' if the datapath is for gateway router. */ - bool stale; /* 'True' if the datapath is not referenced by any patch - * port. */ }; struct patched_datapath *get_patched_datapath(const struct hmap *, diff --git a/ovn/controller/patch.c b/ovn/controller/patch.c index c9a5dd9..79a7d81 100644 --- a/ovn/controller/patch.c +++ b/ovn/controller/patch.c @@ -257,47 +257,16 @@ add_patched_datapath(struct hmap *patched_datapaths, struct patched_datapath *pd = get_patched_datapath(patched_datapaths, binding_rec->datapath->tunnel_key); if (pd) { - /* If the patched datapath is referenced by a logical patch port it is - * not stale, by definition, so set 'stale' to false */ - pd->stale = false; return; } pd = xzalloc(sizeof *pd); pd->local = local; pd->key = binding_rec->datapath->header_.uuid; - /* stale is set to false. */ hmap_insert(patched_datapaths, &pd->hmap_node, binding_rec->datapath->tunnel_key); } -static void -add_logical_patch_ports_preprocess(struct hmap *patched_datapaths) -{ - /* Mark all patched datapaths as stale for later cleanup by - * add_logical_patch_ports_postprocess(). */ - struct patched_datapath *pd; - HMAP_FOR_EACH (pd, hmap_node, patched_datapaths) { - pd->stale = true; - } -} - -/* This function should cleanup stale patched datapaths and any memory - * allocated for fields within a stale patched datapath. */ -static void -add_logical_patch_ports_postprocess(struct hmap *patched_datapaths) -{ - /* Clean up stale patched datapaths. */ - struct patched_datapath *pd_cur_node, *pd_next_node; - HMAP_FOR_EACH_SAFE (pd_cur_node, pd_next_node, hmap_node, - patched_datapaths) { - if (pd_cur_node->stale == true) { - hmap_remove(patched_datapaths, &pd_cur_node->hmap_node); - free(pd_cur_node); - } - } -} - /* Add one OVS patch port for each OVN logical patch port. * * This is suboptimal for several reasons. First, it creates an OVS port for @@ -333,8 +302,6 @@ add_logical_patch_ports(struct controller_ctx *ctx, return; } - add_logical_patch_ports_preprocess(patched_datapaths); - const struct sbrec_port_binding *binding; SBREC_PORT_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) { const char *patch_port_id = "ovn-logical-patch-port"; @@ -370,7 +337,6 @@ add_logical_patch_ports(struct controller_ctx *ctx, } } } - add_logical_patch_ports_postprocess(patched_datapaths); } void -- 2.10.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
