diff mbox series

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

Message ID 20210304041012.4128938-11-blp@ovn.org
State Deferred
Headers show
Series ovn-northd-ddlog improvements | expand

Commit Message

Ben Pfaff March 4, 2021, 4:10 a.m. UTC
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@ovn.org>
---
 northd/lrouter.dl | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff mbox series

Patch

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) :-