From patchwork Fri Oct 11 07:59:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandr Smirnov X-Patchwork-Id: 1995929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=k2.cloud header.i=@k2.cloud header.a=rsa-sha256 header.s=cloudmail header.b=F9fYu7f6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (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 4XPzYj5Xh6z1xtp for ; Fri, 11 Oct 2024 18:59:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CCC7A81CA3; Fri, 11 Oct 2024 07:59:49 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id efT77zFJJKUT; Fri, 11 Oct 2024 07:59:48 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 835748188A Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=k2.cloud header.i=@k2.cloud header.a=rsa-sha256 header.s=cloudmail header.b=F9fYu7f6 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 835748188A; Fri, 11 Oct 2024 07:59:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9937AC08A6; Fri, 11 Oct 2024 07:59:47 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8EEF1C08A3 for ; Fri, 11 Oct 2024 07:59:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 758B160D78 for ; Fri, 11 Oct 2024 07:59:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id mxgTYu5zIC0e for ; Fri, 11 Oct 2024 07:59:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=109.73.14.252; helo=mail1.k2.cloud; envelope-from=alekssmirnov@k2.cloud; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 0A49560780 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=k2.cloud DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0A49560780 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=k2.cloud header.i=@k2.cloud header.a=rsa-sha256 header.s=cloudmail header.b=F9fYu7f6 Received: from mail1.k2.cloud (mail1.k2.cloud [109.73.14.252]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0A49560780 for ; Fri, 11 Oct 2024 07:59:42 +0000 (UTC) From: Aleksandr Smirnov DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=k2.cloud; s=cloudmail; t=1728633578; bh=UIWi4tjYfSV9HyAHC5qOUXa7dpPHSRxa1icIFvJhO4s=; h=From:To:Cc:Subject:Date; b=F9fYu7f6Iwct4Zyui/uxj1e2eajqckWOHDqEGXcYoqOxAq9lrvbk8OTej8TI3srsM 7a6WIjW9B5c3lxPkGaOOO1gS2kYzkJ07QEhBJJtXov823PpUQTeoC2uXLYFA6vVz6F tqupyKKnuIukWR5q7lVoQAiVPAz63pUuhasR0LbA= To: dev@openvswitch.org Date: Fri, 11 Oct 2024 10:59:21 +0300 Message-Id: <20241011075928.325372-1-alekssmirnov@k2.cloud> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn] northd: Populate additional-chassis to HA group. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Aleksandr Smirnov northd does not populate Port_Binding:additional-chassis to Ha_Chassis_Group:ref_chassis, so, bfd session is not created for such chassis. The fix populates additional chassis to ref chassis. Signed-off-by: Aleksandr Smirnov Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2024-September/417293.html Reported-by: Vladislav Odintsov Tested-by: Vladislav Odintsov --- northd/northd.c | 13 +++++++++++-- tests/ovn-northd.at | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 0aa0de637..088617aae 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -19041,7 +19041,14 @@ collect_lr_groups_for_ha_chassis_groups(const struct sbrec_port_binding *sb, } hmapx_add(lr_groups, lr_group); - hmapx_add(&lr_group->tmp_ha_ref_chassis, sb->chassis); + + if (sb->chassis) { + hmapx_add(&lr_group->tmp_ha_ref_chassis, sb->chassis); + } + + for (size_t i = 0; i < sb->n_additional_chassis; i++) { + hmapx_add(&lr_group->tmp_ha_ref_chassis, sb->additional_chassis[i]); + } } static void @@ -19158,7 +19165,9 @@ handle_port_binding_changes(struct ovsdb_idl_txn *ovnsb_txn, sbrec_port_binding_set_up(op->sb, &up, 1); } - if (build_ha_chassis_ref && ovnsb_txn && sb->chassis) { + if (build_ha_chassis_ref + && ovnsb_txn + && (sb->chassis || sb->n_additional_chassis)) { /* Check and collect the chassis which has claimed this 'sb' * in relation to LR groups. */ collect_lr_groups_for_ha_chassis_groups(sb, op, &lr_groups); diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index d6a8c4640..e295c721d 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -572,6 +572,7 @@ check ovn-sbctl chassis-add ch2 geneve 127.0.0.3 check ovn-sbctl chassis-add ch3 geneve 127.0.0.4 check ovn-sbctl chassis-add comp1 geneve 127.0.0.5 check ovn-sbctl chassis-add comp2 geneve 127.0.0.6 +check ovn-sbctl chassis-add cadd1 geneve 127.0.0.7 check ovn-nbctl lrp-add lr0 lr0-sw0 00:00:20:20:12:14 10.0.0.1/24 check ovn-nbctl lsp-add sw0 sw0-lr0 @@ -584,11 +585,17 @@ wait_row_count nb:Logical_Switch_Port 1 name=sw0-p1 up=true comp1_ch_uuid=$(fetch_column Chassis _uuid name=comp1) comp2_ch_uuid=$(fetch_column Chassis _uuid name=comp2) +cadd1_ch_uuid=$(fetch_column Chassis _uuid name=cadd1) + ch2_ch_uuid=$comp1_ch_uuid # Check ref_chassis. echo "comp1_ch_uuid = $comp1_ch_uuid" wait_column "$comp1_ch_uuid" HA_Chassis_Group ref_chassis +ovn-sbctl set Port_Binding sw0-p1 additional_chassis=$cadd1_ch_uuid +wait_column "$cadd1_ch_uuid $comp1_ch_uuid" HA_Chassis_Group ref_chassis +ovn-sbctl clear Port_Binding sw0-p1 additional_chassis +wait_column "$comp1_ch_uuid" HA_Chassis_Group ref_chassis # unbind sw0-p1 ovn-sbctl lsp-unbind sw0-p1