From patchwork Fri Jul 19 15:35:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1962540 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=IAsN2PnO; 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 4WQYgF6S9mz1ySl for ; Sat, 20 Jul 2024 01:36:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 55A188211D; Fri, 19 Jul 2024 15:36:17 +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 Y2_JJ7ZAObq5; Fri, 19 Jul 2024 15:36:15 +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 10F528210F 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=IAsN2PnO Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 10F528210F; Fri, 19 Jul 2024 15:36:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BD6C3C0A9B; Fri, 19 Jul 2024 15:36:14 +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 E51D5C0A96 for ; Fri, 19 Jul 2024 15:36:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D5AB5607AB for ; Fri, 19 Jul 2024 15:36:10 +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 nAqTZvYPAY1i for ; Fri, 19 Jul 2024 15:36:10 +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 smtp3.osuosl.org 232FB6079B Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 232FB6079B Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IAsN2PnO Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 232FB6079B for ; Fri, 19 Jul 2024 15:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721403369; 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=cUazQNY6IildxHkuCoIld4jqaNu+cgPsEKDmtSo3VJU=; b=IAsN2PnOAx5Y1XhMNyH5r8zGZL3Q9XpMRrFKA8eqwds3Yb3hMuh8eEB27QnQEAvXtB4cHK Hj0KGGeP8MO3khhwa623oF3VSwm6jhhmYPgm4j4NSGXZZ922C4JayjQRuaeNCcnYqvkyPi bLbOZUVY1tUNORxoO0LOH12cMpx8xlU= Received: from mx-prod-mc-05.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-90-DihfxmusNV2yGkaGh8Odpg-1; Fri, 19 Jul 2024 11:36:07 -0400 X-MC-Unique: DihfxmusNV2yGkaGh8Odpg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C8B041955F77 for ; Fri, 19 Jul 2024 15:36:06 +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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1B9C81955D4D; Fri, 19 Jul 2024 15:36:05 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Fri, 19 Jul 2024 17:35:59 +0200 Message-Id: <20240719153603.2914663-4-xsimonar@redhat.com> In-Reply-To: <20240719153603.2914663-1-xsimonar@redhat.com> References: <20240719153603.2914663-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 3/7] binding: Cleanup related_lports for deleted ports. 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 is deleted, remove it from the related ports. Some ports, such a l3gw ports for non local datapaths, can be related while not belonging to a local datapath. Remove such ports from related_lports when they are deleted. Some tests, such as "delete mac bindings" or "router port add then remove - distributed router gateway port" were already testing such scenarios, but were were checking whether related_lports 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 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/controller/binding.c b/controller/binding.c index 97f4545a4..1bb5cca52 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -2734,6 +2734,7 @@ handle_deleted_lport(const struct sbrec_port_binding *pb, struct binding_ctx_in *b_ctx_in, struct binding_ctx_out *b_ctx_out) { + remove_related_lport(pb, b_ctx_out); /* If the binding is local, remove it. */ struct local_datapath *ld = get_local_datapath(b_ctx_out->local_datapaths, @@ -2751,15 +2752,6 @@ handle_deleted_lport(const struct sbrec_port_binding *pb, return; } - /* - * Remove localport that was part of local datapath that is not - * considered to be local anymore. - */ - if (!ld && !strcmp(pb->type, "localport") && - sset_find(&b_ctx_out->related_lports->lport_names, pb->logical_port)) { - remove_related_lport(pb, b_ctx_out); - } - /* If the binding is not local, if 'pb' is a L3 gateway port, we should * remove its peer, if that one is local. */