diff mbox series

[ovs-dev,01/14] northd: Remove bfd_connections from northd_data.

Message ID 20230513000356.2475960-2-hzhou@ovn.org
State Changes Requested
Headers show
Series ovn-northd incremental processing for VIF changes | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Han Zhou May 13, 2023, 12:03 a.m. UTC
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(-)
diff mbox series

Patch

diff --git a/northd/en-lflow.c b/northd/en-lflow.c
index c1951c8c8c20..bed7bb001e20 100644
--- a/northd/en-lflow.c
+++ b/northd/en-lflow.c
@@ -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);
diff --git a/northd/northd.c b/northd/northd.c
index 25df0957eaa2..fdd8a21138ef 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -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) {
diff --git a/northd/northd.h b/northd/northd.h
index a503f4a6675a..385c8adce4ea 100644
--- a/northd/northd.h
+++ b/northd/northd.h
@@ -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;