From patchwork Thu Nov 5 23:11:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 540740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 3063E1402D4 for ; Fri, 6 Nov 2015 10:11:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=C8T5C4Js; dkim-atps=neutral Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 992F910892; Thu, 5 Nov 2015 15:11:53 -0800 (PST) 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 1EE3510773 for ; Thu, 5 Nov 2015 15:11:52 -0800 (PST) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 5A50E1E0164 for ; Thu, 5 Nov 2015 16:11:51 -0700 (MST) X-ASG-Debug-ID: 1446765110-09eadd5209436b0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id NAD5mgh6RJ3n37Gt (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 05 Nov 2015 16:11:50 -0700 (MST) X-Barracuda-Envelope-From: zhouhan@gmail.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail-yk0-f175.google.com) (209.85.160.175) by mx1-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 5 Nov 2015 23:11:50 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at _netblocks.google.com designates 209.85.160.175 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.85.160.175 X-Barracuda-RBL-IP: 209.85.160.175 Received: by ykdr3 with SMTP id r3so159982365ykd.1 for ; Thu, 05 Nov 2015 15:11:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=X6HlnScbMAPoz4PadoYr1gKd7NxiOAr8mzBFdRTlVvA=; b=C8T5C4JsRHEk9XtRW5/lEWfT8yifrB8LWInjP68Xs+R+73eIHN4U6t0e0j3xTbwXnu oVuO2zeN3XyH6ULn2Cftl9W35bmnwRvoXWKpUp6Kurzmg+UmnhFNrg5hOKjULssFlZeF 2oR0NUvmC9nCiWjgYrT9WVHkZeJKuDMcWllvSJbocopy2xYOSxHm4rS7jeKsUheOwR9V uYdM1Zb1Z0M8DM0lTHUMaey6XTe7BRvsUP8USjN3V7we5rX2c9SP2BzBzhqhQLewVD0p uwJXY3udyHUA6Faa3KNPG4eWPqNapBvD8TJrgfLCSG1XhmGLGRHL/2CfBUDKqaNmcySQ MPkQ== MIME-Version: 1.0 X-Received: by 10.13.240.131 with SMTP id z125mr8642734ywe.238.1446765109228; Thu, 05 Nov 2015 15:11:49 -0800 (PST) Received: by 10.37.223.8 with HTTP; Thu, 5 Nov 2015 15:11:49 -0800 (PST) Date: Thu, 5 Nov 2015 15:11:49 -0800 Message-ID: X-CudaMail-MID: CM-E1-1104099480 X-CudaMail-DTE: 110515 X-CudaMail-Originating-IP: 209.85.160.175 X-CudaMail-Envelope-Sender: zhouhan@gmail.com X-ASG-Orig-Subj: [##CM-E1-1104099480##][PATCH] ovn: use name instead of uuid as key of logical router ports From: Han Zhou To: "dev@openvswitch.org" X-GBUdb-Analysis: 0, 209.85.160.175, Ugly c=0.484386 p=-0.545455 Source Normal X-MessageSniffer-Rules: 0-0-0-15104-c X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1446765110 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.10 X-Barracuda-Spam-Status: No, SCORE=0.10 using per-user scores of TAG_LEVEL=3.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=DKIM_SIGNED, HTML_MESSAGE, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.24144 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.00 HTML_MESSAGE BODY: HTML included in message 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Content-Filtered-By: Mailman/MimeDel 2.1.16 Subject: [ovs-dev] [PATCH] ovn: use name instead of uuid as key of logical router ports 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: , Errors-To: dev-bounces@openvswitch.org Sender: "dev" Before this patch, logical switch ports were using name as key but logical router ports using uuid, which confuses user when trouble- shooting, and names of patch ports unreadable. This patch unifies it by using "name" field also for logical router ports. Signed-off-by: Han Zhou --- ovn/northd/ovn-northd.c | 10 +++------- ovn/ovn-nb.ovsschema | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 60786d2..137bc1c 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -594,23 +594,20 @@ join_logical_ports(struct northd_context *ctx, continue; } - char name[UUID_LEN + 1]; - snprintf(name, sizeof name, UUID_FMT, - UUID_ARGS(&nbr->header_.uuid)); - struct ovn_port *op = ovn_port_find(ports, name); + struct ovn_port *op = ovn_port_find(ports, nbr->name); if (op) { if (op->nbs || op->nbr) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1); VLOG_WARN_RL(&rl, "duplicate logical router port %s", - name); + nbr->name); continue; } op->nbr = nbr; list_remove(&op->list); list_push_back(both, &op->list); } else { - op = ovn_port_create(ports, name, NULL, nbr, NULL); + op = ovn_port_create(ports, nbr->name, NULL, nbr, NULL); list_push_back(nb_only, &op->list); } @@ -1453,7 +1450,6 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, for (size_t i = 0; i < op->nbs->n_addresses; i++) { struct eth_addr ea; ovs_be32 ip; - if (ovs_scan(op->nbs->addresses[i], ETH_ADDR_SCAN_FMT" "IP_SCAN_FMT, ETH_ADDR_SCAN_ARGS(ea), IP_SCAN_ARGS(&ip))) { diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema index 3921e98..9aa5b7f 100644 --- a/ovn/ovn-nb.ovsschema +++ b/ovn/ovn-nb.ovsschema @@ -1,7 +1,7 @@ { "name": "OVN_Northbound", - "version": "2.0.0", - "cksum": "3039293926 4601", + "version": "2.0.1", + "cksum": "2854670130 4636", "tables": { "Logical_Switch": { "columns": { @@ -89,5 +89,6 @@ "external_ids": { "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}}}, + "indexes": [["name"]], "isRoot": false}}, "version": "1.0.0"}