On 5/22/25 10:40 AM, Vasyl Saienko wrote:
> Ignore external ports when building Ucast_Macs_Remote table as
> such ports are not hosted on bound chassis, they usually bound
> to gateway nodes to provide DHCP/Metadata services. Actual location
> will be learned from Ucast_Macs_Local database.
> 
> Signed-Off-By: Vasyl Saienko <vsaie...@mirantis.com>
> ---

Hi Vasyl,

Thanks for the patch!

>  controller-vtep/vtep.c       |  8 ++++++++
>  tests/ovn-controller-vtep.at | 13 +++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/controller-vtep/vtep.c b/controller-vtep/vtep.c
> index bc260b83b..5fe9fb174 100644
> --- a/controller-vtep/vtep.c
> +++ b/controller-vtep/vtep.c
> @@ -352,6 +352,14 @@ vtep_macs_run(struct ovsdb_idl_txn *vtep_idl_txn, struct 
> shash *ucast_macs_rmts,
>                  continue;
>              }
>              tnl_key = peer_pb->datapath->tunnel_key;
> +        } else if (!strcmp(port_binding_rec->type, "external")){
> +            /* External ports not bound on specific chassis, they
> +             * may sit on some of VTEP endpoints, but port itself
> +             * is bound to one of gateway nodes to provide DHCP/Metadata.
> +             * Skip port_binding information for such ports, as its does
> +             * not specify real node location.
> +             */
> +            continue;
>          } else {
>              tnl_key = port_binding_rec->datapath->tunnel_key;
>          }
> diff --git a/tests/ovn-controller-vtep.at b/tests/ovn-controller-vtep.at
> index 25c47d6d8..d3a8d4568 100644
> --- a/tests/ovn-controller-vtep.at
> +++ b/tests/ovn-controller-vtep.at
> @@ -371,12 +371,25 @@ AT_CHECK([ovn-nbctl --wait=sb sync])
>  AT_CHECK([ovn-sbctl chassis-add ch1 vxlan 1.2.3.6])
>  AT_CHECK([ovn-sbctl lsp-bind vif1 ch1])
>  
> +# adds external port to chassis
> +AT_CHECK([ovn-nbctl ha-chassis-group-add ext-group1])
> +AT_CHECK([ovn-nbctl ha-chassis-group-add-chassis ext-group1 ch1 7268])
> +AT_CHECK([ovn-sbctl set chassis ch0 
> other_config:ovn-cms-options=enable-chassis-as-gw])
> +AT_CHECK([ovn-nbctl lsp-add br-test ext1])
> +AT_CHECK([ovn-nbctl lsp-set-type ext1 external])
> +AT_CHECK([ovn-nbctl lsp-set-addresses ext1 aa:bb:cc:dd:01:02])
> +AT_CHECK([ovn-nbctl --wait=sb sync])
> +AT_CHECK([ovn-sbctl lsp-bind ext1 ch1])
> +
>  # checks Ucast_Macs_Remote creation.
>  OVS_WAIT_UNTIL([test -n "`vtep-ctl list Ucast_Macs_Remote | grep _uuid`"])
>  AT_CHECK([vtep-ctl --columns=MAC list Ucast_Macs_Remote | cut -d ':' -f2- | 
> tr -d ' '], [0], [dnl
>  "f0:ab:cd:ef:01:02"
>  ])
>  
> +# check that `external` ports i not in Ucast_Macs_Remote
> +AT_CHECK([test -z "`vtep-ctl list Ucast_Macs_Remote |grep 
> aa:bb:cc:dd:01:02`"])

Nit: "|grep aa:bb:cc:dd:01:02`" - missing space after '|'.

> +
>  # checks physical locator creation.
>  OVS_WAIT_UNTIL([test -n "`vtep-ctl list Physical_Locator | grep _uuid`"])
>  AT_CHECK([vtep-ctl --columns=dst_ip list Physical_Locator | cut -d ':' -f2 | 
> tr -d ' ' | grep -v 1.2.3.4 | sed '/^$/d'], [0], [dnl

Regards,
Dumitru

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to