@@ -38,6 +38,8 @@ void en_lflow_run(struct engine_node *node, void *data OVS_UNUSED)
struct northd_data *northd_data = engine_get_input_data("northd", node);
+ struct hmap bfd_connections = HMAP_INITIALIZER(&bfd_connections);
+
lflow_input.nbrec_bfd_table =
EN_OVSDB_GET(engine_get_input("NB_bfd", node));
lflow_input.sbrec_bfd_table =
@@ -61,7 +63,7 @@ void en_lflow_run(struct engine_node *node, void *data OVS_UNUSED)
lflow_input.port_groups = &northd_data->port_groups;
lflow_input.meter_groups = &northd_data->meter_groups;
lflow_input.lbs = &northd_data->lbs;
- lflow_input.bfd_connections = &northd_data->bfd_connections;
+ lflow_input.bfd_connections = &bfd_connections;
lflow_input.features = &northd_data->features;
lflow_input.ovn_internal_version_changed =
northd_data->ovn_internal_version_changed;
@@ -70,11 +72,12 @@ void en_lflow_run(struct engine_node *node, void *data OVS_UNUSED)
build_bfd_table(eng_ctx->ovnsb_idl_txn,
lflow_input.nbrec_bfd_table,
lflow_input.sbrec_bfd_table,
- &northd_data->bfd_connections,
+ &bfd_connections,
&northd_data->lr_ports);
build_lflows(&lflow_input, eng_ctx->ovnsb_idl_txn);
bfd_cleanup_connections(lflow_input.nbrec_bfd_table,
- &northd_data->bfd_connections);
+ &bfd_connections);
+ hmap_destroy(&bfd_connections);
stopwatch_stop(BUILD_LFLOWS_STOPWATCH_NAME, time_msec());
engine_set_node_state(node, EN_UPDATED);
@@ -16473,7 +16473,6 @@ northd_init(struct northd_data *data)
shash_init(&data->meter_groups);
hmap_init(&data->lbs);
hmap_init(&data->lb_groups);
- hmap_init(&data->bfd_connections);
ovs_list_init(&data->lr_list);
data->features = (struct chassis_features) {
.ct_no_masked_label = true,
@@ -16504,7 +16503,6 @@ northd_destroy(struct northd_data *data)
}
hmap_destroy(&data->port_groups);
- hmap_destroy(&data->bfd_connections);
struct shash_node *node;
SHASH_FOR_EACH_SAFE (node, &data->meter_groups) {
@@ -94,7 +94,6 @@ struct northd_data {
struct shash meter_groups;
struct hmap lbs;
struct hmap lb_groups;
- struct hmap bfd_connections;
struct ovs_list lr_list;
bool ovn_internal_version_changed;
struct chassis_features features;
bfd_connections isn't related to the I-P engine node "northd". So move it from the northd_data to a local variable of en_lflow_run(). Signed-off-by: Han Zhou <hzhou@ovn.org> --- northd/en-lflow.c | 9 ++++++--- northd/northd.c | 2 -- northd/northd.h | 1 - 3 files changed, 6 insertions(+), 6 deletions(-)