From patchwork Wed Aug 31 15:22:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 664568 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 3sPThJ2jmkz9sDk for ; Thu, 1 Sep 2016 01:24:32 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 9E695108F5; Wed, 31 Aug 2016 08:24:31 -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 37341108AE for ; Wed, 31 Aug 2016 08:24:30 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id C3A771621D4 for ; Wed, 31 Aug 2016 09:24:29 -0600 (MDT) X-ASG-Debug-ID: 1472657069-0b32370b345a920001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar6.cudamail.com with ESMTP id uLEWBfk7h7wc7KDI (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 31 Aug 2016 09:24:29 -0600 (MDT) X-Barracuda-Envelope-From: stack@tombstone-01.cloud.svl.ibm.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by mx3-pf3.cudamail.com with ESMTPS (AES256-SHA encrypted); 31 Aug 2016 15:24:28 -0000 Received-SPF: none (mx3-pf3.cudamail.com: domain at tombstone-01.cloud.svl.ibm.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 148.163.156.1 X-Barracuda-RBL-IP: 148.163.156.1 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7VFDTNB022666 for ; Wed, 31 Aug 2016 11:24:28 -0400 Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150]) by mx0a-001b2d01.pphosted.com with ESMTP id 255wjah24q-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 31 Aug 2016 11:24:27 -0400 Received: from localhost by e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 Aug 2016 09:24:27 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 31 Aug 2016 09:24:25 -0600 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: stack@tombstone-01.cloud.svl.ibm.com Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 4A4C63E4003E; Wed, 31 Aug 2016 09:24:24 -0600 (MDT) Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7VFONYT8126842; Wed, 31 Aug 2016 15:24:23 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67399AE03B; Wed, 31 Aug 2016 11:24:23 -0400 (EDT) Received: from localhost (unknown [9.30.183.40]) by b01ledav005.gho.pok.ibm.com (Postfix) with SMTP id 0F254AE043; Wed, 31 Aug 2016 11:24:22 -0400 (EDT) Received: by localhost (Postfix, from userid 1000) id 803E360104; Wed, 31 Aug 2016 15:24:22 +0000 (UTC) X-CudaMail-Envelope-Sender: stack@tombstone-01.cloud.svl.ibm.com From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-V3-830021757 X-CudaMail-DTE: 083116 X-CudaMail-Originating-IP: 148.163.156.1 Date: Wed, 31 Aug 2016 15:22:46 +0000 X-ASG-Orig-Subj: [##CM-V3-830021757##][PATCH v2 4/4] ovn-controller: Convert encaps module back to full processing X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472656966-30133-1-git-send-email-rmoats@us.ibm.com> References: <1472656966-30133-1-git-send-email-rmoats@us.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16083115-0004-0000-0000-000010429407 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005686; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000184; SDB=6.00752136; UDB=6.00355578; IPR=6.00524946; BA=6.00004683; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012534; XFM=3.00000011; UTC=2016-08-31 15:24:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16083115-0005-0000-0000-00007876F9A8 Message-Id: <1472656966-30133-5-git-send-email-rmoats@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-31_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608310178 X-GBUdb-Analysis: 0, 148.163.156.1, Ugly c=0.308711 p=-0.5 Source Normal X-MessageSniffer-Rules: 0-0-0-9249-c X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1472657069 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, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32491 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 v2 4/4] ovn-controller: Convert encaps module back to full processing 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" This patch converts the encaps module back to full processing, but does not remove all persistence of associated data strcutures. Signed-off-by: Ryan Moats --- ovn/controller/encaps.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c index d99ba05..384e8e7 100644 --- a/ovn/controller/encaps.c +++ b/ovn/controller/encaps.c @@ -412,25 +412,20 @@ encaps_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int, /* Maintain a mapping backwards from encap entries to their parent * chassis. Most changes happen at the encap row entry but tunnels need * to be established on the basis of the overall chassis. */ - SBREC_CHASSIS_FOR_EACH_TRACKED (chassis_rec, ctx->ovnsb_idl) { - /* Defer deletion of mapping until we have cleaned up associated - * ports. */ - if (!sbrec_chassis_is_deleted(chassis_rec)) { - for (int i = 0; i < chassis_rec->n_encaps; i++) { - encap_rec = chassis_rec->encaps[i]; - - struct encap_hash_node *encap_hash_node; - encap_hash_node = lookup_encap_uuid(&encap_rec->header_.uuid); - if (encap_hash_node) { - /* A change might have invalidated our mapping. Process the - * new version and then iterate over everything to see if it - * is OK. */ - delete_encap_uuid(encap_hash_node); - poll_immediate_wake(); - } - - insert_encap_uuid(&encap_rec->header_.uuid, chassis_rec); + SBREC_CHASSIS_FOR_EACH (chassis_rec, ctx->ovnsb_idl) { + for (int i = 0; i < chassis_rec->n_encaps; i++) { + encap_rec = chassis_rec->encaps[i]; + + struct encap_hash_node *encap_hash_node; + encap_hash_node = lookup_encap_uuid(&encap_rec->header_.uuid); + if (encap_hash_node) { + /* A change might have invalidated our mapping. Process the + * new version and then iterate over everything to see if it + * is OK. */ + delete_encap_uuid(encap_hash_node); } + + insert_encap_uuid(&encap_rec->header_.uuid, chassis_rec); } } @@ -440,7 +435,7 @@ encaps_run(struct controller_ctx *ctx, const struct ovsrec_bridge *br_int, * might actually result in the creation of a different type tunnel if * that type is preferred. That's OK - when we process the other encap * rows, we'll just skip over the new tunnels. */ - SBREC_ENCAP_FOR_EACH_TRACKED (encap_rec, ctx->ovnsb_idl) { + SBREC_ENCAP_FOR_EACH (encap_rec, ctx->ovnsb_idl) { struct encap_hash_node *encap_hash_node; struct chassis_hash_node *chassis_hash_node; const struct ovsrec_port *port_rec = NULL;