@@ -5146,6 +5146,8 @@ destroy_northd_data_tracked_changes(struct northd_data *nd)
struct northd_tracked_data *trk_changes = &nd->trk_northd_changes;
destroy_tracked_ovn_ports(&trk_changes->trk_ovn_ports);
destroy_tracked_lbs(&trk_changes->trk_lbs);
+ hmapx_clear(&trk_changes->ls_with_changed_lbs.crupdated);
+ hmapx_clear(&trk_changes->lr_with_changed_lbs.crupdated);
nd->change_tracked = false;
}
@@ -5158,6 +5160,8 @@ init_northd_tracked_data(struct northd_data *nd)
hmapx_init(&trk_changes->trk_ovn_ports.deleted);
hmapx_init(&trk_changes->trk_lbs.crupdated);
hmapx_init(&trk_changes->trk_lbs.deleted);
+ hmapx_init(&trk_changes->ls_with_changed_lbs.crupdated);
+ hmapx_init(&trk_changes->lr_with_changed_lbs.crupdated);
}
static void
@@ -5169,6 +5173,8 @@ destroy_northd_tracked_data(struct northd_data *nd)
hmapx_destroy(&trk_changes->trk_ovn_ports.deleted);
hmapx_destroy(&trk_changes->trk_lbs.crupdated);
hmapx_destroy(&trk_changes->trk_lbs.deleted);
+ hmapx_destroy(&trk_changes->ls_with_changed_lbs.crupdated);
+ hmapx_destroy(&trk_changes->lr_with_changed_lbs.crupdated);
}
@@ -5179,7 +5185,10 @@ northd_has_tracked_data(struct northd_tracked_data *trk_nd_changes)
|| !hmapx_is_empty(&trk_nd_changes->trk_ovn_ports.updated)
|| !hmapx_is_empty(&trk_nd_changes->trk_ovn_ports.deleted)
|| !hmapx_is_empty(&trk_nd_changes->trk_lbs.crupdated)
- || !hmapx_is_empty(&trk_nd_changes->trk_lbs.deleted));
+ || !hmapx_is_empty(&trk_nd_changes->trk_lbs.deleted)
+ || !hmapx_is_empty(&trk_nd_changes->ls_with_changed_lbs.crupdated)
+ || !hmapx_is_empty(&trk_nd_changes->lr_with_changed_lbs.crupdated)
+ );
}
bool
@@ -5188,6 +5197,8 @@ northd_has_only_ports_in_tracked_data(
{
return (hmapx_is_empty(&trk_nd_changes->trk_lbs.crupdated)
&& hmapx_is_empty(&trk_nd_changes->trk_lbs.deleted)
+ && hmapx_is_empty(&trk_nd_changes->ls_with_changed_lbs.crupdated)
+ && hmapx_is_empty(&trk_nd_changes->lr_with_changed_lbs.crupdated)
&& (!hmapx_is_empty(&trk_nd_changes->trk_ovn_ports.created)
|| !hmapx_is_empty(&trk_nd_changes->trk_ovn_ports.updated)
|| !hmapx_is_empty(&trk_nd_changes->trk_ovn_ports.deleted)));
@@ -5828,6 +5839,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
lb_dps->nb_ls_map) {
od = ls_datapaths->array[index];
init_lb_for_datapath(od);
+
+ /* Add the ls datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->ls_with_changed_lbs.crupdated, od);
}
hmap_remove(lb_datapaths_map, &lb_dps->hmap_node);
@@ -5909,6 +5923,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
/* Re-evaluate 'od->has_lb_vip' */
init_lb_for_datapath(od);
+
+ /* Add the ls datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->ls_with_changed_lbs.crupdated, od);
}
LIST_FOR_EACH (codlb, list_node, &trk_lb_data->crupdated_lr_lbs) {
@@ -5954,6 +5971,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
/* Re-evaluate 'od->has_lb_vip' */
init_lb_for_datapath(od);
+
+ /* Add the lr datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->lr_with_changed_lbs.crupdated, od);
}
HMAP_FOR_EACH (clb, hmap_node, &trk_lb_data->crupdated_lbs) {
@@ -5968,6 +5988,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
od = ls_datapaths->array[index];
/* Re-evaluate 'od->has_lb_vip' */
init_lb_for_datapath(od);
+
+ /* Add the ls datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->ls_with_changed_lbs.crupdated, od);
}
BITMAP_FOR_EACH_1 (index, ods_size(lr_datapaths),
@@ -5991,6 +6014,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
add_neigh_ips_to_lrouter(od, lb->neigh_mode,
&clb->inserted_vips_v4,
&clb->inserted_vips_v6);
+
+ /* Add the lr datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->lr_with_changed_lbs.crupdated, od);
}
}
@@ -6018,6 +6044,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
/* Add the lb_ips of lb_dps to the od. */
build_lrouter_lb_ips(od->lb_ips, lb_dps->lb);
+
+ /* Add the lr datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->lr_with_changed_lbs.crupdated, od);
}
for (size_t i = 0; i < lbgrp_dps->n_ls; i++) {
@@ -6026,6 +6055,9 @@ northd_handle_lb_data_changes(struct tracked_lb_data *trk_lb_data,
/* Re-evaluate 'od->has_lb_vip' */
init_lb_for_datapath(od);
+
+ /* Add the ls datapath to the northd tracked data. */
+ hmapx_add(&nd_changes->ls_with_changed_lbs.crupdated, od);
}
/* Add the lb to the northd tracked data. */
@@ -107,12 +107,24 @@ struct tracked_lbs {
struct hmapx deleted;
};
+/* Tracked logical switches whose load balancers have changed. */
+struct tracked_lswitches_with_changed_lbs {
+ struct hmapx crupdated;
+};
+
+/* Tracked logical routers whose load balancers have changed. */
+struct tracked_lrouters_with_changed_lbs {
+ struct hmapx crupdated;
+};
+
/* Track what's changed in the northd engine node.
* Now only tracks ovn_ports (of vif type) - created, updated
* and deleted. */
struct northd_tracked_data {
struct tracked_ovn_ports trk_ovn_ports;
struct tracked_lbs trk_lbs;
+ struct tracked_lswitches_with_changed_lbs ls_with_changed_lbs;
+ struct tracked_lrouters_with_changed_lbs lr_with_changed_lbs;
};
struct northd_data {