From patchwork Tue Sep 8 21:21:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1360094 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 4BmJ555hRxz9sTH for ; Wed, 9 Sep 2020 07:22:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3CF6F86D38; Tue, 8 Sep 2020 21:22:14 +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 ThCKDHZO1yo6; Tue, 8 Sep 2020 21:22:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id DC42986C51; Tue, 8 Sep 2020 21:22:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C0991C0859; Tue, 8 Sep 2020 21:22:10 +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 0D8C1C0051 for ; Tue, 8 Sep 2020 21:22:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F170E86CC1 for ; Tue, 8 Sep 2020 21:22:08 +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 uZpfm7jHNMrA for ; Tue, 8 Sep 2020 21:22:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2351B86E29 for ; Tue, 8 Sep 2020 21:22:06 +0000 (UTC) X-Originating-IP: 73.241.94.255 Received: from localhost.localdomain.localdomain (unknown [73.241.94.255]) (Authenticated sender: hzhou@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id CFC34FF809; Tue, 8 Sep 2020 21:22:02 +0000 (UTC) From: Han Zhou To: dev@openvswitch.org Date: Tue, 8 Sep 2020 14:21:56 -0700 Message-Id: <1599600116-129820-1-git-send-email-hzhou@ovn.org> X-Mailer: git-send-email 2.1.0 Cc: Han Zhou Subject: [ovs-dev] [PATCH ovn v2] ovn-northd: Optionally skip the check of lsp_is_up. 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" The checking of lsp "up" status before adding ARP responder flows was added to avoid confusion in cases when a network admin sees ARP response for VM/containers that is not up on chassis yet. However, this check introduces an extra round of flow change in SB and triggers computes on hypervisors which is unnecessary cost in most cases, especially for large scale environment. To improve this, this patch provides an option ignore_lsp_down to disable the check for the use cases when ARP reponse for a port that is "down" isn't considered harmful. Acked-by: Numan Siddique Signed-off-by: Han Zhou --- v1 -> v2: change the option from "check_lsp_is_up" to "ignore_lsp_down" as suggested by Numan. northd/ovn-northd.8.xml | 15 ++++++++++----- northd/ovn-northd.c | 7 ++++++- ovn-nb.xml | 13 +++++++++++++ tests/ovn-northd.at | 14 ++++++++++++++ 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml index d15245a..a275442 100644 --- a/northd/ovn-northd.8.xml +++ b/northd/ovn-northd.8.xml @@ -763,9 +763,11 @@ output;

These flows are omitted for logical ports (other than router ports or - localport ports) that are down, for logical ports of - type virtual and for logical ports with 'unknown' - address set. + localport ports) that are down (unless + ignore_lsp_down is configured as true in options + column of NB_Global table of the Northbound + database), for logical ports of type virtual and for + logical ports with 'unknown' address set.

@@ -812,8 +814,11 @@ nd_na_router {

These flows are omitted for logical ports (other than router ports or - localport ports) that are down and for logical ports of - type virtual. + localport ports) that are down (unless + ignore_lsp_down is configured as true in options + column of NB_Global table of the Northbound + database), for logical ports of type virtual and for + logical ports with 'unknown' address set.

diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index bebb25a..100d9dc 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -87,6 +87,8 @@ static struct eth_addr mac_prefix; static bool controller_event_en; +static bool check_lsp_is_up; + /* MAC allocated for service monitor usage. Just one mac is allocated * for this purpose and ovn-controller's on each chassis will make use * of this mac when sending out the packets to monitor the services @@ -6741,7 +6743,8 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports, * - port type is router or * - port type is localport */ - if (!lsp_is_up(op->nbsp) && strcmp(op->nbsp->type, "router") && + if (check_lsp_is_up && + !lsp_is_up(op->nbsp) && strcmp(op->nbsp->type, "router") && strcmp(op->nbsp->type, "localport")) { continue; } @@ -11831,6 +11834,8 @@ ovnnb_db_run(struct northd_context *ctx, controller_event_en = smap_get_bool(&nb->options, "controller_event", false); + check_lsp_is_up = !smap_get_bool(&nb->options, + "ignore_lsp_down", false); build_datapaths(ctx, datapaths, lr_list); build_ports(ctx, sbrec_chassis_by_name, datapaths, ports); diff --git a/ovn-nb.xml b/ovn-nb.xml index 109ffcf..0bfe626 100644 --- a/ovn-nb.xml +++ b/ovn-nb.xml @@ -167,6 +167,19 @@

+ +

+ If set to false, ARP/ND reply flows for logical switch ports will be + installed only if the port is up, i.e. claimed by a Chassis. If set + to true, these flows are installed regardless of the status of the + port, which can result in a situation that ARP request to an IP is + resolved even before the relevant VM/container is running. For + environments where this is not an issue, setting it to + true can reduce the load and latency of the control + plane. The default value is false. +

+
+

These options control how routes are advertised between OVN diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index c6d9ae11..b89c585 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -1991,3 +1991,17 @@ AT_CHECK([ovn-sbctl lflow-list | grep "ls_out_pre_lb.*priority=100" | grep reg0 ]) AT_CLEANUP + +AT_SETUP([ovn -- ignore_lsp_down]) +ovn_start + +ovn-nbctl ls-add sw0 +ovn-nbctl lsp-add sw0 sw0-p1 -- lsp-set-addresses sw0-p1 "aa:aa:aa:aa:aa:aa 10.0.0.1" + +ovn-nbctl --wait=sb sync +AT_CHECK([ovn-sbctl lflow-list | grep arp | grep 10\.0\.0\.1], [1], [ignore]) + +ovn-nbctl --wait=sb set NB_Global . options:ignore_lsp_down=true +AT_CHECK([ovn-sbctl lflow-list | grep arp | grep 10\.0\.0\.1], [0], [ignore]) + +AT_CLEANUP