From 91a3454b9755e38e84e4872ae6286539e1f45b36 Mon Sep 17 00:00:00 2001 From: Tom Barbette Date: Tue, 29 Oct 2024 14:52:50 +0100 Subject: [PATCH] Add a warning message when BWRatedUnqueue has no BURST --- elements/standard/ratedunqueue.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/elements/standard/ratedunqueue.cc b/elements/standard/ratedunqueue.cc index 6e6c198f4..84a2c6266 100644 --- a/elements/standard/ratedunqueue.cc +++ b/elements/standard/ratedunqueue.cc @@ -87,8 +87,15 @@ RatedUnqueue::initialize(ErrorHandler *errh) { ScheduleInfo::initialize_task(this, &_task, errh); - if (_burst == -1) - _burst = (is_bandwidth()?1:32); + if (_burst == -1) { + if (is_bandwidth()) { + _burst = 1; +#if HAVE_VERBOSE_BATCH + errh->warning("BURST parameter is not set. To avoid unexpected behavior, it will pull batches of one packet at maximum to avoid imprecision (e.g. pulling 32 packets which might be way over the amount of available tokens). Set BURST to a value to silence this message.", this); +#endif + } else + _burst = 32; + } _signal = Notifier::upstream_empty_signal(this, 0, &_task); _timer.initialize(this);