From d47927b752b393ef0059e9842ab35b115bc6b530 Mon Sep 17 00:00:00 2001 From: Mihai Brodschi Date: Wed, 2 Oct 2024 16:29:05 +0300 Subject: [PATCH] Restore batching in LinkUnqueue, originally added in commit 5b47e8c6 --- elements/standard/linkunqueue.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elements/standard/linkunqueue.cc b/elements/standard/linkunqueue.cc index 20c118a50..2d3837f94 100644 --- a/elements/standard/linkunqueue.cc +++ b/elements/standard/linkunqueue.cc @@ -144,6 +144,9 @@ 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(); @@ -151,10 +154,19 @@ LinkUnqueue::run_task(Task *) _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);