>From 747d3c040d29e5abf2ddc45bd8fd4e904cfb53b3 Mon Sep 17 00:00:00 2001
From: chandlerwu <[email protected]>
Date: Mon, 6 May 2024 11:58:21 +0800
Fixes: 1b3557f53dbc ("vswitchd, ofproto-dpif: Propagate the
 CT limit from database.")

If we create a zone for the first time, the new tp_cfg will be
copied to the zone, see `ct_zone_alloc`. Then `update_timeout_policy``
will find the new copied tp== tp_cfg, so
``ofproto_ct_set_zone_timeout_policy`
will not be called.

Signed-off-by: chandlerwu <[email protected]>
---
 vswitchd/bridge.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 95a65fcdc..2c8362a35 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -766,6 +766,9 @@ ct_zones_reconfigure(struct datapath *dp, struct
ovsrec_datapath *dp_cfg)
         if (!ct_zone) {
             ct_zone = ct_zone_alloc(zone_id, tp_cfg);
             hmap_insert(&dp->ct_zones, &ct_zone->node, hash_int(zone_id,
0));
+            ofproto_ct_set_zone_timeout_policy(dp->type, ct_zone->zone_id,
+                                               &ct_zone->tp);
+            goto post_update;
         }

         struct simap new_tp = SIMAP_INITIALIZER(&new_tp);
@@ -780,6 +783,7 @@ ct_zones_reconfigure(struct datapath *dp, struct
ovsrec_datapath *dp_cfg)
             }
         }

+    post_update:;
         int64_t desired_limit = zone_cfg->limit ? *zone_cfg->limit : -1;
         if (ct_zone->limit != desired_limit) {
             ofproto_ct_zone_limit_update(dp->type, zone_id,
zone_cfg->limit);
-- 
2.39.2
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to