From patchwork Wed Sep 6 06:49:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1830229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RgY0V6ZqXz1yh1 for ; Wed, 6 Sep 2023 16:50:18 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0632E408EC; Wed, 6 Sep 2023 06:50:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 0632E408EC X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uMTY__T4hwKN; Wed, 6 Sep 2023 06:50:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2F5A1400DC; Wed, 6 Sep 2023 06:50:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2F5A1400DC Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 15D43C0071; Wed, 6 Sep 2023 06:50:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 88230C0032 for ; Wed, 6 Sep 2023 06:50:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 61C254005B for ; Wed, 6 Sep 2023 06:50:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 61C254005B 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 Iv47kqlN3b5q for ; Wed, 6 Sep 2023 06:50:12 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by smtp4.osuosl.org (Postfix) with ESMTPS id 438E84004D for ; Wed, 6 Sep 2023 06:50:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 438E84004D Received: by mail.gandi.net (Postfix) with ESMTPSA id 72E63E0003; Wed, 6 Sep 2023 06:50:08 +0000 (UTC) From: Han Zhou To: dev@openvswitch.org Date: Tue, 5 Sep 2023 23:49:32 -0700 Message-Id: <20230906064932.764795-1-hzhou@ovn.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-GND-Sasl: hzhou@ovn.org Subject: [ovs-dev] [PATCH ovn] northd: Support an option to ignore chassis features. 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" Add option ignore_chassis_features for northd to bypass the support status of features on each chassis and to directly implement the latest features. This is particularly useful for users who follow the suggested upgrade order that upgrades ovn-controllers before ovn-northd, and want to safeguard the operation of northd from being adversely affected by a mismatched configuration of a chassis. This not only avoids feature degradation but can also avoid risks of any broken feature in backward compatible mode. An example of such impact is discussed at [0]. [0] https://mail.openvswitch.org/pipermail/ovs-dev/2023-September/407756.html Signed-off-by: Han Zhou Acked-by: Ales Musil --- northd/northd.c | 25 ++++++++++++++++++------- ovn-nb.xml | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 3eaa43f07a1f..e7b5b777a63b 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -17058,6 +17058,17 @@ destroy_datapaths_and_ports(struct ovn_datapaths *ls_datapaths, ovn_datapaths_destroy(lr_datapaths); } +static void +northd_enable_all_features(struct northd_data *data) +{ + data->features = (struct chassis_features) { + .ct_no_masked_label = true, + .mac_binding_timestamp = true, + .ct_lb_related = true, + .fdb_timestamp = true, + }; +} + void northd_init(struct northd_data *data) { @@ -17068,12 +17079,7 @@ northd_init(struct northd_data *data) hmap_init(&data->lbs); hmap_init(&data->lb_groups); ovs_list_init(&data->lr_list); - data->features = (struct chassis_features) { - .ct_no_masked_label = true, - .mac_binding_timestamp = true, - .ct_lb_related = true, - .fdb_timestamp = true, - }; + northd_enable_all_features(data); data->ovn_internal_version_changed = false; sset_init(&data->svc_monitor_lsps); data->change_tracked = false; @@ -17192,7 +17198,12 @@ ovnnb_db_run(struct northd_input *input_data, false); use_common_zone = smap_get_bool(&nb->options, "use_common_zone", false); - build_chassis_features(input_data->sbrec_chassis_table, &data->features); + if (smap_get_bool(&nb->options, "ignore_chassis_features", false)) { + northd_enable_all_features(data); + } else { + build_chassis_features(input_data->sbrec_chassis_table, + &data->features); + } init_debug_config(nb); diff --git a/ovn-nb.xml b/ovn-nb.xml index 9131305ea99e..1de0c30416ce 100644 --- a/ovn-nb.xml +++ b/ovn-nb.xml @@ -157,6 +157,29 @@ + +

+ When set to false, the ovn-northd will + evaluate the features supported by each chassis and will only + activate features that are universally supported by all chassis. This + approach is crucial for maintaining backward compatibility during an + upgrade when the ovn-northd is updated prior to the + ovn-controller. However, if any chassis is poorly + managed and the upgrade is unsuccessful, it will restrict + ovn-northd from activating the new features. +

+

+ Alternatively, setting this option to true instructs + ovn-northd to bypass the support status of features on + each chassis and to directly implement the latest features. This + approach safeguards the operation of ovn-northd from + being adversely affected by a mismatched configuration of a chassis. +

+

+ The default setting for this option is false. +

+
+ Configure a given OUI to be used as prefix when L2 address is dynamically assigned, e.g. 00:11:22