From patchwork Thu Mar 4 04:10:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1447085 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=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DrcqQ6RXGz9sSC for ; Thu, 4 Mar 2021 15:10:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2140C4326F; Thu, 4 Mar 2021 04:10:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aKjz1_LJuLtK; Thu, 4 Mar 2021 04:10:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTP id 6B1E14329B; Thu, 4 Mar 2021 04:10:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2ABBCC000D; Thu, 4 Mar 2021 04:10:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1E7DAC0019 for ; Thu, 4 Mar 2021 04:10:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 080EF4EBD6 for ; Thu, 4 Mar 2021 04:10:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aq1a-Vj9OpG6 for ; Thu, 4 Mar 2021 04:10:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by smtp4.osuosl.org (Postfix) with ESMTPS id DA6F94EBC8 for ; Thu, 4 Mar 2021 04:10:34 +0000 (UTC) X-Originating-IP: 75.54.222.30 Received: from sigfpe.attlocal.net (75-54-222-30.lightspeed.rdcyca.sbcglobal.net [75.54.222.30]) (Authenticated sender: blp@ovn.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 8355BFF805; Thu, 4 Mar 2021 04:10:32 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Wed, 3 Mar 2021 20:10:11 -0800 Message-Id: <20210304041012.4128938-11-blp@ovn.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210304041012.4128938-1-blp@ovn.org> References: <20210304041012.4128938-1-blp@ovn.org> MIME-Version: 1.0 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH ovn 10/11] ovn-northd-ddlog: Rephrase RouterStaticRoute rule. 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" I found that this slightly increased performance when there are lots of routers, probably because there's less data copying. Signed-off-by: Ben Pfaff --- northd/lrouter.dl | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/northd/lrouter.dl b/northd/lrouter.dl index 4c5cf321509e..9838c739a650 100644 --- a/northd/lrouter.dl +++ b/northd/lrouter.dl @@ -714,17 +714,14 @@ relation RouterStaticRoute( dsts : Set) RouterStaticRoute(router, key, dsts) :- - RouterStaticRoute_(.router = router, - .key = key, - .nexthop = nexthop, - .output_port = None, - .ecmp_symmetric_reply = ecmp_symmetric_reply), + rsr in RouterStaticRoute_(.router = router, .output_port = None), /* output_port is not specified, find the * router port matching the next hop. */ port in &RouterPort(.router = &Router{.lr = nb::Logical_Router{._uuid = router.lr._uuid}}, .networks = networks), - Some{var src_ip} = find_lrp_member_ip(networks, nexthop), - var dst = RouteDst{nexthop, src_ip, port, ecmp_symmetric_reply}, + Some{var src_ip} = find_lrp_member_ip(networks, rsr.nexthop), + var dst = RouteDst{rsr.nexthop, src_ip, port, rsr.ecmp_symmetric_reply}, + var key = rsr.key, var dsts = dst.group_by((router, key)).to_set(). RouterStaticRoute(router, key, dsts) :-