Skip to content

Commit

Permalink
Add a warning message when BWRatedUnqueue has no BURST
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbette committed Oct 29, 2024
1 parent eba5769 commit 91a3454
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions elements/standard/ratedunqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 91a3454

Please sign in to comment.