From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] examples/pipeline: make pipeline quanta configurable
Date: Fri, 19 Feb 2021 14:26:19 +0000 [thread overview]
Message-ID: <20210219142619.43960-1-cristian.dumitrescu@intel.com> (raw)
Make the pipeline instruction quanta configurable at build time.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
examples/pipeline/thread.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/examples/pipeline/thread.c b/examples/pipeline/thread.c
index 6ac27e4eb..bf11e6144 100644
--- a/examples/pipeline/thread.c
+++ b/examples/pipeline/thread.c
@@ -30,6 +30,15 @@
#define THREAD_TIMER_PERIOD_MS 100
#endif
+/* Pipeline instruction quanta: Needs to be big enough to do some meaningful
+ * work, but not too big to avoid starving any other pipelines mapped to the
+ * same thread. For a pipeline that executes 10 instructions per packet, a
+ * quanta of 1000 instructions equates to processing 100 packets.
+ */
+#ifndef PIPELINE_INSTR_QUANTA
+#define PIPELINE_INSTR_QUANTA 1000
+#endif
+
/**
* Control thread: data plane thread context
*/
@@ -517,7 +526,7 @@ thread_main(void *arg __rte_unused)
/* Data Plane */
for (j = 0; j < t->n_pipelines; j++)
- rte_swx_pipeline_run(t->p[j], 1000000);
+ rte_swx_pipeline_run(t->p[j], PIPELINE_INSTR_QUANTA);
/* Control Plane */
if ((i & 0xF) == 0) {
--
2.17.1
next reply other threads:[~2021-02-19 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 14:26 Cristian Dumitrescu [this message]
2021-03-24 9:02 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210219142619.43960-1-cristian.dumitrescu@intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).