diff mbox series

[ovs-dev,v2,8/8] northd: Don't collect datapath groups for LB affinity if disabled.

Message ID 20230207114302.1908836-9-i.maximets@ovn.org
State Superseded
Delegated to: Mark Michelson
Headers show
Series northd: Hash locks and lflow creation with dp groups. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ilya Maximets Feb. 7, 2023, 11:43 a.m. UTC
If affinity timeout is not set, these datapath groups will not be used,
so no need to collect them.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 northd/northd.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/northd/northd.c b/northd/northd.c
index d2acfc502..6edea36ff 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -10674,11 +10674,13 @@  build_lrouter_nat_flows_for_lb(struct ovn_lb_vip *lb_vip,
             build_distr_lrouter_nat_flows_for_lb(&ctx, type, od);
         }
 
-        if (!lport_addresses_is_empty(&od->lb_force_snat_addrs) ||
-            od->lb_force_snat_router_ip) {
-            bitmap_set1(dp_bitmap[LROUTER_NAT_LB_AFF_FORCE_SNAT], index);
-        } else {
-            bitmap_set1(dp_bitmap[LROUTER_NAT_LB_AFF], index);
+        if (lb->affinity_timeout) {
+            if (!lport_addresses_is_empty(&od->lb_force_snat_addrs) ||
+                od->lb_force_snat_router_ip) {
+                bitmap_set1(dp_bitmap[LROUTER_NAT_LB_AFF_FORCE_SNAT], index);
+            } else {
+                bitmap_set1(dp_bitmap[LROUTER_NAT_LB_AFF], index);
+            }
         }
 
         if (sset_contains(&od->external_ips, lb_vip->vip_str)) {