From patchwork Wed Feb 14 18:26:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1899044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Qk0CF8oe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TZmqT1MFnz23j4 for ; Thu, 15 Feb 2024 05:26:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 16C7260814; Wed, 14 Feb 2024 18:26:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zn3bgyG6X9_8; Wed, 14 Feb 2024 18:26:24 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4B2066079F Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Qk0CF8oe Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 4B2066079F; Wed, 14 Feb 2024 18:26:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ED6DFC0072; Wed, 14 Feb 2024 18:26:23 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 123D8C0037 for ; Wed, 14 Feb 2024 18:26:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0919981FFC for ; Wed, 14 Feb 2024 18:26:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h9F1YnHJqXdM for ; Wed, 14 Feb 2024 18:26:21 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 4A4C981FF8 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4A4C981FF8 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Qk0CF8oe Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4A4C981FF8 for ; Wed, 14 Feb 2024 18:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707935179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBuhc4QQ3OomDm7Rv53L7TzMnof8YJ2VdR38Ggxs5Ps=; b=Qk0CF8oeM98wNSMhAyEXAch1dYhbCmdUU/GdlSBCLfPSn29B/lTOM38fI75phWjyf8SVKr qXDDIFxkQMUsbfMBKygUSh14lMubum5geQSkM6RoOmsibhM9YyrmTa1Tnf2OZMoswFQOd5 goB1O8wN3TD42UUWtWlh5AaL8bxFsxo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-q8MkJIHwO366gKrDsTmQhg-1; Wed, 14 Feb 2024 13:26:18 -0500 X-MC-Unique: q8MkJIHwO366gKrDsTmQhg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3796832EB2 for ; Wed, 14 Feb 2024 18:26:17 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73B1D8077; Wed, 14 Feb 2024 18:26:17 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Wed, 14 Feb 2024 19:26:16 +0100 Message-ID: <20240214182616.3260992-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] northd: Initialize hmap size in lflow_mgr. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 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: a623606052ea ("northd: Refactor lflow management into a separate module.") Signed-off-by: Xavier Simonart --- northd/lflow-mgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/northd/lflow-mgr.c b/northd/lflow-mgr.c index 61729e903..af072bf70 100644 --- a/northd/lflow-mgr.c +++ b/northd/lflow-mgr.c @@ -260,6 +260,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) {