From patchwork Mon Jan 31 17:34:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladislav Odintsov X-Patchwork-Id: 1586915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KqIxeBaH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JnZvh2glzz9s9c for ; Tue, 1 Feb 2022 04:35:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id F03D341497; Mon, 31 Jan 2022 17:35:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FAy7qwsb1IBM; Mon, 31 Jan 2022 17:35:09 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3329040886; Mon, 31 Jan 2022 17:35:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EDC5AC001A; Mon, 31 Jan 2022 17:35:07 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 55794C000B for ; Mon, 31 Jan 2022 17:35:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2E44340886 for ; Mon, 31 Jan 2022 17:35:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cKLI5_ZREYiX for ; Mon, 31 Jan 2022 17:35:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by smtp4.osuosl.org (Postfix) with ESMTPS id DCA084055E for ; Mon, 31 Jan 2022 17:35:04 +0000 (UTC) Received: by mail-lj1-x22b.google.com with SMTP id t14so20397840ljh.8 for ; Mon, 31 Jan 2022 09:35:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TEZlqY03epC+v5klBlZa+PTcN1Pv+WwJdRZ5p77IGxs=; b=KqIxeBaHIqGMmNKqhyc9Xpqaf3QTk/UyRkizwmL4r4EPksxE2Ugnmqta1rumgyqBO0 OX5v5zkodcVKocx2WoSRgTqtk0NFJWHt0iDUKKtLlS/YvZ4asmDxoos5pgwLB/Bd3/Me Dm0/GwEL6dIEvuGKz0Ubb918gjsN980ORRf7hGZg/ThTwulRJPHLnOqPsLc5jcDSfJeV 2liFXa0XmAU3qxRDYxzuoW+AP8QaOvoO43CT04EZeabrYn4IGFGXd+cEloakN11Dn3e3 9Wksl5IANW7OmgWrtogCB6EggVL/lRwkJbrK98/TzFlXUTZfcWZek7FCTD9oG/xUMdL0 3xQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TEZlqY03epC+v5klBlZa+PTcN1Pv+WwJdRZ5p77IGxs=; b=o2YAuKO9txSL5hFNTJtoPiQB1PdlAZuuyd+XVjQAUu4ZneTRsnWEIl4l1azS1WxVnK 3bML7aXWejxm0zGmy2Vw54nxa5dhcJX0bm79kgqRZykQOhZMfjekL9zIsuGHjOy/WNzQ AUFKUo+/iXgV/5MdPi5Pf2MdItofYKjUMiM7rlwBKit/1SV8nEJFLZtGNhseP2ILRhJa d7ONWUD3bgNFCkeBpceqEyQzo3e7ESFHjaaNIvlT2YimdpoV1y4zCVUmxa8+hUSkMbF9 OfCjXRjzkhZKoIA1lUMtFHFu8yqpNUgc4hDvEUxxVlDl8usMKz3irAsP0+/6XYH59Fqs LA3g== X-Gm-Message-State: AOAM5326uTPux6mdSd2c+wISamQ5rqqWN0Hoz565REhxQY+dS+QWGWkk NuyIlB4tD5kb0bhDw/TmswpL0+oi/b0qmTex X-Google-Smtp-Source: ABdhPJyysbg6OMpa9Flws972z2KziIhAO3P/XZnCWnBKpPoACJj7hgCXAwBaXpGIRcPPyuxw+AoEtg== X-Received: by 2002:a05:651c:317:: with SMTP id a23mr6658948ljp.268.1643650502659; Mon, 31 Jan 2022 09:35:02 -0800 (PST) Received: from localhost.localdomain (109-252-131-59.dynamic.spd-mgts.ru. [109.252.131.59]) by smtp.gmail.com with ESMTPSA id s24sm3326113lfi.50.2022.01.31.09.35.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jan 2022 09:35:02 -0800 (PST) From: Vladislav Odintsov To: dev@openvswitch.org Date: Mon, 31 Jan 2022 20:34:57 +0300 Message-Id: <20220131173457.64391-1-odivlad@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Cc: Dumitru Ceara , Vladislav Odintsov Subject: [ovs-dev] [PATCH ovn v2] vtep: set is-vtep to chassis's other_config if absent X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" After commit [0] the mandatory vtep chassis's option 'is-vtep' has appeared. The upgrade scenario for ovn-controller-vtep was not supported: 'is-vtep' option was set only on vtep chassis creation. If chassis was created prior to a new codebase, it was left intact and HW VTEP connectivity was broken. This commit fixes such scenario and now 'is-vtep' is set for vtep chassis other_config if was not set yet. This patch also adds a related test. 0: https://github.com/ovn-org/ovn/commit/1c360bbd911cab9fadd6df8cd528d992ffa7a998 Fixes: 1c360bbd911c ("Fix basic multicast flows for vxlan (non-vtep) tunnels") Signed-off-by: Vladislav Odintsov Acked-by: Dumitru Ceara Signed-off-by: Vladislav Odintsov > Acked-by: Dumitru Ceara > Signed-off-by: Vladislav Odintsov > Acked-by: Dumitru Ceara > --- controller-vtep/gateway.c | 5 +++++ tests/ovn-controller-vtep.at | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/controller-vtep/gateway.c b/controller-vtep/gateway.c index 288772dc4..9fbfc0337 100644 --- a/controller-vtep/gateway.c +++ b/controller-vtep/gateway.c @@ -22,6 +22,7 @@ #include "lib/util.h" #include "openvswitch/vlog.h" #include "lib/ovn-sb-idl.h" +#include "smap.h" #include "vtep/vtep-idl.h" #include "ovn-controller-vtep.h" @@ -117,6 +118,10 @@ revalidate_gateway(struct controller_vtep_ctx *ctx) "false"); sbrec_encap_set_options(chassis_rec->encaps[0], &options); } + if (!smap_get_bool(&chassis_rec->other_config, "is-vtep", false)) { + const struct smap oc = SMAP_CONST1(&oc, "is-vtep", "true"); + sbrec_chassis_set_other_config(chassis_rec, &oc); + } } else { if (gw_node) { VLOG_WARN("Chassis for VTEP physical switch (%s) disappears, " diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at index b76fa5cef..08e1d13e7 100644 --- a/tests/ovn-controller-vtep.at +++ b/tests/ovn-controller-vtep.at @@ -102,6 +102,14 @@ Chassis br-vtep options: {csum="false"} ]) +# checks is-vtep option is in place, remove, check again +AT_CHECK([ovn-sbctl get chassis br-vtep other_config:is-vtep], [0], [dnl +"true" +]) + +check ovn-sbctl remove chassis br-vtep other_config is-vtep +OVS_WAIT_UNTIL([ovn-sbctl get chassis br-vtep other_config:is-vtep]) + # deletes the chassis via ovn-sbctl and check that it is readded back # with the log. AT_CHECK([ovn-sbctl chassis-del br-vtep])