From patchwork Thu Jul 7 16:24:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 645967 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 3rljd24c6Jz9sdn for ; Fri, 8 Jul 2016 02:24:38 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 6F30010A3D; Thu, 7 Jul 2016 09:24:37 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 14E0D10A2E for ; Thu, 7 Jul 2016 09:24:37 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 5D19C162E89 for ; Thu, 7 Jul 2016 10:24:36 -0600 (MDT) X-ASG-Debug-ID: 1467908675-0b323706682bf090001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id 9QGHUJWJA8uhXHdE (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 07 Jul 2016 10:24:35 -0600 (MDT) X-Barracuda-Envelope-From: rmoats@oc7146733065.ibm.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO fed1rmfepo101.cox.net) (68.230.241.143) by mx1-pf1.cudamail.com with SMTP; 7 Jul 2016 16:24:34 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at oc7146733065.ibm.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 68.230.241.143 X-Barracuda-RBL-IP: 68.230.241.143 Received: from fed1rmimpo109.cox.net ([68.230.241.158]) by fed1rmfepo101.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20160707162433.MWNR14123.fed1rmfepo101.cox.net@fed1rmimpo109.cox.net> for ; Thu, 7 Jul 2016 12:24:33 -0400 Received: from oc7146733065.ibm.com ([68.13.99.247]) by fed1rmimpo109.cox.net with cox id FsQY1t0075LF6cs01sQYK9; Thu, 07 Jul 2016 12:24:33 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020205.577E8241.00AA, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.1 cv=WtiLSYrv c=1 sm=1 tr=0 a=Jmqd6mthTashISSy/JkQqg==:117 a=Jmqd6mthTashISSy/JkQqg==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=cAmyUtKerLwA:10 a=VnNF1IyMAAAA:8 a=rDrCizJJ-D4wbPE4HbkA:9 a=7rhj6KfjYJ6Xa3_m:21 a=1n-m-kv2m1WpwprC:21 a=skCgnbhlp52w9zbo2JeP:22 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: by oc7146733065.ibm.com (Postfix, from userid 500) id CC3021880390; Thu, 7 Jul 2016 11:24:31 -0500 (CDT) X-CudaMail-Envelope-Sender: rmoats@oc7146733065.ibm.com From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-E1-706037591 X-CudaMail-DTE: 070716 X-CudaMail-Originating-IP: 68.230.241.143 Date: Thu, 7 Jul 2016 11:24:25 -0500 X-ASG-Orig-Subj: [##CM-E1-706037591##][PATCH] Remove old address set after change. Message-Id: <1467908665-6537-1-git-send-email-rmoats@us.ibm.com> X-Mailer: git-send-email 1.7.1 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1467908675 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 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, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31093 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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] Remove old address set after change. 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" Currently, when address set value changes, ovn controller doesn't remove the old entry from the tracking hash, it just adds the new one, leading to multiple entries for the same symbol. Fix this behavior. ToDo: figure out a test to avoid this in the future. Signed-off-by: Ryan Moats --- ovn/controller/lflow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ovn/controller/lflow.c b/ovn/controller/lflow.c index 05e1eaf..00d1d6e 100644 --- a/ovn/controller/lflow.c +++ b/ovn/controller/lflow.c @@ -258,6 +258,7 @@ update_address_sets(struct controller_ctx *ctx) * if the symtab entry needs to be updated due to a change. */ sset_find_and_delete(&cur_addr_set_names, addr_set_rec->name); if (!address_sets_match(addr_set, addr_set_rec)) { + shash_find_and_delete(&local_address_sets, addr_set_rec->name); expr_macros_remove(&expr_address_sets, addr_set_rec->name); address_set_destroy(addr_set); addr_set = NULL;