On May 30, Han Zhou wrote:
> On Wed, May 29, 2024 at 5:26 AM Lorenzo Bianconi <
> [email protected]> wrote:
> >
> > Introduce bfd and bfd_consumer nodes to northd I-P engine to track bfd
> > connections and northd static_route/policy_route changes.
> >
> > Reported-at: https://issues.redhat.com/browse/FDP-600
> > Signed-off-by: Lorenzo Bianconi <[email protected]>
> > ---
> > Changes since v1:
> > - add incremental processing logic for bfd_consumer node to avoid a full
> >   recompute
> 
> Thanks Lorenzo for the updates. Please see my comments below.

Hi Han,

thx for the review.

> 
> > ---
> >  northd/en-lflow.c        |  23 +-
> >  northd/en-northd.c       |  97 +++++++++
> >  northd/en-northd.h       |   8 +
> >  northd/inc-proc-northd.c |  23 +-
> >  northd/northd.c          | 458 +++++++++++++++++++++++++++++----------
> >  northd/northd.h          |  57 ++++-
> >  6 files changed, 526 insertions(+), 140 deletions(-)
> >
> > diff --git a/northd/en-lflow.c b/northd/en-lflow.c
> > index c4b927fb8..b8ce8fb96 100644
> > --- a/northd/en-lflow.c
> > +++ b/northd/en-lflow.c
> > @@ -41,6 +41,9 @@ lflow_get_input_data(struct engine_node *node,
> >                       struct lflow_input *lflow_input)
> >  {

[...]

> "lb_data");
> >  static ENGINE_NODE_WITH_CLEAR_TRACK_DATA(lr_nat, "lr_nat");
> >  static ENGINE_NODE_WITH_CLEAR_TRACK_DATA(lr_stateful, "lr_stateful");
> >  static ENGINE_NODE_WITH_CLEAR_TRACK_DATA(ls_stateful, "ls_stateful");
> > +static ENGINE_NODE(bfd_consumer, "bfd_consumer");
> 
> The name "bfd_consumer" is not very clear. I understand that this node
> depends on the bfd node, but it is better to name a node for what it
> represents instead of what it depends on. Would it be better just name the
> node "routes"?

ack, in v3 I will split them so I can use proper names.

> 
> > +static ENGINE_NODE(bfd, "bfd");
> >
> >  void inc_proc_northd_init(struct ovsdb_idl_loop *nb,
> >                            struct ovsdb_idl_loop *sb)
> > @@ -237,14 +241,25 @@ void inc_proc_northd_init(struct ovsdb_idl_loop *nb,
> >      engine_add_input(&en_fdb_aging, &en_global_config,
> >                       node_global_config_handler);
> >
> > +    engine_add_input(&en_bfd, &en_nb_bfd, NULL);
> > +    engine_add_input(&en_bfd, &en_sb_bfd, NULL);
> > +    engine_add_input(&en_bfd, &en_northd, NULL);
> > +    engine_add_input(&en_bfd, &en_nb_logical_router_policy, NULL);
> > +    engine_add_input(&en_bfd, &en_nb_logical_router_static_route, NULL);
> > +
> > +    engine_add_input(&en_bfd_consumer, &en_bfd, NULL);
> > +    engine_add_input(&en_bfd_consumer, &en_northd, NULL);
> > +    engine_add_input(&en_bfd_consumer, &en_nb_bfd, NULL);
> > +    engine_add_input(&en_bfd_consumer, &en_nb_logical_router_policy,
> NULL);
> > +    engine_add_input(&en_bfd_consumer,
> &en_nb_logical_router_static_route,
> > +                     NULL);
> > +
> 
> I understand that no handlers are implemented for these inputs because you
> are trying to take care of incremental processing in the recompute (run)
> function itself, so that if node data is not changed after handling the
> input changes, it will set the node state as UNCHANGED, thus not triggering
> recompute for the node depending on them. However, this approach seems
> error prone to me. It is not easy to correctly detect if the node is
> changed without examining what's changed in the inputs. Please see below
> two examples in my comments under build_bfd_table() and
> build_route_policies(). I believe there can be more problems if we examine
> every corner case of those functions more carefully. I'd suggest following
> the common I-P engine principles with change-handlers properly implemented
> for each input we care about.

ack, I will add incremental handler for necessary inputs.

> 
> >      engine_add_input(&en_sync_meters, &en_nb_acl, NULL);
> >      engine_add_input(&en_sync_meters, &en_nb_meter, NULL);
> >      engine_add_input(&en_sync_meters, &en_sb_meter, NULL);
> >
> > -    engine_add_input(&en_lflow, &en_nb_bfd, NULL);
> >      engine_add_input(&en_lflow, &en_nb_acl, NULL);
> >      engine_add_input(&en_lflow, &en_sync_meters, NULL);
> > -    engine_add_input(&en_lflow, &en_sb_bfd, NULL);
> >      engine_add_input(&en_lflow, &en_sb_logical_flow, NULL);
> >      engine_add_input(&en_lflow, &en_sb_multicast_group, NULL);
> >      engine_add_input(&en_lflow, &en_sb_igmp_group, NULL);
> > @@ -255,6 +270,8 @@ void inc_proc_northd_init(struct ovsdb_idl_loop *nb,
> >      engine_add_input(&en_lflow, &en_port_group,
> lflow_port_group_handler);
> >      engine_add_input(&en_lflow, &en_lr_stateful,
> lflow_lr_stateful_handler);
> >      engine_add_input(&en_lflow, &en_ls_stateful,
> lflow_ls_stateful_handler);
> > +    engine_add_input(&en_lflow, &en_bfd_consumer, NULL);
> > +    engine_add_input(&en_lflow, &en_bfd, NULL);
> 
> It is better to move these two above the inputs that have handlers.
> 
> >
> >      engine_add_input(&en_sync_to_sb_addr_set, &en_northd, NULL);
> >      engine_add_input(&en_sync_to_sb_addr_set, &en_lr_stateful, NULL);
> > diff --git a/northd/northd.c b/northd/northd.c
> > index c8a5efa01..f8d21391b 100644
> > --- a/northd/northd.c
> > +++ b/northd/northd.c
> > @@ -9785,12 +9785,13 @@ bfd_port_lookup(const struct hmap *bfd_map, const
> char *logical_port,
> >      return NULL;
> >  }
> >
> > -void
> > +bool
> >  bfd_cleanup_connections(const struct nbrec_bfd_table *nbrec_bfd_table,
> >                          struct hmap *bfd_map)
> >  {
> >      const struct nbrec_bfd *nb_bt;
> >      struct bfd_entry *bfd_e;
> > +    bool ret = false;
> >
> >      NBREC_BFD_TABLE_FOR_EACH (nb_bt, nbrec_bfd_table) {
> >          bfd_e = bfd_port_lookup(bfd_map, nb_bt->logical_port,
> nb_bt->dst_ip);
> > @@ -9801,49 +9802,58 @@ bfd_cleanup_connections(const struct
> nbrec_bfd_table *nbrec_bfd_table,
> >          if (!bfd_e->ref && strcmp(nb_bt->status, "admin_down")) {
> >              /* no user for this bfd connection */
> >              nbrec_bfd_set_status(nb_bt, "admin_down");
> > +            ret = true;
> >          }
> >      }
> >
> > -    HMAP_FOR_EACH_POP (bfd_e, hmap_node, bfd_map) {
> > -        free(bfd_e);
> > -    }
> > +    return ret;
> >  }
> >
> >  #define BFD_DEF_MINTX       1000 /* 1s */
> >  #define BFD_DEF_MINRX       1000 /* 1s */
> >  #define BFD_DEF_DETECT_MULT 5
> >
> > -static void
> > +static bool
> >  build_bfd_update_sb_conf(const struct nbrec_bfd *nb_bt,
> >                           const struct sbrec_bfd *sb_bt)
> >  {
> > +    bool ret = false;
> > +
> >      if (strcmp(nb_bt->dst_ip, sb_bt->dst_ip)) {
> >          sbrec_bfd_set_dst_ip(sb_bt, nb_bt->dst_ip);
> > +        ret = true;
> >      }
> >
> >      if (strcmp(nb_bt->logical_port, sb_bt->logical_port)) {
> >          sbrec_bfd_set_logical_port(sb_bt, nb_bt->logical_port);
> > +        ret = true;
> >      }
> >
> >      if (strcmp(nb_bt->status, sb_bt->status)) {
> >          sbrec_bfd_set_status(sb_bt, nb_bt->status);
> > +        ret = true;
> >      }
> >
> >      int detect_mult = nb_bt->n_detect_mult ? nb_bt->detect_mult[0]
> >                                             : BFD_DEF_DETECT_MULT;
> >      if (detect_mult != sb_bt->detect_mult) {
> >          sbrec_bfd_set_detect_mult(sb_bt, detect_mult);
> > +        ret = true;
> >      }
> >
> >      int min_tx = nb_bt->n_min_tx ? nb_bt->min_tx[0] : BFD_DEF_MINTX;
> >      if (min_tx != sb_bt->min_tx) {
> >          sbrec_bfd_set_min_tx(sb_bt, min_tx);
> > +        ret = true;
> >      }
> >
> >      int min_rx = nb_bt->n_min_rx ? nb_bt->min_rx[0] : BFD_DEF_MINRX;
> >      if (min_rx != sb_bt->min_rx) {
> >          sbrec_bfd_set_min_rx(sb_bt, min_rx);
> > +        ret = true;
> >      }
> > +
> > +    return ret;
> >  }
> >
> >  /* RFC 5881 section 4
> > @@ -9869,7 +9879,7 @@ static int bfd_get_unused_port(unsigned long
> *bfd_src_ports)
> >      return port + BFD_UDP_SRC_PORT_START;
> >  }
> >
> > -void
> > +bool
> >  build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> >                  const struct nbrec_bfd_table *nbrec_bfd_table,
> >                  const struct sbrec_bfd_table *sbrec_bfd_table,
> > @@ -9879,6 +9889,7 @@ build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> >      const struct sbrec_bfd *sb_bt;
> >      unsigned long *bfd_src_ports;
> >      struct bfd_entry *bfd_e;
> > +    bool ret = false;
> >      uint32_t hash;
> >
> >      bfd_src_ports = bitmap_allocate(BFD_UDP_SRC_PORT_LEN);
> > @@ -9924,6 +9935,7 @@ build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> >              int d_mult = nb_bt->n_detect_mult ? nb_bt->detect_mult[0]
> >                                                : BFD_DEF_DETECT_MULT;
> >              sbrec_bfd_set_detect_mult(sb_bt, d_mult);
> > +            ret = true;
> >          } else {
> >              if (strcmp(bfd_e->sb_bt->status, nb_bt->status)) {
> >                  if (!strcmp(nb_bt->status, "admin_down") ||
> > @@ -9932,12 +9944,16 @@ build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> >                  } else {
> >                      nbrec_bfd_set_status(nb_bt, bfd_e->sb_bt->status);
> >                  }
> > +                ret = true;
> > +            }
> > +            if (build_bfd_update_sb_conf(nb_bt, bfd_e->sb_bt)) {
> > +                ret = true;
> >              }
> > -            build_bfd_update_sb_conf(nb_bt, bfd_e->sb_bt);
> >              if (op && op->sb && op->sb->chassis &&
> >                  strcmp(op->sb->chassis->name,
> bfd_e->sb_bt->chassis_name)) {
> >                  sbrec_bfd_set_chassis_name(bfd_e->sb_bt,
> >                                             op->sb->chassis->name);
> > +                ret = true;
> 
> This kind of check is not sufficient. For example, what if the op is NULL
> (not found) because it was just deleted? It is a change and we should
> return true.
> 
> >              }
> >
> >              hmap_remove(&sb_only, &bfd_e->hmap_node);
> > @@ -9960,10 +9976,13 @@ build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> >          }
> >          sbrec_bfd_delete(bfd_e->sb_bt);
> >          free(bfd_e);
> > +        ret = true;
> >      }
> >      hmap_destroy(&sb_only);
> >
> >      bitmap_free(bfd_src_ports);
> > +
> > +    return ret;
> >  }
> >
> >  /* Returns a string of the IP address of the router port 'op' that
> > @@ -10055,20 +10074,22 @@ static bool check_bfd_state(
> >
> >  static void
> >  build_routing_policy_flow(struct lflow_table *lflows, struct
> ovn_datapath *od,
> > -                          const struct hmap *lr_ports,
> > -                          const struct nbrec_logical_router_policy *rule,
> > -                          const struct hmap *bfd_connections,
> > +                          const struct hmap *lr_ports, struct
> route_policy *rp,
> >                            const struct ovsdb_idl_row *stage_hint,
> >                            struct lflow_ref *lflow_ref)
> >  {
> > +    const struct nbrec_logical_router_policy *rule = rp->rule;
> >      struct ds match = DS_EMPTY_INITIALIZER;
> >      struct ds actions = DS_EMPTY_INITIALIZER;
> >
> >      if (!strcmp(rule->action, "reroute")) {
> >          ovs_assert(rule->n_nexthops <= 1);
> >
> > -        char *nexthop =
> > -            (rule->n_nexthops == 1 ? rule->nexthops[0] : rule->nexthop);
> > +        if (!rp->n_valid_nexthops) {
> > +            return;
> > +        }
> > +
> > +        char *nexthop = rp->valid_nexthops[0];
> >          struct ovn_port *out_port =
> get_outport_for_routing_policy_nexthop(
> >               od, lr_ports, rule->priority, nexthop);
> >          if (!out_port) {
> > @@ -10084,10 +10105,6 @@ build_routing_policy_flow(struct lflow_table
> *lflows, struct ovn_datapath *od,
> >              return;
> >          }

[...]

> > +        size_t hash = uuid_hash(&od->key);
> > +        rp = route_policies_lookup(route_policies, hash, new_rp);
> > +        if (!rp) {
> > +            hmap_insert(route_policies, &new_rp->key_node, hash);
> > +            ret = true;
> > +        } else {
> > +            rp->stale = false;
> > +            free(valid_nexthops);
> > +            free(new_rp);
> 
> What if the "rp" existed but the valid_nexthops changed?

I guess this case is checked in route_policies_lookup(), right?

Regards,
Lorenzo

> 
> Thanks,
> Han
> 
> > +        }
> > +    }
> > +
> > +    HMAP_FOR_EACH_SAFE (rp, key_node, route_policies) {
> > +        if (!rp->stale) {
> > +            continue;
> > +        }
> > +
> > +        ret = true;
> > +        hmap_remove(route_policies, &rp->key_node);
> > +        free(rp->valid_nexthops);
> > +        free(rp);
> > +    }
> > +
> > +    return ret;
> > +}
> > +
> >  /* Logical router ingress table POLICY: Policy.
> >   *
> >   * A packet that arrives at this table is an IP packet that should be
> > @@ -12902,7 +13071,7 @@ static void
> >  build_ingress_policy_flows_for_lrouter(
> >          struct ovn_datapath *od, struct lflow_table *lflows,
> >          const struct hmap *lr_ports,
> > -        const struct hmap *bfd_connections,
> > +        struct hmap *route_policies,
> >          struct lflow_ref *lflow_ref)
> >  {
> >      ovs_assert(od->nbr);
> > @@ -12919,21 +13088,20 @@ build_ingress_policy_flows_for_lrouter(
> >
> >      /* Convert routing policies to flows. */
> >      uint16_t ecmp_group_id = 1;
> > -    for (int i = 0; i < od->nbr->n_policies; i++) {
> > -        const struct nbrec_logical_router_policy *rule
> > -            = od->nbr->policies[i];
> > +    struct route_policy *rp;
> > +    HMAP_FOR_EACH_WITH_HASH (rp, key_node, uuid_hash(&od->key),
> > +                             route_policies) {
> > +        const struct nbrec_logical_router_policy *rule = rp->rule;
> >          bool is_ecmp_reroute =
> >              (!strcmp(rule->action, "reroute") && rule->n_nexthops > 1);
> >
> >          if (is_ecmp_reroute) {
> > -            build_ecmp_routing_policy_flows(lflows, od, lr_ports, rule,
> > -                                            bfd_connections,
> ecmp_group_id,
> > -                                            lflow_ref);
> > +            build_ecmp_routing_policy_flows(lflows, od, lr_ports, rp,
> > +                                            ecmp_group_id, lflow_ref);
> >              ecmp_group_id++;
> >          } else {
> > -            build_routing_policy_flow(lflows, od, lr_ports, rule,
> > -                                      bfd_connections, &rule->header_,
> > -                                      lflow_ref);
> > +            build_routing_policy_flow(lflows, od, lr_ports, rp,
> > +                                      &rule->header_, lflow_ref);
> >          }
> >      }
> >  }
> > @@ -15887,6 +16055,9 @@ struct lswitch_flow_build_info {
> >      struct ds actions;
> >      size_t thread_lflow_counter;
> >      const char *svc_monitor_mac;
> > +    struct hmap *parsed_routes;
> > +    struct hmap *route_policies;
> > +    struct simap *route_tables;
> >  };
> >
> >  /* Helper function to combine all lflow generation which is iterated by
> > @@ -15933,12 +16104,13 @@ build_lswitch_and_lrouter_iterate_by_lr(struct
> ovn_datapath *od,
> >      build_ip_routing_pre_flows_for_lrouter(od, lsi->lflows, NULL);
> >      build_static_route_flows_for_lrouter(od, lsi->features,
> >                                           lsi->lflows, lsi->lr_ports,
> > -                                         lsi->bfd_connections,
> > +                                         lsi->parsed_routes,
> > +                                         lsi->route_tables,
> >                                           NULL);
> >      build_mcast_lookup_flows_for_lrouter(od, lsi->lflows, &lsi->match,
> >                                           &lsi->actions, NULL);
> >      build_ingress_policy_flows_for_lrouter(od, lsi->lflows,
> lsi->lr_ports,
> > -                                           lsi->bfd_connections, NULL);
> > +                                           lsi->route_policies, NULL);
> >      build_arp_resolve_flows_for_lrouter(od, lsi->lflows, NULL);
> >      build_check_pkt_len_flows_for_lrouter(od, lsi->lflows, lsi->lr_ports,
> >                                            &lsi->match, &lsi->actions,
> > @@ -16254,7 +16426,10 @@ build_lswitch_and_lrouter_flows(
> >      const struct hmap *svc_monitor_map,
> >      const struct hmap *bfd_connections,
> >      const struct chassis_features *features,
> > -    const char *svc_monitor_mac)
> > +    const char *svc_monitor_mac,
> > +    struct hmap *parsed_routes,
> > +    struct hmap *route_policies,
> > +    struct simap *route_tables)
> >  {
> >
> >      char *svc_check_match = xasprintf("eth.dst == %s", svc_monitor_mac);
> > @@ -16288,6 +16463,9 @@ build_lswitch_and_lrouter_flows(
> >              lsiv[index].svc_check_match = svc_check_match;
> >              lsiv[index].thread_lflow_counter = 0;
> >              lsiv[index].svc_monitor_mac = svc_monitor_mac;
> > +            lsiv[index].parsed_routes = parsed_routes;
> > +            lsiv[index].route_tables = route_tables;
> > +            lsiv[index].route_policies = route_policies;
> >              ds_init(&lsiv[index].match);
> >              ds_init(&lsiv[index].actions);
> >
> > @@ -16328,6 +16506,9 @@ build_lswitch_and_lrouter_flows(
> >              .features = features,
> >              .svc_check_match = svc_check_match,
> >              .svc_monitor_mac = svc_monitor_mac,
> > +            .parsed_routes = parsed_routes,
> > +            .route_tables = route_tables,
> > +            .route_policies = route_policies,
> >              .match = DS_EMPTY_INITIALIZER,
> >              .actions = DS_EMPTY_INITIALIZER,
> >          };
> > @@ -16489,7 +16670,10 @@ void build_lflows(struct ovsdb_idl_txn
> *ovnsb_txn,
> >                                      input_data->svc_monitor_map,
> >                                      input_data->bfd_connections,
> >                                      input_data->features,
> > -                                    input_data->svc_monitor_mac);
> > +                                    input_data->svc_monitor_mac,
> > +                                    input_data->parsed_routes,
> > +                                    input_data->route_policies,
> > +                                    input_data->route_tables);
> >
> >      if (parallelization_state == STATE_INIT_HASH_SIZES) {
> >          parallelization_state = STATE_USE_PARALLELIZATION;
> > @@ -17565,6 +17749,20 @@ northd_init(struct northd_data *data)
> >      init_northd_tracked_data(data);
> >  }
> >
> > +void
> > +bfd_consumer_init(struct bfd_consumer_data *data)
> > +{
> > +    hmap_init(&data->parsed_routes);
> > +    hmap_init(&data->route_policies);
> > +    simap_init(&data->route_tables);
> > +}
> > +
> > +void
> > +bfd_init(struct bfd_data *data)
> > +{
> > +    hmap_init(&data->bfd_connections);
> > +}
> > +
> >  void
> >  northd_destroy(struct northd_data *data)
> >  {
> > @@ -17604,6 +17802,36 @@ northd_destroy(struct northd_data *data)
> >      destroy_northd_tracked_data(data);
> >  }
> >
> > +void
> > +bfd_consumer_destroy(struct bfd_consumer_data *data)
> > +{
> > +    struct parsed_route *r;
> > +    HMAP_FOR_EACH_POP (r, key_node, &data->parsed_routes) {
> > +        free(r);
> > +    }
> > +    hmap_destroy(&data->parsed_routes);
> > +
> > +    struct route_policy *rp;
> > +    HMAP_FOR_EACH_POP (rp, key_node, &data->route_policies) {
> > +        free(rp->valid_nexthops);
> > +        free(rp);
> > +    };
> > +    hmap_destroy(&data->route_policies);
> > +
> > +    simap_destroy(&data->route_tables);
> > +}
> > +
> > +void
> > +bfd_destroy(struct bfd_data *data)
> > +{
> > +    struct bfd_entry *bfd_e;
> > +
> > +    HMAP_FOR_EACH_POP (bfd_e, hmap_node, &data->bfd_connections) {
> > +        free(bfd_e);
> > +    }
> > +    hmap_destroy(&data->bfd_connections);
> > +}
> > +
> >  void
> >  ovnnb_db_run(struct northd_input *input_data,
> >               struct northd_data *data,
> > diff --git a/northd/northd.h b/northd/northd.h
> > index 940926945..d5ead2faf 100644
> > --- a/northd/northd.h
> > +++ b/northd/northd.h
> > @@ -23,6 +23,7 @@
> >  #include "northd/en-port-group.h"
> >  #include "northd/ipam.h"
> >  #include "openvswitch/hmap.h"
> > +#include "simap.h"
> >  #include "ovs-thread.h"
> >
> >  struct northd_input {
> > @@ -160,14 +161,29 @@ struct northd_data {
> >      struct northd_tracked_data trk_data;
> >  };
> >
> > +struct route_policy {
> > +    struct hmap_node key_node;
> > +    const struct nbrec_logical_router_policy *rule;
> > +    size_t n_valid_nexthops;
> > +    char **valid_nexthops;
> > +    const struct nbrec_logical_router *nbr;
> > +    bool stale;
> > +};
> > +
> > +struct bfd_consumer_data {
> > +    struct hmap parsed_routes;
> > +    struct hmap route_policies;
> > +    struct simap route_tables;
> > +};
> > +
> > +struct bfd_data {
> > +    struct hmap bfd_connections;
> > +};
> > +
> >  struct lr_nat_table;
> >
> >  struct lflow_input {
> > -    /* Northbound table references */
> > -    const struct nbrec_bfd_table *nbrec_bfd_table;
> > -
> >      /* Southbound table references */
> > -    const struct sbrec_bfd_table *sbrec_bfd_table;
> >      const struct sbrec_logical_flow_table *sbrec_logical_flow_table;
> >      const struct sbrec_multicast_group_table
> *sbrec_multicast_group_table;
> >      const struct sbrec_igmp_group_table *sbrec_igmp_group_table;
> > @@ -190,6 +206,9 @@ struct lflow_input {
> >      const struct hmap *svc_monitor_map;
> >      bool ovn_internal_version_changed;
> >      const char *svc_monitor_mac;
> > +    struct hmap *parsed_routes;
> > +    struct hmap *route_policies;
> > +    struct simap *route_tables;
> >  };
> >
> >  extern int parallelization_state;
> > @@ -661,6 +680,20 @@ struct ovn_port {
> >      struct lflow_ref *stateful_lflow_ref;
> >  };
> >
> > +struct parsed_route {
> > +    struct hmap_node key_node;
> > +    struct in6_addr prefix;
> > +    unsigned int plen;
> > +    bool is_src_route;
> > +    uint32_t route_table_id;
> > +    uint32_t hash;
> > +    const struct nbrec_logical_router_static_route *route;
> > +    bool ecmp_symmetric_reply;
> > +    bool is_discard_route;
> > +    const struct nbrec_logical_router *nbr;
> > +    bool stale;
> > +};
> > +
> >  void ovnnb_db_run(struct northd_input *input_data,
> >                    struct northd_data *data,
> >                    struct ovsdb_idl_txn *ovnnb_txn,
> > @@ -682,6 +715,16 @@ void northd_init(struct northd_data *data);
> >  void northd_indices_create(struct northd_data *data,
> >                             struct ovsdb_idl *ovnsb_idl);
> >
> > +bool build_parsed_routes(struct ovn_datapath *, const struct hmap *,
> > +                         struct hmap *, struct simap *,
> > +                         const struct hmap *);
> > +uint32_t get_route_table_id(struct simap *, const char *);
> > +void bfd_consumer_init(struct bfd_consumer_data *);
> > +void bfd_consumer_destroy(struct bfd_consumer_data *);
> > +
> > +void bfd_init(struct bfd_data *);
> > +void bfd_destroy(struct bfd_data *);
> > +
> >  struct lflow_table;
> >  struct lr_stateful_tracked_data;
> >  struct ls_stateful_tracked_data;
> > @@ -719,12 +762,14 @@ bool northd_handle_lb_data_changes(struct
> tracked_lb_data *,
> >                                     struct hmap *lbgrp_datapaths_map,
> >                                     struct northd_tracked_data *);
> >
> > -void build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> > +bool build_route_policies(struct ovn_datapath *, struct hmap *, struct
> hmap *,
> > +                          struct hmap *);
> > +bool build_bfd_table(struct ovsdb_idl_txn *ovnsb_txn,
> >                       const struct nbrec_bfd_table *,
> >                       const struct sbrec_bfd_table *,
> >                       const struct hmap *lr_ports,
> >                       struct hmap *bfd_connections);
> > -void bfd_cleanup_connections(const struct nbrec_bfd_table *,
> > +bool bfd_cleanup_connections(const struct nbrec_bfd_table *,
> >                               struct hmap *bfd_map);
> >  void run_update_worker_pool(int n_threads);
> >
> > --
> > 2.45.1
> >
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to