From patchwork Tue Jul 23 15:54:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1963961 X-Patchwork-Delegate: nusiddiq@redhat.com 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=ORf1uUmt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.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 4WT1tz0gM8z1yYm for ; Wed, 24 Jul 2024 01:55:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id EFB89812EA; Tue, 23 Jul 2024 15:55:03 +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 CHBBsMBlAlO8; Tue, 23 Jul 2024 15:55:02 +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 1E2D581299 Authentication-Results: smtp1.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=ORf1uUmt Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1E2D581299; Tue, 23 Jul 2024 15:55:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 23A59C0A9E; Tue, 23 Jul 2024 15:55:01 +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 BD4FDC0A96 for ; Tue, 23 Jul 2024 15:54:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id ACEF781203 for ; Tue, 23 Jul 2024 15:54:53 +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 2BeZ1tq7ppEg for ; Tue, 23 Jul 2024 15:54:53 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=xsimonar@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org B50208100D 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 B50208100D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id B50208100D for ; Tue, 23 Jul 2024 15:54:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721750091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=10HmBI6HWdPVW2g31Q8IevZwbzzeWDOY6znpamKdEG4=; b=ORf1uUmtWNlqy+I5B93I7jND8cJ4P283CXxDbwu2PoncQ1pFN+cCJZOcRyfjca3KuWeFwx tpoTEuA739YCMiQTB4NrjXwocCbekz0svGvtDv6C9+jfElaNFuwPrOTbwEH975LKcuQtI7 G5zpVzUijcAka2eWHK4xBhAi9Z+rlEs= Received: from mx-prod-mc-02.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-472-By64EokSN-ivbD_lWJaMkA-1; Tue, 23 Jul 2024 11:54:50 -0400 X-MC-Unique: By64EokSN-ivbD_lWJaMkA-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5E3591955F3D for ; Tue, 23 Jul 2024 15:54:49 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.anl.eng.rdu2.dc.redhat.com [10.6.38.135]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B0F16195605A; Tue, 23 Jul 2024 15:54:48 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 23 Jul 2024 17:54:42 +0200 Message-Id: <20240723155444.2530187-6-xsimonar@redhat.com> In-Reply-To: <20240723155444.2530187-1-xsimonar@redhat.com> References: <20240719153603.2914663-2-xsimonar@redhat.com> <20240723155444.2530187-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn v2 5/7] binding: Cleanup related ports on port type change. 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" When a port type is changed from e.g. patch (which is a related_port) to VIF which can be claimed by another chassis, then the port should be removed from the related_ports set. Test "ovn-controller local bindings" was already testing this but not checking whether related_ports were correct. This will be automatically tested when related_lports will be checked at the end of the tests, in a following patch. Signed-off-by: Xavier Simonart --- controller/binding.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/controller/binding.c b/controller/binding.c index 210809944..1f3f74998 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -2969,6 +2969,13 @@ handle_updated_port(struct binding_ctx_in *b_ctx_in, case LP_VIF: case LP_CONTAINER: case LP_VIRTUAL: + /* If port binding type just changed, port might be a "related_lport" + * while it should not. Remove it from that set. It will be added + * back later if needed. + */ + if (sbrec_port_binding_is_updated(pb, SBREC_PORT_BINDING_COL_TYPE)) { + remove_related_lport(pb, b_ctx_out); + } update_ld_multichassis_ports(pb, b_ctx_out->local_datapaths); handled = handle_updated_vif_lport(pb, lport_type, b_ctx_in, b_ctx_out);