Skip to content

Commit

Permalink
northd: I-P for logical switch creation in en_ls_stateful engine node.
Browse files Browse the repository at this point in the history
en_northd engine nodes provides the created or updated logical switches
in its tracked data and en_ls_stateful node handles these changes.

Signed-off-by: Numan Siddique <numans@ovn.org>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
numansiddique authored and ovsrobot committed Jan 10, 2025
1 parent 6fa5a8a commit 9643990
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions northd/en-ls-stateful.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,9 @@ ls_stateful_northd_handler(struct engine_node *node, void *data_)
return false;
}

if (northd_has_lswitchs_in_tracked_data(&northd_data->trk_data)) {
return false;
}

if (!northd_has_ls_lbs_in_tracked_data(&northd_data->trk_data) &&
!northd_has_ls_acls_in_tracked_data(&northd_data->trk_data)) {
!northd_has_ls_acls_in_tracked_data(&northd_data->trk_data) &&
!northd_has_lswitchs_in_tracked_data(&northd_data->trk_data)) {
return true;
}

Expand All @@ -153,6 +150,10 @@ ls_stateful_northd_handler(struct engine_node *node, void *data_)
struct hmapx_node *hmapx_node;

struct hmapx changed_stateful_od = HMAPX_INITIALIZER(&changed_stateful_od);
HMAPX_FOR_EACH (hmapx_node, &nd_changes->trk_switches.crupdated) {
hmapx_add(&changed_stateful_od, hmapx_node->data);
}

HMAPX_FOR_EACH (hmapx_node, &nd_changes->ls_with_changed_lbs) {
hmapx_add(&changed_stateful_od, hmapx_node->data);
}
Expand All @@ -166,9 +167,14 @@ ls_stateful_northd_handler(struct engine_node *node, void *data_)

struct ls_stateful_record *ls_stateful_rec = ls_stateful_table_find_(
&data->table, od->nbs);
ovs_assert(ls_stateful_rec);
ls_stateful_record_reinit(ls_stateful_rec, od, NULL,
if (!ls_stateful_rec) {
ls_stateful_rec =
ls_stateful_record_create(&data->table, od,
input_data.ls_port_groups);
} else {
ls_stateful_record_reinit(ls_stateful_rec, od, NULL,
input_data.ls_port_groups);
}

/* Add the ls_stateful_rec to the tracking data. */
hmapx_add(&data->trk_data.crupdated, ls_stateful_rec);
Expand Down
2 changes: 1 addition & 1 deletion tests/ovn-northd.at
Original file line number Diff line number Diff line change
Expand Up @@ -14287,7 +14287,7 @@ check ovn-nbctl --wait=sb sync
check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats
check ovn-nbctl --wait=sb ls-add sw0
check_engine_stats northd norecompute compute
check_engine_stats ls_stateful recompute nocompute
check_engine_stats ls_stateful norecompute compute
check_engine_stats lflow recompute nocompute

# For the below engine nodes, en_northd is input. So check
Expand Down

0 comments on commit 9643990

Please sign in to comment.