summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c63
1 files changed, 42 insertions, 21 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 261335e4a4..d92a4c2365 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -77,9 +77,6 @@ static struct dplane_ctx_q rib_dplane_q;
DEFINE_HOOK(rib_update, (struct route_node * rn, const char *reason),
(rn, reason));
-/* Should we allow non FRR processes to delete our routes */
-extern int allow_delete;
-
/* Each route type's string and default distance value. */
static const struct {
int key;
@@ -167,6 +164,30 @@ struct wq_evpn_wrapper {
#pragma FRR printfrr_ext "%pZN" (struct route_node *)
#endif
+static const char *subqueue2str(uint8_t index)
+{
+ switch (index) {
+ case 0:
+ return "NHG Objects";
+ case 1:
+ return "EVPN/VxLan Objects";
+ case 2:
+ return "Connected Routes";
+ case 3:
+ return "Kernel Routes";
+ case 4:
+ return "Static Routes";
+ case 5:
+ return "RIP/OSPF/ISIS/EIGRP/NHRP Routes";
+ case 6:
+ return "BGP Routes";
+ case 7:
+ return "Other Routes";
+ }
+
+ return "Unknown";
+}
+
printfrr_ext_autoreg_p("ZN", printfrr_zebra_node);
static ssize_t printfrr_zebra_node(struct fbuf *buf, struct printfrr_eargs *ea,
const void *ptr)
@@ -2401,8 +2422,8 @@ static void process_subq_nhg(struct listnode *lnode)
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
zlog_debug(
- "NHG Context id=%u dequeued from sub-queue %u",
- ctx->id, qindex);
+ "NHG Context id=%u dequeued from sub-queue %s",
+ ctx->id, subqueue2str(qindex));
/* Process nexthop group updates coming 'up' from the OS */
@@ -2412,8 +2433,8 @@ static void process_subq_nhg(struct listnode *lnode)
nhe = w->u.nhe;
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("NHG %u dequeued from sub-queue %u",
- nhe->id, qindex);
+ zlog_debug("NHG %u dequeued from sub-queue %s", nhe->id,
+ subqueue2str(qindex));
/* Process incoming nhg update, probably from a proto daemon */
newnhe = zebra_nhg_proto_add(nhe->id, nhe->type,
@@ -2459,9 +2480,9 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
if (dest)
re = re_list_first(&dest->routes);
- zlog_debug("%s(%u:%u):%pRN rn %p dequeued from sub-queue %u",
+ zlog_debug("%s(%u:%u):%pRN rn %p dequeued from sub-queue %s",
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0,
- rnode, rnode, qindex);
+ rnode, rnode, subqueue2str(qindex));
}
if (rnode->info)
@@ -2572,8 +2593,8 @@ static int rib_meta_queue_add(struct meta_queue *mq, void *data)
RIB_ROUTE_QUEUED(qindex))) {
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
rnode_debug(rn, re->vrf_id,
- "rn %p is already queued in sub-queue %u",
- (void *)rn, qindex);
+ "rn %p is already queued in sub-queue %s",
+ (void *)rn, subqueue2str(qindex));
return -1;
}
@@ -2583,8 +2604,8 @@ static int rib_meta_queue_add(struct meta_queue *mq, void *data)
mq->size++;
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- rnode_debug(rn, re->vrf_id, "queued rn %p into sub-queue %u",
- (void *)rn, qindex);
+ rnode_debug(rn, re->vrf_id, "queued rn %p into sub-queue %s",
+ (void *)rn, subqueue2str(qindex));
return 0;
}
@@ -2609,8 +2630,8 @@ static int rib_meta_queue_nhg_ctx_add(struct meta_queue *mq, void *data)
mq->size++;
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("NHG Context id=%u queued into sub-queue %u",
- ctx->id, qindex);
+ zlog_debug("NHG Context id=%u queued into sub-queue %s",
+ ctx->id, subqueue2str(qindex));
return 0;
}
@@ -2635,8 +2656,8 @@ static int rib_meta_queue_nhg_add(struct meta_queue *mq, void *data)
mq->size++;
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("NHG id=%u queued into sub-queue %u",
- nhe->id, qindex);
+ zlog_debug("NHG id=%u queued into sub-queue %s", nhe->id,
+ subqueue2str(qindex));
return 0;
}
@@ -3716,8 +3737,8 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
rn, fib,
zebra_route_string(fib->type));
}
- if (allow_delete
- || CHECK_FLAG(dest->flags, RIB_ROUTE_ANY_QUEUED)) {
+ if (zrouter.allow_delete ||
+ CHECK_FLAG(dest->flags, RIB_ROUTE_ANY_QUEUED)) {
UNSET_FLAG(fib->status, ROUTE_ENTRY_INSTALLED);
/* Unset flags. */
for (rtnh = fib->nhe->nhg.nexthop; rtnh;
@@ -3762,8 +3783,8 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
if (same) {
struct nexthop *tmp_nh;
- if (fromkernel && CHECK_FLAG(flags, ZEBRA_FLAG_SELFROUTE)
- && !allow_delete) {
+ if (fromkernel && CHECK_FLAG(flags, ZEBRA_FLAG_SELFROUTE) &&
+ !zrouter.allow_delete) {
rib_install_kernel(rn, same, NULL);
route_unlock_node(rn);