On 9/17/25 2:28 PM, Ales Musil via dev wrote:
> On Mon, Sep 15, 2025 at 3:16 PM Lucas Vargas Dias via dev <
> [email protected]> wrote:
>
>> If logical router has ECMP for a same prefix, northd tries to
>> adversited N times by the same logical router port, insert in
>> sbrec_advertised_route table fails because all fields of
>> sbrec_advertised_route are equal.
>> To fix it, just add one time the route to be advertised in the
>> sync routes.
>>
>> Fixes: f2deb24c5c43 ("northd: Sync Advertised_Route to sb.")
>> Signed-off-by: Lucas Vargas Dias <[email protected]>
>> ---
Hi Lucas, Ales,
Thanks for the patch and review!
>> northd/en-advertised-route-sync.c | 11 ++++++++++-
>> tests/ovn-northd.at | 9 +++++++++
>> 2 files changed, 19 insertions(+), 1 deletion(-)
>>
>> diff --git a/northd/en-advertised-route-sync.c
>> b/northd/en-advertised-route-sync.c
>> index 35def9d22..3dd4d0581 100644
>> --- a/northd/en-advertised-route-sync.c
>> +++ b/northd/en-advertised-route-sync.c
>> @@ -757,8 +757,17 @@ advertised_route_table_sync(
>> advertise_route_track_od(data, route->od, route->tracked_port,
>> route->source);
>>
>> + const struct sbrec_port_binding *tracked_port =
>> + route->tracked_port ? route->tracked_port->sb : NULL;
>> + char *ip_prefix = normalize_v46_prefix(&route->prefix,
>> route->plen);
>> + if (ar_entry_find(&sync_routes,route->od->sdp->sb_dp,
Nit: missing space before the second argument.
>> + route->out_port->sb, ip_prefix,
>> + tracked_port)) {
>> + free(ip_prefix);
>> + continue;
>> + }
>> ar_entry_add_nocopy(&sync_routes, route->od, route->out_port,
>> - normalize_v46_prefix(&route->prefix,
>> route->plen),
>> + ip_prefix,
>> route->tracked_port,
>> route->source);
>> }
>> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
>> index c9e998129..cae20aa1a 100644
>> --- a/tests/ovn-northd.at
>> +++ b/tests/ovn-northd.at
>> @@ -15095,6 +15095,15 @@ check_row_count Advertised_Route 3
>> check_row_count Advertised_Route 2 logical_port=$pb
>> check_row_count Advertised_Route 1 logical_port=$pb ip_prefix=
>> 192.168.0.0/24
>>
>> +# Adding two statics routes adds none additional entry.
Nit: I'd change "two statics routes" to "two static ECMP routes adds no
...".
>> +check ovn-nbctl --wait=sb lr-route-del lr0 192.168.0.0/24 10.0.0.10
>> +check ovn-nbctl --wait=sb --ecmp lr-route-add lr0 192.168.0.0/24
>> 10.0.0.10
>> +check ovn-nbctl --wait=sb --ecmp lr-route-add lr0 192.168.0.0/24
>> 10.0.0.11
>> +
>> +check_row_count Advertised_Route 3
>> +check_row_count Advertised_Route 2 logical_port=$pb
>> +check_row_count Advertised_Route 1 logical_port=$pb ip_prefix=
>> 192.168.0.0/24
>> +
>> # Adding an ipv6 LRP adds an addition route entry.
>> check ovn-nbctl --wait=sb lrp-add lr0 lr0-sw2 00:00:00:00:ff:03
>> 2001:db8::1/64 fe80::1/64
>> pb3=$(fetch_column port_binding _uuid logical_port=lr0-sw2)
>> --
>> 2.34.1
>>
> Looks good to me, thanks.
>
> Acked-by: Ales Musil <[email protected]>
I took care of the small nits I had above and applied this fix to main
and to all branches down to 25.03.
Regards,
Dumitru
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev