Skip to content

Commit

Permalink
northd: fix lflow grouping in build_lb_rules
Browse files Browse the repository at this point in the history
Do not group lflows if the corresponding datapath does not run
copp meters and the previous one has an associated copp entry.
In order to fix the issue reset lflow_ref pointer to NULL if the logical
router/logical flow runs a copp meter.

Fixes: deec972 ("northd: optimize build_lb_rules routine")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit 664f2aa)
  • Loading branch information
LorenzoBianconi authored and numansiddique committed May 16, 2022
1 parent fcbe70b commit bfa8019
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions northd/northd.c
Expand Up @@ -6865,14 +6865,15 @@ build_lb_rules(struct hmap *lflows, struct ovn_northd_lb *lb,
if (reject) {
meter = copp_meter_get(COPP_REJECT, od->nbs->copp,
meter_groups);
} else if (ovn_dp_group_add_with_reference(lflow_ref, od)) {
continue;
}
lflow_ref = ovn_lflow_add_at_with_hash(lflows, od,
S_SWITCH_IN_LB, priority,
ds_cstr(match), ds_cstr(action),
NULL, meter, &lb->nlb->header_,
OVS_SOURCE_LOCATOR, hash);
if (meter || !ovn_dp_group_add_with_reference(lflow_ref, od)) {
struct ovn_lflow *lflow = ovn_lflow_add_at_with_hash(
lflows, od, S_SWITCH_IN_LB, priority,
ds_cstr(match), ds_cstr(action),
NULL, meter, &lb->nlb->header_,
OVS_SOURCE_LOCATOR, hash);
lflow_ref = meter ? NULL : lflow;
}
}
}
}
Expand Down

0 comments on commit bfa8019

Please sign in to comment.