From patchwork Sun Jul 17 03:58:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Kang X-Patchwork-Id: 649214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rsXbj4RWjz9sDk for ; Sun, 17 Jul 2016 13:58:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=iTqMNZpM; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 4975210D5B; Sat, 16 Jul 2016 20:58:40 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 8163810D55 for ; Sat, 16 Jul 2016 20:58:38 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id E755C1E0988 for ; Sat, 16 Jul 2016 21:58:37 -0600 (MDT) X-ASG-Debug-ID: 1468727917-09eadd4d1a2ea60001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id OIz3GS1oLrK5GwCn (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 16 Jul 2016 21:58:37 -0600 (MDT) X-Barracuda-Envelope-From: hkang.sunysb@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-qk0-f195.google.com) (209.85.220.195) by mx1-pf2.cudamail.com with ESMTPS (AES128-SHA encrypted); 17 Jul 2016 03:58:36 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.220.195 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.220.195 X-Barracuda-RBL-IP: 209.85.220.195 Received: by mail-qk0-f195.google.com with SMTP id q8so8557431qke.3 for ; Sat, 16 Jul 2016 20:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=/FVkfSqXk7q9xAiVtvX8OW0wiHxEliK65daGcO2ocdI=; b=iTqMNZpMOIIfGgFfrV5bWNg9eInKAvpyoYgVUNkKqBU52KmPvOKlb5FtfsN3ad/ZX5 Zq0QtC327NPu+YjOxuJXDWC9vd8WC3ZsKI8UXyPiCUoFKLKB186RnmTVugXz5UfSksjG mQ1fTLmEnDllRZLJp2hCZHm8p5QYJOqusnvAu3s5FxyxDrZNXeye3RbXPAncMCKOWeNq b5wEiibYDz9F7HGXOGxTk1cSn9/zAoyLvzaDahzZ6LVb/gOSuGd9OYhHWCLWQhGUqXAs 1RNYFAlfe6xPbtxBh12X0gJ4S5IKt37eg5LRkX4msfwVJAqmpcqQmfB+jEe0pZNDqG5Y Q6FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/FVkfSqXk7q9xAiVtvX8OW0wiHxEliK65daGcO2ocdI=; b=SRxvcOE/3EyV3MlsBJiCiGYoKoHsdL+p7F6QPnbE3sEhqqCEtdqX2gzjcRSvoaFY1j X7XOFhv98xK1sFOrfJcq2lTNKv8I26PlviTNFOaiE3H49zAG1nAzV6A7jXZ4HGKN2Z9L IHASWalXJKQRAFmm2RE7Q5s7HkBkRFe1po2KTPPmvOXfAWQbp0Y3Q9P/NpxxD9XVRLMG e/a50KeVJcXyqgd2NNHEpi+j5GPlAOiUmFKP2Ggs52I1+KWW79EXuYTjlo2Pb1Ktvyr0 PnR02YGnR26nGT3MCDBMBo8G2gOvOh+4wpuQHhMulAq6eEFOfqj1VoyTKT+ZYHDTFJDT 2s5A== X-Gm-Message-State: ALyK8tJ+E3rC6nBBPl66Ej1YgmChzrsscCDpF6NP/cg9CQWlKCE1cLO5IJ55EEvKjEqs2Q== X-Received: by 10.55.137.70 with SMTP id l67mr36063406qkd.17.1468727915906; Sat, 16 Jul 2016 20:58:35 -0700 (PDT) Received: from tygris1.scp.sandbox.watson.ibm.com (yktgi01e0-s4.watson.ibm.com. [129.34.20.23]) by smtp.googlemail.com with ESMTPSA id q187sm943840qke.42.2016.07.16.20.58.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 16 Jul 2016 20:58:35 -0700 (PDT) X-CudaMail-Envelope-Sender: hkang.sunysb@gmail.com From: Hui Kang X-Google-Original-From: Hui Kang To: dev@openvswitch.org X-CudaMail-MID: CM-E2-715026298 X-CudaMail-DTE: 071616 X-CudaMail-Originating-IP: 209.85.220.195 Date: Sat, 16 Jul 2016 23:58:25 -0400 X-ASG-Orig-Subj: [##CM-E2-715026298##][PATCH v3] Scanning only changed entries in the ovnsb Message-Id: <1468727905-11771-1-git-send-email-kangh@us.ibm.com> X-Mailer: git-send-email 1.9.1 X-GBUdb-Analysis: 0, 209.85.220.195, Ugly c=0.331706 p=-0.12 Source Normal X-MessageSniffer-Rules: 0-0-0-6098-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1468727917 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, DKIM_SIGNED, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31315 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH v3] Scanning only changed entries in the ovnsb X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Improve performance by scanning only changed port binding entries when determining whether to mark the logical switch port up or down Signed-off-by: Hui Kang Acked-by: Ryan Moats --- ovn/northd/ovn-northd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 7ce509d..bb6b853 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -2938,7 +2938,7 @@ ovnsb_db_run(struct northd_context *ctx) hmap_insert(&lports_hmap, &hash_node->node, hash_string(nb->name, 0)); } - SBREC_PORT_BINDING_FOR_EACH(sb, ctx->ovnsb_idl) { + SBREC_PORT_BINDING_FOR_EACH_TRACKED (sb, ctx->ovnsb_idl) { nb = NULL; HMAP_FOR_EACH_WITH_HASH(hash_node, node, hash_string(sb->logical_port, 0), @@ -3139,7 +3139,7 @@ main(int argc, char *argv[]) add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_type); add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_options); add_column_noalert(ovnsb_idl_loop.idl, &sbrec_port_binding_col_mac); - ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_port_binding_col_chassis); + ovsdb_idl_track_add_column(ovnsb_idl_loop.idl, &sbrec_port_binding_col_chassis); ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_address_set); add_column_noalert(ovnsb_idl_loop.idl, &sbrec_address_set_col_name); @@ -3165,6 +3165,7 @@ main(int argc, char *argv[]) } ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop); ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop); + ovsdb_idl_track_clear(ctx.ovnsb_idl); poll_block(); if (should_service_stop()) {