This attribute of the "parsed_route" determines whether northd will create logical flows for this route.
Signed-off-by: Martin Kalcok <[email protected]> --- northd/en-learned-route-sync.c | 3 ++- northd/northd.c | 14 ++++++++++---- northd/northd.h | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/northd/en-learned-route-sync.c b/northd/en-learned-route-sync.c index a144b4487..a3e2b93a4 100644 --- a/northd/en-learned-route-sync.c +++ b/northd/en-learned-route-sync.c @@ -181,7 +181,8 @@ parse_route_from_sbrec_route(struct hmap *parsed_routes_out, parsed_route_add(od, nexthop, &prefix, plen, false, lrp_addr_s, out_port, 0, false, false, NULL, - ROUTE_SOURCE_LEARNED, &route->header_, parsed_routes_out); + ROUTE_SOURCE_LEARNED, &route->header_, parsed_routes_out, + true); } static void diff --git a/northd/northd.c b/northd/northd.c index b9aad124b..9f8d3118c 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -10848,6 +10848,7 @@ struct parsed_route *parsed_route_clone(const struct parsed_route *pr) { new_pr->source_hint = pr->source_hint; new_pr->lrp_addr_s = nullable_xstrdup(pr->lrp_addr_s); new_pr->out_port = pr->out_port; + new_pr->install_lflow = pr->install_lflow; sset_clone(&new_pr->ecmp_selection_fields, &pr->ecmp_selection_fields); return new_pr; } @@ -10881,7 +10882,8 @@ parsed_route_add(const struct ovn_datapath *od, const struct sset *ecmp_selection_fields, enum route_source source, const struct ovsdb_idl_row *source_hint, - struct hmap *routes) + struct hmap *routes, + bool install_lflow) { struct parsed_route *new_pr = xzalloc(sizeof *new_pr); @@ -10894,6 +10896,7 @@ parsed_route_add(const struct ovn_datapath *od, new_pr->od = od; new_pr->ecmp_symmetric_reply = ecmp_symmetric_reply; new_pr->is_discard_route = is_discard_route; + new_pr->install_lflow = install_lflow; if (!is_discard_route) { new_pr->lrp_addr_s = xstrdup(lrp_addr_s); } @@ -11039,7 +11042,7 @@ parsed_routes_add_static(const struct ovn_datapath *od, parsed_route_add(od, nexthop, &prefix, plen, is_discard_route, lrp_addr_s, out_port, route_table_id, is_src_route, ecmp_symmetric_reply, &ecmp_selection_fields, source, - &route->header_, routes); + &route->header_, routes, true); sset_destroy(&ecmp_selection_fields); } @@ -11057,7 +11060,7 @@ parsed_routes_add_connected(const struct ovn_datapath *od, false, addr->addr_s, op, 0, false, false, NULL, ROUTE_SOURCE_CONNECTED, - &op->nbrp->header_, routes); + &op->nbrp->header_, routes, true); } for (size_t i = 0; i < op->lrp_networks.n_ipv6_addrs; i++) { @@ -11069,7 +11072,7 @@ parsed_routes_add_connected(const struct ovn_datapath *od, false, addr->addr_s, op, 0, false, false, NULL, ROUTE_SOURCE_CONNECTED, - &op->nbrp->header_, routes); + &op->nbrp->header_, routes, true); } } @@ -13558,6 +13561,9 @@ build_route_flows_for_lrouter( struct parsed_route *route; HMAP_FOR_EACH_WITH_HASH (route, key_node, uuid_hash(&od->key), parsed_routes) { + if (!route->install_lflow) { + continue; + } if (route->source == ROUTE_SOURCE_CONNECTED) { unique_routes_add(&unique_routes, route); continue; diff --git a/northd/northd.h b/northd/northd.h index 991732038..fffaab3a0 100644 --- a/northd/northd.h +++ b/northd/northd.h @@ -729,6 +729,7 @@ struct parsed_route { const struct ovsdb_idl_row *source_hint; char *lrp_addr_s; const struct ovn_port *out_port; + bool install_lflow; }; struct parsed_route *parsed_route_clone(const struct parsed_route *); @@ -747,7 +748,8 @@ void parsed_route_add(const struct ovn_datapath *od, const struct sset *ecmp_selection_fields, enum route_source source, const struct ovsdb_idl_row *source_hint, - struct hmap *routes); + struct hmap *routes, + bool install_lflow); bool find_route_outport(const struct hmap *lr_ports, const char *output_port, -- 2.43.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
