Skip to content

Commit

Permalink
Restore batching in LinkUnqueue, originally added in commit 5b47e8c
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaibrodschi authored and tbarbette committed Oct 2, 2024
1 parent fd2b318 commit d47927b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions elements/standard/linkunqueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,29 @@ LinkUnqueue::run_task(Task *)
}

// Emit packets if it's time
#if HAVE_BATCH
BATCH_CREATE_INIT(batch);
#endif
while (_qhead && _qhead->timestamp_anno() <= now) {
Packet *p = _qhead;
_qhead = p->next();
if (!_qhead)
_qtail = 0;
p->set_next(0);
//click_chatter("%p{timestamp}: RELEASE %p{timestamp}", &now, &p->timestamp_anno());
#if HAVE_BATCH
BATCH_CREATE_APPEND(batch, p);
#else
output(0).push(p);
#endif
Storage::set_tail(Storage::tail() - 1);
worked = true;
}
#if HAVE_BATCH
BATCH_CREATE_FINISH(batch);
if (batch)
output(0).push_batch(batch);
#endif

// Figure out when to schedule next
//print_queue(_qhead);
Expand Down

0 comments on commit d47927b

Please sign in to comment.