summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2025-03-24 14:11:35 -0400
committerDonald Sharp <sharpd@nvidia.com>2025-03-25 09:10:46 -0400
commit937a9fb3e923beb1cf0a795daddb178cb1fe0ec4 (patch)
tree47313603c293309310f970122c06cbc12237b7f7 /zebra/zebra_rib.c
parent12bf042c688fedf82637fab9ff77aa1eab271160 (diff)
zebra: Limit reading packets when MetaQ is full
Currently Zebra is just reading packets off the zapi wire and stacking them up for processing in zebra in the future. When there is significant churn in the network the size of zebra can grow without bounds due to the MetaQ sizing constraints. This ends up showing by the number of nexthops in the system. Reducing the number of packets serviced to limit the metaQ size to the packets to process allieviates this problem. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 20ec25a431..0c4f7e02f8 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3302,8 +3302,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 %s",
- (void *)rn, subqueue2str(qindex));
+ rnode_debug(rn, re->vrf_id, "queued rn %p into sub-queue %s mq size %u", (void *)rn,
+ subqueue2str(qindex), zrouter.mq->size);
return 0;
}
@@ -3335,8 +3335,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 %s",
- ctx->id, subqueue2str(qindex));
+ zlog_debug("NHG Context id=%u queued into sub-queue %s mq size %u", ctx->id,
+ subqueue2str(qindex), zrouter.mq->size);
return 0;
}
@@ -3363,8 +3363,8 @@ static int rib_meta_queue_nhg_process(struct meta_queue *mq, void *data,
mq->size++;
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("NHG id=%u queued into sub-queue %s", nhe->id,
- subqueue2str(qindex));
+ zlog_debug("NHG id=%u queued into sub-queue %s mq size %u", nhe->id,
+ subqueue2str(qindex), zrouter.mq->size);
return 0;
}
@@ -3410,6 +3410,11 @@ static int mq_add_handler(void *data,
return mq_add_func(zrouter.mq, data);
}
+uint32_t zebra_rib_meta_queue_size(void)
+{
+ return zrouter.mq->size;
+}
+
void mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
struct prefix *prefix, uint8_t route_type,
uint8_t route_instance)
@@ -4226,7 +4231,7 @@ static int rib_meta_queue_gr_run_add(struct meta_queue *mq, void *data)
mq->size++;
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
- zlog_debug("Graceful Run adding");
+ zlog_debug("Graceful Run adding mq size %u", zrouter.mq->size);
return 0;
}
@@ -4241,10 +4246,9 @@ static int rib_meta_queue_early_route_add(struct meta_queue *mq, void *data)
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
struct vrf *vrf = vrf_lookup_by_id(ere->re->vrf_id);
- zlog_debug("Route %pFX(%s) (%s) queued for processing into sub-queue %s",
- &ere->p, VRF_LOGNAME(vrf),
- ere->deletion ? "delete" : "add",
- subqueue2str(META_QUEUE_EARLY_ROUTE));
+ zlog_debug("Route %pFX(%s) (%s) queued for processing into sub-queue %s mq size %u",
+ &ere->p, VRF_LOGNAME(vrf), ere->deletion ? "delete" : "add",
+ subqueue2str(META_QUEUE_EARLY_ROUTE), zrouter.mq->size);
}
return 0;