From patchwork Thu Jan 9 17:36:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1220556 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=whitealder.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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47ttbD5JQrz9s29 for ; Fri, 10 Jan 2020 04:36:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7125886C80; Thu, 9 Jan 2020 17:36:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sA7-ZL0T9l9U; Thu, 9 Jan 2020 17:36:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 8F1FA8442D; Thu, 9 Jan 2020 17:36:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 71204C1796; Thu, 9 Jan 2020 17:36:52 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 00B8EC0881 for ; Thu, 9 Jan 2020 17:36:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DE72121539 for ; Thu, 9 Jan 2020 17:36:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id onK2D2N6UCLK for ; Thu, 9 Jan 2020 17:36:49 +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 silver.osuosl.org (Postfix) with ESMTPS id 4DCA121519 for ; Thu, 9 Jan 2020 17:36:49 +0000 (UTC) Received: from nummac.local (unknown [115.99.61.78]) (Authenticated sender: numans@ovn.org) by relay11.mail.gandi.net (Postfix) with ESMTPSA id C78D5100008; Thu, 9 Jan 2020 17:36:45 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Thu, 9 Jan 2020 23:06:29 +0530 Message-Id: <20200109173629.1482618-1-numans@ovn.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn 0/2] Caching logical flow expr tree for each lflow 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 This patch series tries to improve the time taken to proceess logical flows by caching the expr tree. For large scale deployments with lots of logical flows, the logical flow processing to OpenFlow rules takes a lot of time as it is CPU intensive. This patch series tries to improve this by caching the expr tree generated for each logical flow so that we don't have to generate the expr tree for each lflow_run(). Below are the details of the OVN resource in my setup No of logical switches - 49 No of logical ports - 1191 No of logical routers - 7 No of logical ports - 51 No of ACLs - 1221 No of Logical flows - 664736 On a chassis hosting 7 distributed router ports and around 1090 port bindings, the no of OVS rules was 921162. Without this patch, the function add_logical_flows() took ~15 seconds. And with this patch it took ~10 seconds. There is a good 34% improvement in logical flow processing. Numan Siddique (2): expr: Evaluate the condition expression in a separate step. ovn-controller: Cache logical flow expr tree for each lflow. controller/lflow.c | 181 +++++++++++++++++++++++++++--------- controller/lflow.h | 9 +- controller/ovn-controller.c | 17 +++- include/ovn/expr.h | 10 +- lib/expr.c | 55 ++++++++--- tests/test-ovn.c | 10 +- utilities/ovn-trace.c | 5 +- 7 files changed, 212 insertions(+), 75 deletions(-) Acked-by: Mark Michelson