examples/pipeline: make pipeline quanta configurable

Message ID 20210219142619.43960-1-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series examples/pipeline: make pipeline quanta configurable |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot fail travis build: failed
ci/github-robot success github build: passed
ci/iol-testing success Testing PASS

Commit Message

Cristian Dumitrescu Feb. 19, 2021, 2:26 p.m. UTC
  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(-)
  

Comments

Thomas Monjalon March 24, 2021, 9:02 a.m. UTC | #1
19/02/2021 15:26, Cristian Dumitrescu:
> Make the pipeline instruction quanta configurable at build time.
> 
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks
  

Patch

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) {