Skip to content

Commit

Permalink
controller: Fix iface-id-ver handling.
Browse files Browse the repository at this point in the history
If iface-id-ver was wrong and modified to a correct value,
the port was correctly claimed, but the flows were not installed
by I+P.

Signed-off-by: Xavier Simonart <xsimonar@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
simonartxavier authored and numansiddique committed Jun 12, 2024
1 parent 7b43959 commit 4235355
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controller/binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ update_active_pb_ras_pd(const struct sbrec_port_binding *pb,
}
}

static bool is_ext_id_changed(const struct smap *a, const struct smap *b,
const char *key);
static struct local_binding *local_binding_create(
const char *name, const struct ovsrec_interface *);
static void local_binding_add(struct shash *local_bindings,
Expand Down Expand Up @@ -2311,6 +2313,18 @@ consider_iface_claim(const struct ovsrec_interface *iface_rec,
return true;
}

/* Check if iface-id-ver just becomes correct */
struct smap *external_ids_old =
shash_find_data(b_ctx_in->iface_table_external_ids_old,
iface_rec->name);

if (external_ids_old &&
is_ext_id_changed(&iface_rec->external_ids,
external_ids_old,
"iface-id-ver")) {
b_ctx_out->local_lports_changed = true;
}

/* If multiple bindings to the same port, remove the "old" binding.
* This ensures that change tracking is correct.
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -33276,6 +33276,8 @@ check as hv1 ovs-vsctl set interface vif11 external_ids:iface-id-ver=foo

wait_for_ports_up sw0-port1

CHECK_FLOWS_AFTER_RECOMPUTE([hv1], [hv1])

AT_CHECK([as hv1 ovn-appctl -t ovn-controller debug/dump-local-bindings], [0], [dnl
Local bindings:
name: [[sw0-port1]], OVS interface name : [[vif11]], num binding lports : [[1]]
Expand Down

0 comments on commit 4235355

Please sign in to comment.