From patchwork Fri Sep 27 22:34:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1168757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AyIO3H2g"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46g6CS0S0Vz9sN1 for ; Sat, 28 Sep 2019 08:38:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D432D1257; Fri, 27 Sep 2019 22:34:41 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 85AA6122D for ; Fri, 27 Sep 2019 22:34:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id BCF23905 for ; Fri, 27 Sep 2019 22:34:37 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id f20so3628399edv.8 for ; Fri, 27 Sep 2019 15:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=02F5YNSHsHSeD1244qh0Bs3AfTt6w6ScfRNc2f4khyw=; b=AyIO3H2gSS9N3RtnShPKZjqdBLk2x9gtHjVsCRTd7QLkuWneX+gHhc4fdUCbg+zvmr UpY68op8cnDxJqEmBWDAzjYtL8oEOr8eJ88wHIKYCK7CxokQwEfDHc1kPDUbZjOZ/v/e U0Qz4Aes+4ELucgqzNmCEZDAyXx+LdtTsB/CgA9NHMV1Nzdr5poe8lo+GVffLVMG0mKS cKvgZWA1o8C/J3Qns9XAE5g0ZqNzzMLMUQXtRZ7L43A2b5sjzpX7ShcueWLgSJVn0Hz2 VOHydiRzT26SZXmLkxaMC2SJi4l6bqGyPAef8+w7EEyBOakPQFEy3eSV0W/Sc9BhMyoq 8aLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=02F5YNSHsHSeD1244qh0Bs3AfTt6w6ScfRNc2f4khyw=; b=C98vy3qCJqgPG1EtmQRsga2stcV3moB2ATV10EumA4cY1TUVP1I21Ob/PezlroSnDr c/AB0/StgKwQ+TE1A+yhs00U5HKLiwxA0rjnbR/yLTEdAfGV1FAWhM6fGL8u6EWUGcYj VEynp+nRpCPLdEIwBX7Tkdf/6/Tpf0Xi1x+/QzvPB39Vb2PayHe5LVtdZsQENG/z1F2x s7AnqGl7ZntQl0i/q+oFHH97XzNWAqpi0sTtc2uUbJ/iKLRshW/qQjky+eDkD2FwGUXD aeTxJzaAnS3eFKiWtaMCnH/KdbynWv21YHg6b/yTAXrW/V9+5fsK59BhK0OhI2RlFmyS typQ== X-Gm-Message-State: APjAAAX69V/Kr4ndggNQUYV4XADRBtQo63U7s/U3ZjUsaqSOlv2DSrnQ Zzw95vYmXIN/i57lXViWX8PQZu1C X-Google-Smtp-Source: APXvYqzZSkHOK2kwMD7YAB3LXoG4J+46jRIOuYj0BqwMKoFqHkBhWgEzeLj1KOw3exPZaZTBPN48gA== X-Received: by 2002:a50:a8a2:: with SMTP id k31mr7108343edc.79.1569623676123; Fri, 27 Sep 2019 15:34:36 -0700 (PDT) Received: from localhost.localdomain.localdomain ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id ng5sm715794ejb.9.2019.09.27.15.34.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Sep 2019 15:34:35 -0700 (PDT) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Fri, 27 Sep 2019 15:34:23 -0700 Message-Id: <1569623665-77390-9-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1569623665-77390-1-git-send-email-hzhou8@ebay.com> References: <1569623665-77390-1-git-send-email-hzhou8@ebay.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [RFC PATCH ovn 08/10] ovn-sb: Add columns is_interconn and is_remote to Chassis. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Han Zhou Support the new columns in Chassis table for OVN interconnection. Also, populate the is_interconn column according to external_ids: is-interconn key of Open_vSwitch table on the chassis. Signed-off-by: Han Zhou --- controller/chassis.c | 14 ++++++++++++++ northd/ovn-northd.c | 3 ++- ovn-sb.ovsschema | 8 +++++--- ovn-sb.xml | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/controller/chassis.c b/controller/chassis.c index 699b662..47ca75e 100644 --- a/controller/chassis.c +++ b/controller/chassis.c @@ -92,6 +92,8 @@ struct ovs_chassis_cfg { struct sset encap_ip_set; /* Interface type list formatted in the OVN-SB Chassis required format. */ struct ds iface_types; + /* Is this chassis an interconnection gateway. */ + bool is_interconn; }; static void @@ -172,6 +174,12 @@ get_datapath_type(const struct ovsrec_bridge *br_int) return ""; } +static bool +get_is_interconn(const struct smap *ext_ids) +{ + return smap_get_bool(ext_ids, "is-interconn", false); +} + static void update_chassis_transport_zones(const struct sset *transport_zones, const struct sbrec_chassis *chassis_rec) @@ -285,6 +293,8 @@ chassis_parse_ovs_config(const struct ovsrec_open_vswitch_table *ovs_table, sset_destroy(&ovs_cfg->encap_ip_set); } + ovs_cfg->is_interconn = get_is_interconn(&cfg->external_ids); + return true; } @@ -539,6 +549,10 @@ chassis_update(const struct sbrec_chassis *chassis_rec, update_chassis_transport_zones(transport_zones, chassis_rec); + if (ovs_cfg->is_interconn != chassis_rec->is_interconn) { + sbrec_chassis_set_is_interconn(chassis_rec, ovs_cfg->is_interconn); + } + /* If any of the encaps should change, update them. */ bool tunnels_changed = chassis_tunnels_changed(&ovs_cfg->encap_type_set, diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 32d70f8..d9c8a0f 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -9351,7 +9351,8 @@ check_and_add_supported_dhcpv6_opts_to_sb_db(struct northd_context *ctx) static const char *rbac_chassis_auth[] = {"name"}; static const char *rbac_chassis_update[] = - {"nb_cfg", "external_ids", "encaps", "vtep_logical_switches"}; + {"nb_cfg", "external_ids", "encaps", "vtep_logical_switches", + "is_interconn"}; static const char *rbac_encap_auth[] = {"chassis_name"}; diff --git a/ovn-sb.ovsschema b/ovn-sb.ovsschema index 5c013b1..30b622d 100644 --- a/ovn-sb.ovsschema +++ b/ovn-sb.ovsschema @@ -1,7 +1,7 @@ { "name": "OVN_Southbound", - "version": "2.5.0", - "cksum": "1257419092 20387", + "version": "2.6.0", + "cksum": "1645368988 20492", "tables": { "SB_Global": { "columns": { @@ -40,7 +40,9 @@ "min": 0, "max": "unlimited"}}, "transport_zones" : {"type": {"key": "string", "min": 0, - "max": "unlimited"}}}, + "max": "unlimited"}}, + "is_interconn" : {"type": "boolean"}, + "is_remote" : {"type": "boolean"}}, "isRoot": true, "indexes": [["name"]]}, "Encap": { diff --git a/ovn-sb.xml b/ovn-sb.xml index e5fb51a..9ba4274 100644 --- a/ovn-sb.xml +++ b/ovn-sb.xml @@ -301,6 +301,21 @@ See ovn-controller(8) for more information. + + ovn-controller populates this column with the setting + configured in the column of the Open_vSwitch + database's table. + If set to true, the chassis is used as an interconnection gateway. + See ovn-controller(8) for more information. + + + + ovn-ic set this column true for remote interconnection + gateway chassises learned from the interconnection southbound database. + See ovn-ic(8) for more information. + + ovn-controller populates this key with the set of options configured in the