On Tue, Mar 10, 2026 at 6:36 PM Lucas Vargas Dias via dev <
[email protected]> wrote:

> Search by parsed route can be direct using uuid hash
> from source (static route, learned route, connect
> route), this avoids the search by ovn_datapath,
> and after, the search for parsed route.
>
> Signed-off-by: Lucas Vargas Dias <[email protected]>
> ---
>

Hi Lucas,

sorry for the delay, I have a few small comments down below.


>  northd/en-learned-route-sync.c | 11 ++---------
>  northd/northd.c                |  7 +++----
>  northd/northd.h                |  4 ++--
>  3 files changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/northd/en-learned-route-sync.c
> b/northd/en-learned-route-sync.c
> index 4e2d284ee..4dde5a53c 100644
> --- a/northd/en-learned-route-sync.c
> +++ b/northd/en-learned-route-sync.c
> @@ -230,15 +230,9 @@ routes_table_sync(
>
>  static struct parsed_route *
>  find_learned_route(const struct sbrec_learned_route *learned_route,
> -                   const struct ovn_datapaths *lr_datapaths,
>                     const struct hmap *routes)
>  {
> -    const struct ovn_datapath *od = ovn_datapath_from_sbrec_(
> -        &lr_datapaths->datapaths, learned_route->datapath);
> -    if (!od) {
> -        return NULL;
> -    }
> -    return parsed_route_lookup_by_source(od, ROUTE_SOURCE_LEARNED,
> +    return parsed_route_lookup_by_source(ROUTE_SOURCE_LEARNED,
>                                           &learned_route->header_, routes);
>  }
>
> @@ -273,8 +267,7 @@
> learned_route_sync_sb_learned_route_change_handler(struct engine_node *node,
>
>          if (sbrec_learned_route_is_deleted(changed_route)) {
>              struct parsed_route *route = find_learned_route(
> -                changed_route, &northd_data->lr_datapaths,
> -                &data->parsed_routes);
> +                changed_route, &data->parsed_routes);
>              if (!route) {
>                  goto fail;
>              }
> diff --git a/northd/northd.c b/northd/northd.c
> index 0da15629e..05702bb49 100644
> --- a/northd/northd.c
> +++ b/northd/northd.c
> @@ -12033,12 +12033,11 @@ parsed_route_clone(const struct parsed_route *pr)
>  /* Searches for a parsed_route in a hmap based on datapath, source and
>   * source_hint. */
>  struct parsed_route *
> -parsed_route_lookup_by_source(const struct ovn_datapath *od,
> -                              enum route_source source,
> +parsed_route_lookup_by_source(enum route_source source,
>                                const struct ovsdb_idl_row *source_hint,
>                                const struct hmap *routes)
>

nit: The comment should be adjusted.


>  {
> -    size_t hash = uuid_hash(&od->key);
> +    size_t hash = uuid_hash(&source_hint->uuid);
>      struct parsed_route *route;
>      HMAP_FOR_EACH_WITH_HASH (route, key_node, hash, routes) {
>          if (route->source == source &&
> @@ -12055,7 +12054,7 @@ parsed_route_lookup_by_source(const struct
> ovn_datapath *od,
>   * This is distinct from route_hash which is stored in
> parsed_route->hash. */
>  size_t
>

Also the comment here seems to be no longer applicable,
let's adjust it.


>  parsed_route_hash(const struct parsed_route *pr) {
> -    return uuid_hash(&pr->od->key);
> +    return uuid_hash(&pr->source_hint->uuid);
>  }
>
>  void
> diff --git a/northd/northd.h b/northd/northd.h
> index 41190110b..4165b6fdd 100644
> --- a/northd/northd.h
> +++ b/northd/northd.h
> @@ -852,8 +852,8 @@ struct parsed_route {
>
>  struct parsed_route *parsed_route_clone(const struct parsed_route *);
>  struct parsed_route *parsed_route_lookup_by_source(
> -    const struct ovn_datapath *od, enum route_source source,
> -    const struct ovsdb_idl_row *source_hint, const struct hmap *routes);
> +    enum route_source source, const struct ovsdb_idl_row *source_hint,
> +    const struct hmap *routes);
>  size_t parsed_route_hash(const struct parsed_route *);
>  void parsed_route_free(struct parsed_route *);
>
> --
> 2.43.0
>
>
> --
>
>
>
>
> _'Esta mensagem é direcionada apenas para os endereços constantes no
> cabeçalho inicial. Se você não está listado nos endereços constantes no
> cabeçalho, pedimos-lhe que desconsidere completamente o conteúdo dessa
> mensagem e cuja cópia, encaminhamento e/ou execução das ações citadas
> estão
> imediatamente anuladas e proibidas'._
>
>
> * **'Apesar do Magazine Luiza tomar
> todas as precauções razoáveis para assegurar que nenhum vírus esteja
> presente nesse e-mail, a empresa não poderá aceitar a responsabilidade por
> quaisquer perdas ou danos causados por esse e-mail ou por seus anexos'.*
>
>
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Regards,
Ales
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to