From patchwork Thu Sep 3 02:13:45 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Han Zhou
X-Patchwork-Id: 1356299
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 4Bhkrd27t7z9sTR
for ; Thu, 3 Sep 2020 12:14:08 +1000 (AEST)
Received: from localhost (localhost [127.0.0.1])
by whitealder.osuosl.org (Postfix) with ESMTP id 94F5C86B15;
Thu, 3 Sep 2020 02:14:06 +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 p6G6ZVrIkYmQ; Thu, 3 Sep 2020 02:14:05 +0000 (UTC)
Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])
by whitealder.osuosl.org (Postfix) with ESMTP id 2858786AFA;
Thu, 3 Sep 2020 02:14:05 +0000 (UTC)
Received: from lf-lists.osuosl.org (localhost [127.0.0.1])
by lists.linuxfoundation.org (Postfix) with ESMTP id 04B91C0052;
Thu, 3 Sep 2020 02:14:05 +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 BBDBDC0051
for ; Thu, 3 Sep 2020 02:14:03 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by fraxinus.osuosl.org (Postfix) with ESMTP id B634C86B82
for ; Thu, 3 Sep 2020 02:14:03 +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 i0gN97Lthjy8 for ;
Thu, 3 Sep 2020 02:14:02 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net
[217.70.183.200])
by fraxinus.osuosl.org (Postfix) with ESMTPS id 4D72586B84
for ; Thu, 3 Sep 2020 02:14:02 +0000 (UTC)
X-Originating-IP: 216.113.160.71
Received: from localhost.localdomain.localdomain (unknown [216.113.160.71])
(Authenticated sender: hzhou@ovn.org)
by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E7B0820005;
Thu, 3 Sep 2020 02:13:57 +0000 (UTC)
From: Han Zhou
To: dev@openvswitch.org
Date: Wed, 2 Sep 2020 19:13:45 -0700
Message-Id: <1599099225-113525-1-git-send-email-hzhou@ovn.org>
X-Mailer: git-send-email 2.1.0
Cc: Han Zhou
Subject: [ovs-dev] [PATCH ovn] 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
check_lsp_is_up to disable the check (when setting to "false") for the
use cases when ARP reponse for a port that is "down" isn't considered
harmful.
Signed-off-by: Han Zhou
Acked-by: Numan Siddique with those addressed.
---
northd/ovn-northd.8.xml | 15 ++++++++++-----
northd/ovn-northd.c | 7 ++++++-
ovn-nb.xml | 18 ++++++++++++++++++
tests/ovn-northd.at | 14 ++++++++++++++
4 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/northd/ovn-northd.8.xml b/northd/ovn-northd.8.xml
index 989e364..df43eb6 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
+ check_lsp_is_up
is configured as false 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
+ check_lsp_is_up
is configured as false 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 7be0e85..291713e 100644
--- a/northd/ovn-northd.c
+++ b/northd/ovn-northd.c
@@ -86,6 +86,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
@@ -6739,7 +6741,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;
}
@@ -11722,6 +11725,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,
+ "check_lsp_is_up", true);
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 1f2dbb9..4e34518 100644
--- a/ovn-nb.xml
+++ b/ovn-nb.xml
@@ -147,6 +147,24 @@
+
+
+ If set to true, 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 false, 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
+ false
can reduce the load and latency of the control
+ plane. The default value is true
.
+
+
+
+ If the value is nonzero, then it will be forced to a value of
+ at least 1000 ms.
+
+
+
These options control how routes are advertised between OVN
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 8344c7f..c98df49 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -1781,3 +1781,17 @@ AT_CHECK([ovn-sbctl lflow-list | grep "ls_out_pre_lb.*priority=100" | grep reg0
])
AT_CLEANUP
+
+AT_SETUP([ovn -- disable check_lsp_is_up])
+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:check_lsp_is_up=false
+AT_CHECK([ovn-sbctl lflow-list | grep arp | grep 10\.0\.0\.1], [0], [ignore])
+
+AT_CLEANUP