From patchwork Thu Nov 5 07:41:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1394767 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 4CRb852hYnz9sSs for ; Thu, 5 Nov 2020 18:42:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 965C6854FC; Thu, 5 Nov 2020 07:42: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 HrJ_yEErKIvQ; Thu, 5 Nov 2020 07:42:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8388D854CC; Thu, 5 Nov 2020 07:42:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6A909C0893; Thu, 5 Nov 2020 07:42:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 93F2AC0889 for ; Thu, 5 Nov 2020 07:42:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8D22184C3C for ; Thu, 5 Nov 2020 07:42:07 +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 754QH-k0WwGL for ; Thu, 5 Nov 2020 07:42:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1494685DA0 for ; Thu, 5 Nov 2020 07:42:05 +0000 (UTC) X-Originating-IP: 115.99.213.209 Received: from nusiddiq.home.org.home.org (unknown [115.99.213.209]) (Authenticated sender: numans@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C487E1BF20B; Thu, 5 Nov 2020 07:42:00 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Thu, 5 Nov 2020 13:11:46 +0530 Message-Id: <20201105074146.3793721-1-numans@ovn.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH ovn v3 0/7] Optimize load balancer hairpin logical flows. 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 optimizes the load balancer hairpin logical flows. Presently, ovn-northd generates a lot of these logical flows. Suppose there are 'm' load balancers associated to a logical switch and each load balancer has 'n' VIPs and each VIP has 'p' backends then ovn-northd adds (m * ((n * p) + n)) hairpin logical flows. With this patch series, ovn-northd adds just 5 hairpin logical flows. To reduce the number of lflows, load balancer information is now pushed to the Southbound database using a new 'Load_Balancer' table. ovn-controller programs the OF flows required for handling the load balancer hairpin traffic directly and new OVN actions are added to abstract the hairpining from ovn-northd. v2 -> v3 ---- * Addressed most of the review comments from Dumitru. * Modified the test cases to make use of the newly added helper test functions. v1 -> v2 ----- * Addressed the review comments from Mark Michelson. * Added 2 more patches to the series to have SB Load balancer support ovn-detrace and 'ovn-sbctl --vflows' as pointed by Dumitru Ceara. Numan Siddique (7): Add new table Load_Balancer in Southbound database. northd: Refactor load balancer vip parsing. controller: Add load balancer hairpin OF flows. actions: Add new actions chk_lb_hairpin, chk_lb_hairpin_reply and ct_snat_to_vip. northd: Make use of new hairpin actions. ovn-detrace: Add SB Load Balancer cookier handler. sbctl: Add Load Balancer support for vflows option. controller/lflow.c | 251 ++++++++++++++++ controller/lflow.h | 6 +- controller/ovn-controller.c | 27 +- include/ovn/actions.h | 15 +- include/ovn/logical-fields.h | 3 + lib/actions.c | 116 +++++++- lib/automake.mk | 4 +- lib/lb.c | 237 +++++++++++++++ lib/lb.h | 79 +++++ northd/ovn-northd.8.xml | 65 ++-- northd/ovn-northd.c | 555 +++++++++++++++-------------------- ovn-sb.ovsschema | 27 +- ovn-sb.xml | 82 ++++++ tests/ovn-northd.at | 115 +++++++- tests/ovn.at | 510 +++++++++++++++++++++++++++++++- tests/test-ovn.c | 3 + utilities/ovn-detrace.in | 11 +- utilities/ovn-sbctl.c | 59 ++++ utilities/ovn-trace.c | 65 +++- 19 files changed, 1853 insertions(+), 377 deletions(-) create mode 100644 lib/lb.c create mode 100644 lib/lb.h