On 10/29/25 7:05 PM, Han Zhou wrote:
> The encaps_cleanup function keeps non-tunnel ports in the ports array,
> allowing OVN-created tunnel ports to be cleaned up. Previously, it only
> identified regular OVN tunnels (via OVN_TUNNEL_ID), so EVPN tunnel ports
> were incorrectly kept instead of being cleaned up.
>
> Add a check for the "ovn-evpn-tunnel" external_id to properly identify
> EVPN tunnels so they can be cleaned up along with other OVN tunnels.
>
> Signed-off-by: Han Zhou <[email protected]>
> ---
Hi Han,
Thanks for the fix!
> controller/encaps.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/controller/encaps.c b/controller/encaps.c
> index 288959180402..f53c62f9ed00 100644
> --- a/controller/encaps.c
> +++ b/controller/encaps.c
> @@ -851,8 +851,13 @@ encaps_cleanup(struct ovsdb_idl_txn *ovs_idl_txn,
> = xmalloc(sizeof *br_int->ports * br_int->n_ports);
> size_t n = 0;
> for (size_t i = 0; i < br_int->n_ports; i++) {
> - if (!smap_get(&br_int->ports[i]->external_ids, OVN_TUNNEL_ID)) {
> - ports[n++] = br_int->ports[i];
> + struct ovsrec_port *port = br_int->ports[i];
> + bool is_ovn_tunnel = smap_get(&port->external_ids, OVN_TUNNEL_ID);
> + bool is_evpn_tunnel = smap_get_bool(&port->external_ids,
> + "ovn-evpn-tunnel", false);
> +
> + if (!is_ovn_tunnel && !is_evpn_tunnel) {
I think I'd just skip the local variables, i.e.:
if (!smap_get(&port->external_ids, OVN_TUNNEL_ID) &&
!smap_get_bool(&port->external_ids, "ovn-evpn-tunnel", false)) {
With that:
Acked-by: Dumitru Ceara <[email protected]>
> + ports[n++] = port; /* Keep non-tunnel ports */
> }
> }
>
Thanks,
Dumitru
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev