[ovs-dev] [PATCH ovn 10/11] ovn-northd-ddlog: Rephrase RouterStaticRoute rule.

Ben Pfaff blp at ovn.org
Thu Mar 4 04:10:11 UTC 2021


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 <blp at ovn.org>
---
 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<route_dst>)
 
 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) :-
-- 
2.29.2



More information about the dev mailing list