From patchwork Tue Jul 12 06:56:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 647300 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 3rpdF84Z8pz9s9N for ; Tue, 12 Jul 2016 20:17:32 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id E81631069E; Tue, 12 Jul 2016 03:17:07 -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 67F09106AE for ; Tue, 12 Jul 2016 03:17:06 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id DE4AD420233 for ; Tue, 12 Jul 2016 04:17:05 -0600 (MDT) X-ASG-Debug-ID: 1468318625-09eadd72160b520001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id qF3j5B6YuDOKJmE8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 12 Jul 2016 04:17:05 -0600 (MDT) X-Barracuda-Envelope-From: jpettit@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay2-d.mail.gandi.net) (217.70.183.194) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 12 Jul 2016 10:17:05 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at ovn.org designates 217.70.183.194 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.194 X-Barracuda-RBL-IP: 217.70.183.194 Received: from mfilter31-d.gandi.net (mfilter31-d.gandi.net [217.70.178.162]) by relay2-d.mail.gandi.net (Postfix) with ESMTP id E85F3C5B18 for ; Tue, 12 Jul 2016 12:17:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter31-d.gandi.net Received: from relay2-d.mail.gandi.net ([IPv6:::ffff:217.70.183.194]) by mfilter31-d.gandi.net (mfilter31-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id v7y6qyrsRkv6 for ; Tue, 12 Jul 2016 12:17:02 +0200 (CEST) X-Originating-IP: 98.234.50.139 Received: from localhost.localdomain (unknown [98.234.50.139]) (Authenticated sender: jpettit@ovn.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id C9B82C5B5F for ; Tue, 12 Jul 2016 12:17:01 +0200 (CEST) X-CudaMail-Envelope-Sender: jpettit@ovn.org From: Justin Pettit To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-711004949 X-CudaMail-DTE: 071216 X-CudaMail-Originating-IP: 217.70.183.194 Date: Mon, 11 Jul 2016 23:56:38 -0700 X-ASG-Orig-Subj: [##CM-E1-711004949##][ovn-ipv6 08/26] ovn: Remove 'default_gw' from logical router table. Message-Id: <1468306616-125783-9-git-send-email-jpettit@ovn.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468306616-125783-1-git-send-email-jpettit@ovn.org> References: <1468306616-125783-1-git-send-email-jpettit@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1468318625 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 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] [ovn-ipv6 08/26] ovn: Remove 'default_gw' from logical router table. 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" With static routes, it's not necessary to have a separate default gateway parameter. This also makes configuring router ports clearer when IPv6 and IPv4 addresses may be assigned to the same port. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- ovn/northd/ovn-northd.c | 35 ----------------------------------- ovn/ovn-nb.ovsschema | 5 ++--- ovn/ovn-nb.xml | 4 ---- tests/ovn.at | 4 ++-- 4 files changed, 4 insertions(+), 44 deletions(-) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index d0491ea..ed67dc5 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -262,10 +262,6 @@ struct ovn_datapath { struct ovs_list list; /* In list of similar records. */ - /* Logical router data (digested from nbr). */ - const struct ovn_port *gateway_port; - ovs_be32 gateway; - /* Logical switch data. */ struct ovn_port **router_ports; size_t n_router_ports; @@ -420,21 +416,6 @@ join_datapaths(struct northd_context *ctx, struct hmap *datapaths, NULL, nbr, NULL); ovs_list_push_back(nb_only, &od->list); } - - od->gateway = 0; - if (nbr->default_gw) { - ovs_be32 ip; - if (!ip_parse(nbr->default_gw, &ip) || !ip) { - static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1); - VLOG_WARN_RL(&rl, "bad 'gateway' %s", nbr->default_gw); - } else { - od->gateway = ip; - } - } - - /* Set the gateway port to NULL. If there is a gateway, it will get - * filled in as we go through the ports later. */ - od->gateway_port = NULL; } } @@ -658,18 +639,6 @@ join_logical_ports(struct northd_context *ctx, op->mac = mac; op->od = od; - - /* If 'od' has a gateway and 'op' routes to it... */ - if (od->gateway && !((op->network ^ od->gateway) & op->mask)) { - /* ...and if 'op' is a longer match than the current - * choice... */ - const struct ovn_port *gw = od->gateway_port; - int len = gw ? ip_count_cidr_bits(gw->mask) : 0; - if (ip_count_cidr_bits(op->mask) > len) { - /* ...then it's the default gateway port. */ - od->gateway_port = op; - } - } } } } @@ -2524,10 +2493,6 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, route = od->nbr->static_routes[i]; build_static_route_flow(lflows, od, ports, route); } - - if (od->gateway && od->gateway_port) { - add_route(lflows, od->gateway_port, 0, 0, od->gateway); - } } /* XXX destination unreachable */ diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema index ee7c2c6..5102948 100644 --- a/ovn/ovn-nb.ovsschema +++ b/ovn/ovn-nb.ovsschema @@ -1,7 +1,7 @@ { "name": "OVN_Northbound", - "version": "3.2.0", - "cksum": "1784604034 7539", + "version": "4.0.0", + "cksum": "2156178478 7460", "tables": { "Logical_Switch": { "columns": { @@ -105,7 +105,6 @@ "refType": "strong"}, "min": 0, "max": "unlimited"}}, - "default_gw": {"type": {"key": "string", "min": 0, "max": 1}}, "enabled": {"type": {"key": "boolean", "min": 0, "max": 1}}, "nat": {"type": {"key": {"type": "uuid", "refTable": "NAT", diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml index 5542ea4..1eeec22 100644 --- a/ovn/ovn-nb.xml +++ b/ovn/ovn-nb.xml @@ -729,10 +729,6 @@ One or more static routes for the router. - - IP address to use as default gateway, if any. - - This column is used to administratively set router state. If this column is empty or is set to true, the router is enabled. If this diff --git a/tests/ovn.at b/tests/ovn.at index 63d68e9..fdac600 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -2320,8 +2320,8 @@ ovn-nbctl lsp-add ls2 rp-ls2 -- set Logical_Switch_Port rp-ls2 type=router \ ovn-nbctl lrp-add R1 R1_R2 00:00:00:02:03:04 20.0.0.1/24 R2_R1 ovn-nbctl lrp-add R2 R2_R1 00:00:00:02:03:05 20.0.0.2/24 R1_R2 -ovn-nbctl set Logical_Router R1 default_gw="20.0.0.2" -ovn-nbctl set Logical_Router R2 default_gw="20.0.0.1" +ovn-nbctl lr-route-add R1 "0.0.0.0/0" 20.0.0.2 +ovn-nbctl lr-route-add R2 "0.0.0.0/0" 20.0.0.1 # Create logical port ls1-lp1 in ls1 ovn-nbctl lsp-add ls1 ls1-lp1 \