DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/pipeline: make pipeline quanta configurable
@ 2021-02-19 14:26 Cristian Dumitrescu
  0 siblings, 0 replies; only message in thread
From: Cristian Dumitrescu @ 2021-02-19 14:26 UTC (permalink / raw)
  To: dev

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-19 14:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 14:26 [dpdk-dev] [PATCH] examples/pipeline: make pipeline quanta configurable Cristian Dumitrescu

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git