Skip to content

Commit

Permalink
northd: Initialize hmap size in lflow_mgr.
Browse files Browse the repository at this point in the history
When (re)starting ovn-northd with an existing big nbdb,
the first iteration of northd was very slow as trying to
push all flows in a single bucket.

Fixes: a623606 ("northd: Refactor lflow management into a separate module.")
Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
simonartxavier authored and numansiddique committed Feb 14, 2024
1 parent 0e0f38f commit 4f27496
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions northd/lflow-mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ lflow_table_sync_to_sb(struct lflow_table *lflow_table,
struct hmap *lflows = &lflow_table->entries;
struct ovn_lflow *lflow;

fast_hmap_size_for(&lflows_temp,
lflow_table->max_seen_lflow_size);

/* Push changes to the Logical_Flow table to database. */
const struct sbrec_logical_flow *sbflow;
SBREC_LOGICAL_FLOW_TABLE_FOR_EACH_SAFE (sbflow, sb_flow_table) {
Expand Down

0 comments on commit 4f27496

Please sign in to comment.