From patchwork Sun Aug 28 22:51:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 663468 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 3sMqlq4H4Bz9sBg for ; Mon, 29 Aug 2016 08:51:51 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id CE561103AA; Sun, 28 Aug 2016 15:51:50 -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 ACD17103A3 for ; Sun, 28 Aug 2016 15:51:48 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 445731E0380 for ; Sun, 28 Aug 2016 16:51:48 -0600 (MDT) X-ASG-Debug-ID: 1472424707-09eadd7f1d32920001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar5.cudamail.com with ESMTP id RoG3gFFr4c1cGy1s (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 28 Aug 2016 16:51:47 -0600 (MDT) X-Barracuda-Envelope-From: stack@tombstone-01.cloud.svl.ibm.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by mx1-pf2.cudamail.com with ESMTPS (AES256-SHA encrypted); 28 Aug 2016 22:51:47 -0000 Received-SPF: none (mx1-pf2.cudamail.com: domain at tombstone-01.cloud.svl.ibm.com does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 148.163.158.5 X-Barracuda-RBL-IP: 148.163.158.5 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7SMn3gD090714 for ; Sun, 28 Aug 2016 18:51:45 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 253rdx0yc9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 28 Aug 2016 18:51:45 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 28 Aug 2016 18:51:44 -0400 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 28 Aug 2016 18:51:41 -0400 X-IBM-Helo: d01dlp03.pok.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 d01dlp03.pok.ibm.com (Postfix) with ESMTP id 40B19C9003E; Sun, 28 Aug 2016 18:51:29 -0400 (EDT) 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 u7SMpeIn15991232; Sun, 28 Aug 2016 22:51:40 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A74DCAE034; Sun, 28 Aug 2016 18:51:40 -0400 (EDT) Received: from localhost (unknown [9.30.183.40]) by b01ledav005.gho.pok.ibm.com (Postfix) with SMTP id 45130AE04B; Sun, 28 Aug 2016 18:51:40 -0400 (EDT) Received: by localhost (Postfix, from userid 1000) id C7F6160110; Sun, 28 Aug 2016 22:51:39 +0000 (UTC) X-CudaMail-Envelope-Sender: stack@tombstone-01.cloud.svl.ibm.com From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-E2-827019663 X-CudaMail-DTE: 082816 X-CudaMail-Originating-IP: 148.163.158.5 Date: Sun, 28 Aug 2016 22:51:38 +0000 X-ASG-Orig-Subj: [##CM-E2-827019663##][PATCH] ovn-controller: Convert encaps module back to full processing X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082822-0056-0000-0000-0000012E29FA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005656; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000183; SDB=6.00750887; UDB=6.00354806; IPR=6.00523661; BA=6.00004676; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012495; XFM=3.00000011; UTC=2016-08-28 22:51:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082822-0057-0000-0000-0000054837AC Message-Id: <1472424698-487-1-git-send-email-rmoats@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-28_11:, , 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-1608280225 X-GBUdb-Analysis: 0, 148.163.158.5, Ugly c=0.308711 p=-0.3 Source Normal X-MessageSniffer-Rules: 0-0-0-9587-c X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1472424707 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.32407 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] 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" Commit f5d916cb ("ovn-controller: Back out incremental processing") left the conversion of the encaps module to a future patch set. This patch converts this module back to full processing, but does not remove all persistence of associated data strcutures. This commit depends on f5d916cb ("ovn-controller: Back out incremental processing"). Signed-off-by: Ryan Moats --- ovn/controller/encaps.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c index d99ba05..844447f 100644 --- a/ovn/controller/encaps.c +++ b/ovn/controller/encaps.c @@ -412,25 +412,21 @@ 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); + poll_immediate_wake(); } + + insert_encap_uuid(&encap_rec->header_.uuid, chassis_rec); } } @@ -440,7 +436,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;