Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set BURST to 1 by default for bandwidthratedunqueue #403

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions elements/standard/ratedunqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int
RatedUnqueue::configure(Vector<String> &conf, ErrorHandler *errh)
{
if (Args(this, errh).bind(conf)
.read_or_set("BURST", _burst, 32)
.read_or_set("BURST", _burst, -1)
.read_or_set("ACTIVE", _active, true)
.consume() < 0)
return -1;
Expand Down Expand Up @@ -86,6 +86,10 @@ int
RatedUnqueue::initialize(ErrorHandler *errh)
{
ScheduleInfo::initialize_task(this, &_task, errh);

if (_burst == -1)
_burst = (is_bandwidth()?1:32);

_signal = Notifier::upstream_empty_signal(this, 0, &_task);
_timer.initialize(this);
return 0;
Expand Down Expand Up @@ -172,17 +176,12 @@ RatedUnqueue::write_param(const String &conf, Element *e, void *user_data,
RatedUnqueue *u = static_cast<RatedUnqueue *>(e);
switch (reinterpret_cast<intptr_t>(user_data)) {
case h_active:
click_chatter("Active handler");
if (!BoolArg().parse(conf, u->_active))
return errh->error("syntax error");
if (u->_active && !u->_task.scheduled()) {

click_chatter("Scheduling");
u->_task.reschedule();
}

break;

if (!BoolArg().parse(conf, u->_active))
return errh->error("syntax error");
if (u->_active && !u->_task.scheduled()) {
u->_task.reschedule();
}
break;
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion test/standard/BandwidthRatedSplitter-01.clicktest
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Script(wait 10, read c1.count, read c2.count, read c3.count, read c4.count, writ
%expect stdout
%expect -w stderr
c1.count:
20
21
c2.count:
70
c3.count:
Expand Down
6 changes: 3 additions & 3 deletions test/standard/BandwidthRatedUnqueue-01.clicktest
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Script(wait 10, read c1.count, read c2.count, read c3.count, read c4.count, writ
c1.count:
21
c2.count:
71
70
c3.count:
71
70
c4.count:
{{1001|1002}}
1001
Loading