mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 03:42:57 +00:00
zebra: Static routes async notification do not need this test
When using asic_offload with an asynchronous notification the rib_route_match_ctx function is testing for distance and tag being correct against the re. Normal route notification for static routes is this(well really all routes): a) zebra dplane generates a ctx to send to the dplane for route install b) dplane installs it in the kernel c) if the dplane_fpm_nl.c module is being used it installs it. d) The context's success code is set to it worked and passes the context back up to zebra for processing. e) Zebra master receives this and checks the distance and tag are correct for static routes and accepts the route and marks it installed. If the operator is using a wait for install mechansim where the dplane is asynchronously sending the result back up at a future time *and* it is using the dplane_fpm_nl.c code where it uses the rt_netlink.c route parsing code, then there is no way to set distance as that we do not pass distance to the kernel. As such static routes were never being properly handled since the re and context would not match and the route would still be marked as queued. Modify the code such that the asynchronous path notification for static routes ignores the distance and tag's as that there is no way to test for this data from that path at this point in time. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
1ce1c537a5
commit
d0123a9012
@ -1438,7 +1438,7 @@ static void zebra_rib_evaluate_mpls(struct route_node *rn)
|
||||
*/
|
||||
static bool rib_route_match_ctx(const struct route_entry *re,
|
||||
const struct zebra_dplane_ctx *ctx,
|
||||
bool is_update)
|
||||
bool is_update, bool async)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -1454,13 +1454,12 @@ static bool rib_route_match_ctx(const struct route_entry *re,
|
||||
/* We use an extra test for statics, and another for
|
||||
* kernel routes.
|
||||
*/
|
||||
if (re->type == ZEBRA_ROUTE_STATIC &&
|
||||
if (re->type == ZEBRA_ROUTE_STATIC && !async &&
|
||||
(re->distance != dplane_ctx_get_old_distance(ctx) ||
|
||||
re->tag != dplane_ctx_get_old_tag(ctx))) {
|
||||
result = false;
|
||||
} else if (re->type == ZEBRA_ROUTE_KERNEL &&
|
||||
re->metric !=
|
||||
dplane_ctx_get_old_metric(ctx)) {
|
||||
re->metric != dplane_ctx_get_old_metric(ctx)) {
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
@ -1482,7 +1481,7 @@ static bool rib_route_match_ctx(const struct route_entry *re,
|
||||
/* We use an extra test for statics, and another for
|
||||
* kernel routes.
|
||||
*/
|
||||
if (re->type == ZEBRA_ROUTE_STATIC &&
|
||||
if (re->type == ZEBRA_ROUTE_STATIC && !async &&
|
||||
(re->distance != dplane_ctx_get_distance(ctx) ||
|
||||
re->tag != dplane_ctx_get_tag(ctx))) {
|
||||
result = false;
|
||||
@ -1946,13 +1945,13 @@ static void rib_process_result(struct zebra_dplane_ctx *ctx)
|
||||
RNODE_FOREACH_RE(rn, rib) {
|
||||
|
||||
if (re == NULL) {
|
||||
if (rib_route_match_ctx(rib, ctx, false))
|
||||
if (rib_route_match_ctx(rib, ctx, false, false))
|
||||
re = rib;
|
||||
}
|
||||
|
||||
/* Check for old route match */
|
||||
if (is_update && (old_re == NULL)) {
|
||||
if (rib_route_match_ctx(rib, ctx, true /*is_update*/))
|
||||
if (rib_route_match_ctx(rib, ctx, true, false))
|
||||
old_re = rib;
|
||||
}
|
||||
|
||||
@ -2271,7 +2270,7 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx)
|
||||
* info.
|
||||
*/
|
||||
RNODE_FOREACH_RE(rn, re) {
|
||||
if (rib_route_match_ctx(re, ctx, false /*!update*/))
|
||||
if (rib_route_match_ctx(re, ctx, false, true))
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user