Skip to content

Commit

Permalink
ovn-northd-ddlog: Optimize AggregatedFlow rules.
Browse files Browse the repository at this point in the history
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 <hzhou@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Mark Michelson <mmichels@redhat.com>
  • Loading branch information
blp authored and putnopvut committed Jul 23, 2021
1 parent da4d138 commit c8565bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions northd/ovn_northd.dl
Expand Up @@ -1689,18 +1689,18 @@ 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,
.__match = __match,
.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
Expand Down

0 comments on commit c8565bb

Please sign in to comment.