From patchwork Wed Oct 9 08:06:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1994586 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=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e3geRERL; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 4XNlvV2q18z1xsv for ; Wed, 9 Oct 2024 19:11:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9688B608A2; Wed, 9 Oct 2024 08:10:58 +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 mIbMRGVIRaap; Wed, 9 Oct 2024 08:10:57 +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 smtp3.osuosl.org 690B260811 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e3geRERL Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 690B260811; Wed, 9 Oct 2024 08:10:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 375E2C08A6; Wed, 9 Oct 2024 08:10:57 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 497F9C08A3 for ; Wed, 9 Oct 2024 08:10:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 29EA581215 for ; Wed, 9 Oct 2024 08:10:55 +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 11-KJNKuK_Mm for ; Wed, 9 Oct 2024 08:10:54 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=amusil@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 29E4A8120F Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 29E4A8120F Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e3geRERL Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 29E4A8120F for ; Wed, 9 Oct 2024 08:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728461452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1GYMqSA2PaxQGPWumllDXlmdDPQvf6/J1lhIEhd4oRE=; b=e3geRERLJqUdEte4arC7NWF3bn24Luk/AcWRyDL7Ytq+TgulMm1GXuOSLotbh6mn76yK+c +6YipkmCD2z/9wsu4ISS9TI5vnnzMrNnNqocd3gNpQvDKN7CAmVXk0I9HfnjMLrD6nAJJt 3zEE1/x799iaqEYZ0d60oJ1EPOnlyQs= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-Q3r5h07YPX2VAabJ3jpveg-1; Wed, 09 Oct 2024 04:10:51 -0400 X-MC-Unique: Q3r5h07YPX2VAabJ3jpveg-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1F25318D6518 for ; Wed, 9 Oct 2024 08:06:58 +0000 (UTC) Received: from amusil.brq.redhat.com (unknown [10.43.17.32]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34DCE19560A2; Wed, 9 Oct 2024 08:06:56 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Wed, 9 Oct 2024 10:06:56 +0200 Message-ID: <20241009080656.605381-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] northd: Allow multichassis port to be bound on remote chassis. 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" In order to support tunneling with multichassis port across multiple AZ allow the port to be bound to remote chassis if there is multiple chassis requested. Reported-at: https://issues.redhat.com/browse/FDP-850 Signed-off-by: Ales Musil --- northd/northd.c | 16 ++++++++-------- tests/ovn.at | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 0aa0de637..964cac114 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -3197,25 +3197,25 @@ ovn_port_update_sbrec(struct ovsdb_idl_txn *ovnsb_txn, } } - if (lsp_is_remote(op->nbsp)) { + if (lsp_is_remote(op->nbsp) || + op->sb->requested_additional_chassis) { /* ovn-northd is supposed to set port_binding for remote ports - * if requested chassis is marked as remote. */ + * if requested chassis is marked as remote. In addition, + * if the primary chassis is remote bind it.*/ if (op->sb->requested_chassis && smap_get_bool(&op->sb->requested_chassis->other_config, "is-remote", false)) { sbrec_port_binding_set_chassis(op->sb, op->sb->requested_chassis); - smap_add(&options, "is-remote-nb-bound", "true"); - } else if (smap_get_bool(&op->sb->options, - "is-remote-nb-bound", false)) { + } else { sbrec_port_binding_set_chassis(op->sb, NULL); - smap_add(&options, "is-remote-nb-bound", "false"); } } else if (op->sb->chassis && smap_get_bool(&op->sb->chassis->other_config, "is-remote", false)) { - /* Its not a remote port but if the chassis is set and if its a - * remote chassis then clear it. */ + /* It's not a remote port but if the chassis is set and if + * it's a remote chassis, and we don't have any additional + * chassis then clear it. */ sbrec_port_binding_set_chassis(op->sb, NULL); } diff --git a/tests/ovn.at b/tests/ovn.at index 4e8c5bd8a..0eb7c6c8d 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -39027,3 +39027,53 @@ OVN_CLEANUP([hv1],[hv2]) AT_CLEANUP ]) + +OVN_FOR_EACH_NORTHD([ +AT_SETUP([Multichassis port with remote chassis]) +ovn_start + +net_add n1 + +sim_add hv1 +as hv1 +check ovs-vsctl add-br br-phys +ovn_attach n1 br-phys 192.168.0.11 + +check ovn-sbctl chassis-add hv2 geneve 192.168.0.12 \ + -- set chassis hv2 other_config:is-remote=true + +check ovn-nbctl ls-add ls +check ovn-nbctl lsp-add ls multi + +check ovs-vsctl -- add-port br-int multi \ + -- set Interface multi external-ids:iface-id=multi + +local_chassis=$(fetch_column Chassis _uuid name=hv1) +remote_chassis=$(fetch_column Chassis _uuid name=hv2) + +check ovn-nbctl --wait=hv lsp-set-options multi requested-chassis=hv1 +wait_for_ports_up multi + +# Check that it is bound locally +check_column $local_chassis Port_Binding chassis logical_port=multi +check_column "[]" Port_Binding additional_chassis logical_port=multi + +check ovn-nbctl --wait=hv lsp-set-options multi requested-chassis=hv2,hv1 +wait_for_ports_up multi + +# Check that it is bound on remote as primary and additional locally +check_column $remote_chassis Port_Binding chassis logical_port=multi +check_column "[$local_chassis]" Port_Binding additional_chassis logical_port=multi + +check ovn-nbctl --wait=hv lsp-set-options multi requested-chassis=hv2 \ + -- lsp-set-type multi remote +wait_for_ports_up multi + +# Check that it is bound remotely +check_column $remote_chassis Port_Binding chassis logical_port=multi +check_column "[]" Port_Binding additional_chassis logical_port=multi + +OVN_CLEANUP([hv1]) + +AT_CLEANUP +])