Skip to content

Commit 3981b3f

Browse files
authored
Merge pull request FRRouting#20377 from donaldsharp/asic_notification_removal
zebra: Remove zrouter.zav.asic_notification_nexthop_control
2 parents f288619 + 726bdff commit 3981b3f

File tree

10 files changed

+31
-758
lines changed

10 files changed

+31
-758
lines changed

zebra/rib.h

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ struct route_entry {
140140
#define ROUTE_ENTRY_INSTALLED 0x10
141141
/* Route has Failed installation into the Data Plane in some manner */
142142
#define ROUTE_ENTRY_FAILED 0x20
143-
/* Route has a 'fib' set of nexthops, probably because the installed set
144-
* differs from the rib/normal set of nexthops.
145-
*/
146-
#define ROUTE_ENTRY_USE_FIB_NHG 0x40
147143
/*
148144
* Route entries that are going to the dplane for a Route Replace
149145
* let's note the fact that this is happening. This will
@@ -168,13 +164,6 @@ struct route_entry {
168164
time_t uptime;
169165

170166
struct re_opaque *opaque;
171-
172-
/* Nexthop group from FIB (optional), reflecting what is actually
173-
* installed in the FIB if that differs. The 'backup' group is used
174-
* when backup nexthops are present in the route's nhg.
175-
*/
176-
struct nexthop_group fib_ng;
177-
struct nexthop_group fib_backup_ng;
178167
};
179168

180169
#define RIB_SYSTEM_ROUTE(R) RSYSTEM_ROUTE((R)->type)
@@ -614,23 +603,7 @@ DECLARE_HOOK(rib_shutdown, (struct route_node * rn), (rn));
614603
*/
615604
static inline struct nexthop_group *rib_get_fib_nhg(struct route_entry *re)
616605
{
617-
/* If the fib set is a subset of the active rib set,
618-
* use the dedicated fib list.
619-
*/
620-
if (CHECK_FLAG(re->status, ROUTE_ENTRY_USE_FIB_NHG))
621-
return &(re->fib_ng);
622-
else
623-
return &(re->nhe->nhg);
624-
}
625-
626-
/*
627-
* Access backup nexthop-group that represents the installed backup nexthops;
628-
* any installed backup will be on the fib list.
629-
*/
630-
static inline struct nexthop_group *rib_get_fib_backup_nhg(
631-
struct route_entry *re)
632-
{
633-
return &(re->fib_backup_ng);
606+
return &(re->nhe->nhg);
634607
}
635608

636609
extern void zebra_gr_process_client(afi_t afi, vrf_id_t vrf_id, uint8_t proto, uint8_t instance,

zebra/zebra_dplane.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4286,26 +4286,6 @@ static int dplane_ctx_pw_init(struct zebra_dplane_ctx *ctx,
42864286
}
42874287
}
42884288

4289-
/* Include any installed backup nexthops also. */
4290-
nhg = rib_get_fib_backup_nhg(re);
4291-
if (nhg && nhg->nexthop) {
4292-
for (ALL_NEXTHOPS_PTR(nhg, nh)) {
4293-
if (!CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ACTIVE)
4294-
|| CHECK_FLAG(nh->flags,
4295-
NEXTHOP_FLAG_RECURSIVE)
4296-
|| nh->nh_label == NULL)
4297-
continue;
4298-
4299-
newnh = nexthop_dup(nh, NULL);
4300-
4301-
if (last_nh)
4302-
NEXTHOP_APPEND(last_nh, newnh);
4303-
else
4304-
ctx->u.pw.fib_nhg.nexthop = newnh;
4305-
last_nh = newnh;
4306-
}
4307-
}
4308-
43094289
/* Copy primary nexthops; recursive info is included too */
43104290
assert(re->nhe != NULL); /* SA warning */
43114291
copy_nexthops(&(ctx->u.pw.primary_nhg.nexthop),
@@ -5000,13 +4980,6 @@ dplane_route_notif_update(struct route_node *rn,
50004980
copy_nexthops(&(new_ctx->u.rinfo.zd_ng.nexthop),
50014981
nhg->nexthop, NULL);
50024982

5003-
/* Check for installed backup nexthops also */
5004-
nhg = rib_get_fib_backup_nhg(re);
5005-
if (nhg && nhg->nexthop) {
5006-
copy_nexthops(&(new_ctx->u.rinfo.zd_ng.nexthop),
5007-
nhg->nexthop, NULL);
5008-
}
5009-
50104983
for (ALL_NEXTHOPS(new_ctx->u.rinfo.zd_ng, nexthop))
50114984
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
50124985

zebra/zebra_nhg.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,32 +2585,6 @@ static int nexthop_active(struct nexthop *nexthop, struct nhg_hash_entry *nhe,
25852585
}
25862586
}
25872587

2588-
/* Examine installed backup nexthops, if any. There
2589-
* are only installed backups *if* there is a
2590-
* dedicated fib list. The UI can also control use
2591-
* of backups for resolution.
2592-
*/
2593-
nhg = rib_get_fib_backup_nhg(match);
2594-
if (!use_recursive_backups ||
2595-
nhg == NULL || nhg->nexthop == NULL)
2596-
goto done_with_match;
2597-
2598-
for (ALL_NEXTHOPS_PTR(nhg, newhop)) {
2599-
if (!nexthop_valid_resolve(nexthop, newhop))
2600-
continue;
2601-
2602-
if (IS_ZEBRA_DEBUG_NHG_DETAIL)
2603-
zlog_debug(
2604-
"%s: RECURSIVE match backup %p (%pNG), newhop %pNHv",
2605-
__func__, match, match->nhe,
2606-
newhop);
2607-
2608-
SET_FLAG(nexthop->flags,
2609-
NEXTHOP_FLAG_RECURSIVE);
2610-
nexthop_set_resolved(afi, newhop, nexthop, NULL, flags);
2611-
resolved = 1;
2612-
}
2613-
26142588
done_with_match:
26152589
/* Capture resolving mtu */
26162590
if (resolved) {

zebra/zebra_pw.c

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -284,28 +284,6 @@ static int zebra_pw_check_reachability_strict(const struct zebra_pw *pw,
284284
}
285285
}
286286

287-
if (fail_p)
288-
goto done;
289-
290-
nhg = rib_get_fib_backup_nhg(re);
291-
if (nhg && nhg->nexthop) {
292-
for (ALL_NEXTHOPS_PTR(nhg, nexthop)) {
293-
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
294-
continue;
295-
296-
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) {
297-
if (nexthop->nh_label != NULL)
298-
found_p = true;
299-
else {
300-
fail_p = true;
301-
break;
302-
}
303-
}
304-
}
305-
}
306-
307-
done:
308-
309287
if (fail_p || !found_p) {
310288
if (IS_ZEBRA_DEBUG_PW)
311289
zlog_debug("%s: unlabeled route for %s",
@@ -360,28 +338,9 @@ static int zebra_pw_check_reachability(const struct zebra_pw *pw)
360338
if (found_p)
361339
return 0;
362340

363-
nhg = rib_get_fib_backup_nhg(re);
364-
if (nhg && nhg->nexthop) {
365-
for (ALL_NEXTHOPS_PTR(nhg, nexthop)) {
366-
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
367-
continue;
368-
369-
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE) &&
370-
nexthop->nh_label != NULL) {
371-
found_p = true;
372-
break;
373-
}
374-
}
375-
}
376-
377-
if (!found_p) {
378-
if (IS_ZEBRA_DEBUG_PW)
379-
zlog_debug("%s: unlabeled route for %s",
380-
__func__, pw->ifname);
381-
return -1;
382-
}
383-
384-
return 0;
341+
if (IS_ZEBRA_DEBUG_PW)
342+
zlog_debug("%s: unlabeled route for %s", __func__, pw->ifname);
343+
return -1;
385344
}
386345

387346
static int zebra_pw_client_close(struct zserv *client)
@@ -672,23 +631,6 @@ static void vty_show_mpls_pseudowire_detail(struct vty *vty)
672631
vty_out(vty, " Next Hop label: %s\n",
673632
"-");
674633
}
675-
676-
/* Include any installed backups */
677-
nhg = rib_get_fib_backup_nhg(re);
678-
if (nhg == NULL)
679-
continue;
680-
681-
for (ALL_NEXTHOPS_PTR(nhg, nexthop)) {
682-
snprintfrr(buf_nh, sizeof(buf_nh), "%pNHv",
683-
nexthop);
684-
vty_out(vty, " Next Hop: %s\n", buf_nh);
685-
if (nexthop->nh_label)
686-
vty_out(vty, " Next Hop label: %u\n",
687-
nexthop->nh_label->label[0]);
688-
else
689-
vty_out(vty, " Next Hop label: %s\n",
690-
"-");
691-
}
692634
}
693635
}
694636

@@ -750,26 +692,6 @@ static void vty_show_mpls_pseudowire(struct zebra_pw *pw, json_object *json_pws)
750692
json_object_array_add(json_nexthops, json_nexthop);
751693
}
752694

753-
/* Include installed backup nexthops also */
754-
nhg = rib_get_fib_backup_nhg(re);
755-
if (nhg == NULL)
756-
goto done;
757-
758-
for (ALL_NEXTHOPS_PTR(nhg, nexthop)) {
759-
json_nexthop = json_object_new_object();
760-
snprintfrr(buf_nh, sizeof(buf_nh), "%pNHv", nexthop);
761-
json_object_string_add(json_nexthop, "nexthop", buf_nh);
762-
if (nexthop->nh_label)
763-
json_object_int_add(
764-
json_nexthop, "nhLabel",
765-
nexthop->nh_label->label[0]);
766-
else
767-
json_object_string_add(json_nexthop, "nhLabel",
768-
"-");
769-
770-
json_object_array_add(json_nexthops, json_nexthop);
771-
}
772-
773695
done:
774696

775697
json_object_object_add(json_pw, "nexthops", json_nexthops);

0 commit comments

Comments
 (0)