diff mbox series

[ovs-dev,v2,2/3] northd: Resize the hash to correct parameters after build

Message ID 20210826084635.23209-2-anton.ivanov@cambridgegreys.com
State Not Applicable
Headers show
Series [ovs-dev,v2,1/3] northd: Disable parallel processing for logical_dp_groups | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning

Commit Message

Anton Ivanov Aug. 26, 2021, 8:46 a.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Parallel builds may result in suboptimal hash bucket sizing.
In the absense of dp-groups this does not matter as the hash
is purely storage and not used for lookups during the build.

Such a hash needs to be resized to a correct size at the end
of the build to ensure that any lookups during the lflow
reconcilliation phase are done as fast as possible.

Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 northd/ovn-northd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

0-day Robot Aug. 26, 2021, 8:56 a.m. UTC | #1
Bleep bloop.  Greetings Anton Ivanov, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


Patch skipped due to previous failure.

Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c
index 8c653cf52..71458ff4e 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -13057,6 +13057,11 @@  build_lflows(struct northd_context *ctx, struct hmap *datapaths,
                                     igmp_groups, meter_groups, lbs,
                                     bfd_connections);
 
+    /* Parallel build may result in a suboptimal hash. Resize the
+     * hash to a correct size before doing lookups */
+
+    hmap_expand(&lflows);
+
     if (hmap_count(&lflows) > max_seen_lflow_size) {
         max_seen_lflow_size = hmap_count(&lflows);
     }