The stopwatch "lflows_dp_groups" was stopped in the middle of syncing
lflows to SB. This patch adjust it properly and add the new stopwatch
"lflows_to_sb" to measure the time for syncing lflows to SB.

Signed-off-by: Han Zhou <[email protected]>
---
 lib/stopwatch-names.h | 1 +
 northd/northd.c       | 5 ++++-
 northd/ovn-northd.c   | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/stopwatch-names.h b/lib/stopwatch-names.h
index 572968ff0..de6fca4cc 100644
--- a/lib/stopwatch-names.h
+++ b/lib/stopwatch-names.h
@@ -29,5 +29,6 @@
 #define LFLOWS_LBS_STOPWATCH_NAME "lflows_lbs"
 #define LFLOWS_IGMP_STOPWATCH_NAME "lflows_igmp"
 #define LFLOWS_DP_GROUPS_STOPWATCH_NAME "lflows_dp_groups"
+#define LFLOWS_TO_SB_STOPWATCH_NAME "lflows_to_sb"
 
 #endif
diff --git a/northd/northd.c b/northd/northd.c
index 07707e10a..6771ccce5 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -14420,6 +14420,9 @@ void build_lflows(struct lflow_input *input_data,
 
     hmap_destroy(&single_dp_lflows);
 
+    stopwatch_stop(LFLOWS_DP_GROUPS_STOPWATCH_NAME, time_msec());
+    stopwatch_start(LFLOWS_TO_SB_STOPWATCH_NAME, time_msec());
+
     /* Push changes to the Logical_Flow table to database. */
     const struct sbrec_logical_flow *sbflow;
     SBREC_LOGICAL_FLOW_TABLE_FOR_EACH_SAFE (sbflow,
@@ -14544,7 +14547,6 @@ void build_lflows(struct lflow_input *input_data,
         }
     }
 
-    stopwatch_stop(LFLOWS_DP_GROUPS_STOPWATCH_NAME, time_msec());
     HMAP_FOR_EACH_SAFE (lflow, hmap_node, &lflows) {
         const char *pipeline = ovn_stage_get_pipeline_name(lflow->stage);
         uint8_t table = ovn_stage_get_table(lflow->stage);
@@ -14593,6 +14595,7 @@ void build_lflows(struct lflow_input *input_data,
     }
     hmap_destroy(&lflows);
 
+    stopwatch_stop(LFLOWS_TO_SB_STOPWATCH_NAME, time_msec());
     struct ovn_dp_group *dpg;
     HMAP_FOR_EACH_POP (dpg, node, &dp_groups) {
         bitmap_free(dpg->bitmap);
diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 96f17f15f..faf7cbeb5 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -815,6 +815,7 @@ main(int argc, char *argv[])
     stopwatch_create(LFLOWS_LBS_STOPWATCH_NAME, SW_MS);
     stopwatch_create(LFLOWS_IGMP_STOPWATCH_NAME, SW_MS);
     stopwatch_create(LFLOWS_DP_GROUPS_STOPWATCH_NAME, SW_MS);
+    stopwatch_create(LFLOWS_TO_SB_STOPWATCH_NAME, SW_MS);
 
     /* Initialize incremental processing engine for ovn-northd */
     inc_proc_northd_init(&ovnnb_idl_loop, &ovnsb_idl_loop);
-- 
2.30.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to