From patchwork Thu Jul 14 22:04:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Kang X-Patchwork-Id: 648615 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 3rr8tz1vnvz9s9Y for ; Fri, 15 Jul 2016 08:07:07 +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=ouht0YoH; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 4AB7422C397; Thu, 14 Jul 2016 15:07:06 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id B808C10C03 for ; Thu, 14 Jul 2016 15:07:04 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 3CB63420162 for ; Thu, 14 Jul 2016 16:07:04 -0600 (MDT) X-ASG-Debug-ID: 1468534023-09eadd7e3428ca0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id 9sOLnshq6TLahvqc (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Jul 2016 16:07:03 -0600 (MDT) X-Barracuda-Envelope-From: hkang.sunysb@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-qt0-f196.google.com) (209.85.216.196) by mx1-pf2.cudamail.com with ESMTPS (AES128-SHA encrypted); 14 Jul 2016 22:07:03 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at _netblocks.google.com designates 209.85.216.196 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.216.196 X-Barracuda-RBL-IP: 209.85.216.196 Received: by mail-qt0-f196.google.com with SMTP id u25so3218391qtb.3 for ; Thu, 14 Jul 2016 15:07:03 -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=w3PPvif0EAwGnKKPBsmbNRdmAHe7rWrvPX71whQ0OxM=; b=ouht0YoHORiyQhYuc3nfd4irJLvfAAwFscxNUAZjbfCLREsF3Nau7RZ99QwlzODxV8 Ij6uBCtCzUk+pfLm2EcrGUXOyhBS0xsBdMs8HgfJM+bRrVMZeb7Y/102Smm/eqmHWtHX QOigq/KCKOuUrmnjjseP+woS8tN4GiQ9qSjSKD7siq+U5BB1ekiXks8eaf/HLcB4nTzQ foXZqBbCjMcd9WCmc+B8EyXJAdnKwYbf2hwmeUq9FhrtrbVZkD91ctmInSwYG6LCanND O1gERTsC04LyVVSQ7+es4ZQjRaA7VwdvmYl5cXRDJbTbhlup3n9ftjolq5v/Zms5mzss mYgg== 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=w3PPvif0EAwGnKKPBsmbNRdmAHe7rWrvPX71whQ0OxM=; b=TrrfuYCBtywjkNZj3SbxyQoEUWokCUOO/dCn+HvrUOb3Gux65+AaTBqKPHwa11+tDt RzGe/AF4PCmrAbmURV0BnhTvJPh3wLmKa8/lRpDuhDGOW96OTUlzl6qg80g92bsetUzM Ncjym9KaiKklcMOwhk0R/ewHfonLquAPAnfBOWgN/9e3KtnW80jN8c/TLsJGDhAO/Nas 0b0JsWJSWiImoF8kuNBtRQrVlm6jy/PQvJHvbfBLIdB+LlVkIKBOz9cttFSaG85tzZ6V cdui5KJLGfz8lE8snrhFFr8VxFDbk6vcjpzz0kEU8e6cNsi23a8iQwNPzXwIkwJ/VGFX wKHw== X-Gm-Message-State: ALyK8tLaAha5QE7FHoMJ+rvPH/LmpthBDvyNvL5MV+DUW8wPBVsGQRRDbHVLgmkWKWXDSA== X-Received: by 10.200.52.85 with SMTP id v21mr23821061qtb.21.1468534021999; Thu, 14 Jul 2016 15:07:01 -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 m10sm141qta.31.2016.07.14.15.07.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jul 2016 15:07:01 -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-713075132 X-CudaMail-DTE: 071416 X-CudaMail-Originating-IP: 209.85.216.196 Date: Thu, 14 Jul 2016 18:04:21 -0400 X-ASG-Orig-Subj: [##CM-E2-713075132##][PATCH] Scanning only changed entries in the ovnsb Message-Id: <1468533861-5461-1-git-send-email-kangh@us.ibm.com> X-Mailer: git-send-email 1.9.1 X-GBUdb-Analysis: 0, 209.85.216.196, Ugly c=0.335748 p=-0.153846 Source Normal X-MessageSniffer-Rules: 0-0-0-5951-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1468534023 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.31270 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] 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 entries in ovnsb Signed-off-by: Hui Kang --- 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()) {