From patchwork Fri Jul 16 11:45:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1506143 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.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GR8b40gbCz9sXM for ; Fri, 16 Jul 2021 21:46:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 4B30884446; Fri, 16 Jul 2021 11:46:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2huZcqkxj5OG; Fri, 16 Jul 2021 11:46:21 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id A298384419; Fri, 16 Jul 2021 11:46:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 79E18C001A; Fri, 16 Jul 2021 11:46:20 +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 E2E5AC000E for ; Fri, 16 Jul 2021 11:46:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C6D3B40F19 for ; Fri, 16 Jul 2021 11:46:05 +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 F1O1I-JzWwFb for ; Fri, 16 Jul 2021 11:46:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by smtp2.osuosl.org (Postfix) with ESMTPS id 1DC4F40F0D for ; Fri, 16 Jul 2021 11:46:04 +0000 (UTC) Received: (Authenticated sender: numans@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 9133AC0015; Fri, 16 Jul 2021 11:46:02 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Fri, 16 Jul 2021 07:45:40 -0400 Message-Id: <20210716114540.1895900-1-numans@ovn.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210716114158.1895109-1-numans@ovn.org> References: <20210716114158.1895109-1-numans@ovn.org> MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn v2 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. Signed-off-by: Numan Siddique Acked-by: Han Zhou --- controller/binding.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/controller/binding.c b/controller/binding.c index 39119c0c3..0fd951ad7 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1240,6 +1240,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);