From 6a64b1537488e44c039dc9c5a512151abbc8c0f4 Mon Sep 17 00:00:00 2001
From: Tom Barbette <tom.barbette@uclouvain.be>
Date: Wed, 9 Aug 2023 23:40:40 +0200
Subject: [PATCH] FastUDPFlows: Add burst parameter
---
elements/tcpudp/fastudpflows.cc | 3 ++-
elements/tcpudp/fastudpflows.hh | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/elements/tcpudp/fastudpflows.cc b/elements/tcpudp/fastudpflows.cc
index 8160fd4e2..97431b0b0 100644
--- a/elements/tcpudp/fastudpflows.cc
+++ b/elements/tcpudp/fastudpflows.cc
@@ -69,6 +69,7 @@ FastUDPFlows::configure(Vector<String> &conf, ErrorHandler *errh)
.read_mp("DSTIP", _dipaddr)
.read_mp("FLOWS", _nflows)
.read_mp("FLOWSIZE", _flowsize)
+ .read_or_set("BURST", _burst, 32)
.read_or_set("FLOWBURST", _flowburst, 1)
.read_or_set("CHECKSUM", _cksum, true)
.read_or_set("SEQUENTIAL", _sequential, false)
@@ -203,7 +204,7 @@ FastUDPFlows::run_task(Task* t) {
}
#if HAVE_BATCH
if (in_batch_mode) {
- const unsigned int max = 32;
+ const unsigned int max = _burst;
PacketBatch *batch;
MAKE_BATCH(get_p(), batch, max);
if (likely(batch)) {
diff --git a/elements/tcpudp/fastudpflows.hh b/elements/tcpudp/fastudpflows.hh
index b35f0aedf..8fe2f0acd 100644
--- a/elements/tcpudp/fastudpflows.hh
+++ b/elements/tcpudp/fastudpflows.hh
@@ -105,6 +105,7 @@ class FastUDPFlows : public BatchElement {
unsigned int _nflows;
unsigned int _flowsize;
unsigned int _flowburst;
+ unsigned int _burst;
bool _cksum;
bool _sequential;
bool _duplicate;
--
GitLab