From patchwork Tue Oct 15 13:35: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: 1997436 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=gGrjYKLj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::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 4XSZqb4rVfz1xsc for ; Wed, 16 Oct 2024 00:35:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id CF36760710; Tue, 15 Oct 2024 13:35:53 +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 eKKOLSjEB2RN; Tue, 15 Oct 2024 13:35:52 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D1BC0606B8 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=gGrjYKLj Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id D1BC0606B8; Tue, 15 Oct 2024 13:35:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9ED25C08A6; Tue, 15 Oct 2024 13:35:52 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 872F4C08A3 for ; Tue, 15 Oct 2024 13:35:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 67417403C7 for ; Tue, 15 Oct 2024 13:35:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id QYWkxl7M9IiT for ; Tue, 15 Oct 2024 13:35:50 +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 smtp2.osuosl.org 337E7400C1 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 337E7400C1 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gGrjYKLj Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 337E7400C1 for ; Tue, 15 Oct 2024 13:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728999347; 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=+xux6QnLi0bhvSwDMptBPlfOnYfMPnbod95PSO0KHy0=; b=gGrjYKLjHYWlg8vJ6O7txaOgWWG8acpCwd6hQwJsRE9kfaLJ1OcHextzKkBqLk3QKHSKni n3a54zm7Z61B+iuO5BbrxqIxc3MddS0cXuKW8Om2r6p+kWtehZdquyJeCx0jARXzNmnMsH XFV0C6Oulurr3quxeg0+wZhHQXijFzA= 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-328-iarVSDgoMhCnHd5m7k1qVQ-1; Tue, 15 Oct 2024 09:35:46 -0400 X-MC-Unique: iarVSDgoMhCnHd5m7k1qVQ-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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 418E91955DC8 for ; Tue, 15 Oct 2024 13:35:45 +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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B3B9019560AE; Tue, 15 Oct 2024 13:35:44 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Tue, 15 Oct 2024 15:35:42 +0200 Message-Id: <20241015133543.1391024-1-xsimonar@redhat.com> In-Reply-To: <20241014104537.3311385-1-xsimonar@redhat.com> References: <20241014104537.3311385-1-xsimonar@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 v2 1/2] controller: Update related ports when parent of container is deleted. 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" There were a few cases where container ports was not removed from related ports when the parent was deleted. For instance, when a vif is bound to chassis 1 becomes claimed by chassis 2 and is deleted before it's postponed on chassis 1. Signed-off-by: Xavier Simonart --- v2: Remove unused variable. --- controller/binding.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/controller/binding.c b/controller/binding.c index 492aef530..f3df5edb7 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -2782,27 +2782,25 @@ handle_deleted_vif_lport(const struct sbrec_port_binding *pb, struct binding_ctx_out *b_ctx_out) { struct local_binding *lbinding = NULL; - bool bound = false; struct shash *binding_lports = &b_ctx_out->lbinding_data->lports; struct binding_lport *b_lport = binding_lport_find(binding_lports, pb->logical_port); if (b_lport) { lbinding = b_lport->lbinding; - bound = is_binding_lport_this_chassis(b_lport, b_ctx_in->chassis_rec); /* Remove b_lport from local_binding. */ binding_lport_delete(binding_lports, b_lport); } - if ((lbinding && lport_type == LP_VIF) && - (bound || sset_find_and_delete(b_ctx_out->postponed_ports, - pb->logical_port))) { + if (lbinding && lport_type == LP_VIF) { + sset_find_and_delete(b_ctx_out->postponed_ports, pb->logical_port); /* We need to release the container/virtual binding lports (if any) if * deleted 'pb' type is LP_VIF. */ struct binding_lport *c_lport; LIST_FOR_EACH (c_lport, list_node, &lbinding->binding_lports) { sset_find_and_delete(b_ctx_out->postponed_ports, c_lport->name); remove_local_lports(c_lport->pb->logical_port, b_ctx_out); + remove_related_lport(c_lport->pb, b_ctx_out); if (!release_binding_lport(b_ctx_in->chassis_rec, c_lport, !b_ctx_in->ovnsb_idl_txn, b_ctx_out)) {