From patchwork Mon Sep 7 06:45:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1358615 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.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BlJhv4NXXz9sR4 for ; Mon, 7 Sep 2020 16:46:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 61E478706D; Mon, 7 Sep 2020 06:46:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EEUc4LgcheVg; Mon, 7 Sep 2020 06:46:14 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id B960E8708C; Mon, 7 Sep 2020 06:46:14 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9B0B9C0893; Mon, 7 Sep 2020 06:46:14 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id BFC31C0051 for ; Mon, 7 Sep 2020 06:46:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AF0A1858B8 for ; Mon, 7 Sep 2020 06:46:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UOfmVne1He7l for ; Mon, 7 Sep 2020 06:46:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 096B58543A for ; Mon, 7 Sep 2020 06:46:09 +0000 (UTC) Received: from localhost.localdomain.localdomain (unknown [73.241.94.255]) (Authenticated sender: hzhou@ovn.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id CD8B4100014; Mon, 7 Sep 2020 06:46:07 +0000 (UTC) From: Han Zhou To: dev@openvswitch.org Date: Sun, 6 Sep 2020 23:45:36 -0700 Message-Id: <1599461142-84752-4-git-send-email-hzhou@ovn.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1599461142-84752-1-git-send-email-hzhou@ovn.org> References: <1599461142-84752-1-git-send-email-hzhou@ovn.org> Cc: Han Zhou Subject: [ovs-dev] [PATCH ovn v2 3/9] lflow.c: No need to remove flows for adding new datapath. 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" When handling a new datapath, the flows should have never existed, so there is no need to remove them before adding. Although it seems not harmful to do it, the implementation was not complete. To remove existing flows, it also need to remove the flow references. Because the flows never existed, so this wasn't a problem. So, instead of fixing the incomplete flow removing, this patch simply avoid the unnecessary operation. Signed-off-by: Han Zhou --- controller/lflow.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/controller/lflow.c b/controller/lflow.c index 1515612..0c35b7d 100644 --- a/controller/lflow.c +++ b/controller/lflow.c @@ -907,9 +907,6 @@ lflow_add_flows_for_datapath(const struct sbrec_datapath_binding *dp, const struct sbrec_logical_flow *lflow; SBREC_LOGICAL_FLOW_FOR_EACH_EQUAL ( lflow, lf_row, l_ctx_in->sbrec_logical_flow_by_logical_datapath) { - /* Remove the lflow from flow_table if present before processing it. */ - ofctrl_remove_flows(l_ctx_out->flow_table, &lflow->header_.uuid); - if (!consider_logical_flow(lflow, &dhcp_opts, &dhcpv6_opts, &nd_ra_opts, &controller_event_opts, l_ctx_in, l_ctx_out)) {