From: Ben Pfaff <b...@ovn.org>

This should avoid some work by doing the cheapest check (the one on
UseLogicalDatapathGroups) before any joins.  DDlog is probably
factoring out the reference to the Flow relation, which is identical
in both, but this ought to avoid the group_by aggregation (which is
relatively expensive) in the case where UseLogicalDatapathGroups is
not enabled.

Acked-by: Han Zhou <hz...@ovn.org>
Acked-by: Dumitru Ceara <dce...@redhat.com>
Signed-off-by: Ben Pfaff <b...@ovn.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianc...@redhat.com>
---
 northd/ovn_northd.dl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl
index ab33a139e..bfa15bf09 100644
--- a/northd/ovn_northd.dl
+++ b/northd/ovn_northd.dl
@@ -1689,9 +1689,9 @@ AggregatedFlow(.logical_datapaths = g.to_set(),
                .actions = actions,
                .tags = tags,
                .external_ids = external_ids) :-
+    UseLogicalDatapathGroups[true],
     TaggedFlow(logical_datapath, stage, priority, __match, actions, tags, 
external_ids),
-    var g = logical_datapath.group_by((stage, priority, __match, actions, 
tags, external_ids)),
-    UseLogicalDatapathGroups[true].
+    var g = logical_datapath.group_by((stage, priority, __match, actions, 
tags, external_ids)).
 AggregatedFlow(.logical_datapaths = set_singleton(logical_datapath),
                .stage = stage,
                .priority = priority,
@@ -1699,8 +1699,8 @@ AggregatedFlow(.logical_datapaths = 
set_singleton(logical_datapath),
                .actions = actions,
                .tags = tags,
                .external_ids = external_ids) :-
-    TaggedFlow(logical_datapath, stage, priority, __match, actions, tags, 
external_ids),
-    UseLogicalDatapathGroups[false].
+    UseLogicalDatapathGroups[false],
+    TaggedFlow(logical_datapath, stage, priority, __match, actions, tags, 
external_ids).
 
 for (f in AggregatedFlow()) {
     var pipeline = if (f.stage.pipeline == Ingress) "ingress" else "egress" in
-- 
2.31.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to