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.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianc...@redhat.com>
---
 northd/northd.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/northd/northd.c b/northd/northd.c
index a56666297..bcb470043 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -7004,14 +7004,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;
+            }
         }
     }
 }
-- 
2.35.1

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

Reply via email to