From patchwork Wed Jul 28 02:47:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1510694 X-Patchwork-Delegate: zhouhan@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GZJ4Z2nhyz9sWX for ; Wed, 28 Jul 2021 12:48:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0DD786081C; Wed, 28 Jul 2021 02:48:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7j166b1xCxLT; Wed, 28 Jul 2021 02:48:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 48B686082C; Wed, 28 Jul 2021 02:48:09 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 04DD7C001A; Wed, 28 Jul 2021 02:48:09 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2DC27C000E for ; Wed, 28 Jul 2021 02:48:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B68BC404E4 for ; Wed, 28 Jul 2021 02:47:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eVJuHbdVaA01 for ; Wed, 28 Jul 2021 02:47:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp2.osuosl.org (Postfix) with ESMTPS id 1B29B404FB for ; Wed, 28 Jul 2021 02:47:56 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 8673E60004; Wed, 28 Jul 2021 02:47:54 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Tue, 27 Jul 2021 22:47:42 -0400 Message-Id: <20210728024742.2945613-1-numans@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210728024512.2944939-1-numans@ovn.org> References: <20210728024512.2944939-1-numans@ovn.org> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn v3 3/5] binding: Track the changes of container lport when it's parent changes. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Numan Siddique When a container logical port's parent changes and if the parent logical port resides in the same chassis as the old parent, ovn-controller doesn't track that change in the 'tracked_dp_bindings'. At present this is not an issue because pflow_output engine handles this in the port_binding change handler. However, it is better to track this in the runtime_data. Acked-by: Han Zhou Signed-off-by: Numan Siddique --- controller/binding.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controller/binding.c b/controller/binding.c index 2703e09cf..61cb8ccf4 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1242,6 +1242,15 @@ consider_container_lport(const struct sbrec_port_binding *pb, } 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 && b_lport->lbinding != parent_lbinding) { + /* The container lport's parent has changed. So remove it from + * the related_lports so that it is tracked. */ + remove_related_lport(b_lport->pb, b_ctx_out); + } + struct binding_lport *container_b_lport = local_binding_add_lport(binding_lports, parent_lbinding, pb, LP_CONTAINER);