From patchwork Mon Sep 7 06:45:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1358612 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.137; helo=fraxinus.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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BlJhl3FPGz9sSP for ; Mon, 7 Sep 2020 16:46:15 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 80BCC858C9; Mon, 7 Sep 2020 06:46:12 +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 oYb5Y9dPHUzz; Mon, 7 Sep 2020 06:46:12 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id F040A8543A; Mon, 7 Sep 2020 06:46:11 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DACFDC0859; Mon, 7 Sep 2020 06:46:11 +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 CCCBEC0051 for ; Mon, 7 Sep 2020 06:46:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BB99B858B8 for ; Mon, 7 Sep 2020 06:46:09 +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 sQjm8-Q4wf9s for ; Mon, 7 Sep 2020 06:46:08 +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 0E65B8543A for ; Mon, 7 Sep 2020 06:46:07 +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 BA9CD100009; Mon, 7 Sep 2020 06:46:03 +0000 (UTC) From: Han Zhou To: dev@openvswitch.org Date: Sun, 6 Sep 2020 23:45:33 -0700 Message-Id: <1599461142-84752-1-git-send-email-hzhou@ovn.org> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Cc: Han Zhou Subject: [ovs-dev] [PATCH ovn v2 0/9] Incremental processing for flow installation. 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" Incremental processing has been implementation in ovn-controller, but we were still doing full comparison between desired flow table and installed flow table every time to figure out the changes need to be pushed to OVS. This series is mainly to utilize the incremental processing information to figure out flow changes to OVS without full table scanning, to further reduce CPU of ovn-controller. In ovn-scale-test with 3000 HVs and 30k lports, the end-to-end latency between the moment a lflow is updated in SB DB and the moment when all the 3K HVs complete OVS flow updating has reduced around 60% (from 1s to 400ms). perf report also shows ~40% of CPU reduced in ovn-controller. Another important change of this series is the fix of the conjunction handling problem. v1 -> v2: - Addressed Mark's comments for defining different data types for desired flows and installed flows, and related refactoring. (patch 6/9) - Updated comments for the cross reference structures between desired flows and SB UUIDs with a diagram to help understanding. (patch 4/9) Han Zhou (9): ofctrl: change ofctrl_dup_flow to module internal function ovn.at: Fix AT for conjunction case. lflow.c: No need to remove flows for adding new datapath. ovn-controller: Fix conjunction handling with incremental processing. ovn.at: Add test case for duplicated flow handling. ofctrl.c: Maintain references between installed flows and desired flows. ofctrl.c: Refactor - move openflow msg construction to functions. ofctrl: Incremental processing for flow installation by tracking. ofctrl.c: Merge opposite changes of tracked flows before installing. controller/lflow.c | 106 ++++-- controller/ofctrl.c | 1041 +++++++++++++++++++++++++++++++++++++++++---------- controller/ofctrl.h | 39 +- tests/ovn.at | 225 ++++++++++- 4 files changed, 1164 insertions(+), 247 deletions(-) Acked-by: Mark Michelson