From patchwork Thu Jul 28 21:22:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Bryant X-Patchwork-Id: 653884 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 3s0lFZ1nh9z9t29 for ; Fri, 29 Jul 2016 07:22:58 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 2EDB5112FC; Thu, 28 Jul 2016 14:22:55 -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 993C8112D2 for ; Thu, 28 Jul 2016 14:22:53 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id 05DB842014B for ; Thu, 28 Jul 2016 15:22:53 -0600 (MDT) X-ASG-Debug-ID: 1469740972-09eadd7ae731dbc0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id HwWUhjpZF5rAwkr3 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 28 Jul 2016 15:22:52 -0600 (MDT) X-Barracuda-Envelope-From: russell@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx1-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 28 Jul 2016 21:22:52 -0000 Received-SPF: neutral (mx1-pf2.cudamail.com: 209.132.183.28 is neither permitted nor denied by SPF record at ovn.org) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E31F381229; Thu, 28 Jul 2016 21:22:50 +0000 (UTC) Received: from x1c.redhat.com (ovpn-112-12.phx2.redhat.com [10.3.112.12]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6SLMnHX031583; Thu, 28 Jul 2016 17:22:50 -0400 X-CudaMail-Envelope-Sender: russell@ovn.org From: Russell Bryant To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-727071733 X-CudaMail-DTE: 072816 X-CudaMail-Originating-IP: 209.132.183.28 Date: Thu, 28 Jul 2016 17:22:41 -0400 X-ASG-Orig-Subj: [##CM-E2-727071733##][PATCH] ovn-controller: Remove old values from local_ids. Message-Id: <1469740961-14935-1-git-send-email-russell@ovn.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 28 Jul 2016 21:22:50 +0000 (UTC) X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1469740972 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] ovn-controller: Remove old values from local_ids. 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" local_ids is supposed to be the set of interface iface-id values from this chassis that correspond to OVN logical ports. We use this for detecting when an interface has been removed as well as if child-ports should be bound to this chassis. Old values were not being removed from local_ids. The most immediate effect of this was that once an interface has been removed from a chassis, we would think a removal has occured *every* time through binding_run and trigger the full binding processing. This was a performance problem. The second problem this would cause is if a port that had child ports was moved to another chassis. We would end up with two chassis fighting over the binding of the child ports. Signed-off-by: Russell Bryant Acked-by: Ryan Moats --- ovn/controller/binding.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c index 78ebec4..41165bc 100644 --- a/ovn/controller/binding.c +++ b/ovn/controller/binding.c @@ -103,6 +103,11 @@ get_local_iface_ids(const struct ovsrec_bridge *br_int, * that has been removed. */ if (!changed && !sset_is_empty(&old_local_ids)) { changed = true; + + const char *cur_id; + SSET_FOR_EACH(cur_id, &old_local_ids) { + sset_find_and_delete(&local_ids, cur_id); + } } sset_destroy(&old_local_ids);