On 11/26/24 3:37 PM, Felix Huettner via dev wrote:
> Previously we searched for the outport of a route by going through all
> LRPs of the LR in the northbound, finding the matching ovn_port and
> checking if it matches. However we can also just iterate over all
> ovn_port of the LR datapath.
>
> This is simpler and a prerequisite for later patches that use
> derived router ports.
>
> Acked-by: Lorenzo Bianconi <[email protected]>
> Signed-off-by: Felix Huettner <[email protected]>
> ---
Thank you Felix and Lorenzo! I applied this patch to the main branch.
Regards,
Dumitru
> northd/northd.c | 10 +---------
> 1 file changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/northd/northd.c b/northd/northd.c
> index fa3a8a882..8ba7b8c33 100644
> --- a/northd/northd.c
> +++ b/northd/northd.c
> @@ -11433,15 +11433,7 @@ find_static_route_outport(struct ovn_datapath *od,
> const struct hmap *lr_ports,
> } else {
> /* output_port is not specified, find the
> * router port matching the next hop. */
> - int i;
> - for (i = 0; i < od->nbr->n_ports; i++) {
> - struct nbrec_logical_router_port *lrp = od->nbr->ports[i];
> - out_port = ovn_port_find(lr_ports, lrp->name);
> - if (!out_port) {
> - /* This should not happen. */
> - continue;
> - }
> -
> + HMAP_FOR_EACH (out_port, dp_node, &od->ports) {
> if (route->nexthop[0]) {
> lrp_addr_s = find_lrp_member_ip(out_port, route->nexthop);
> }
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev