examples/pipeline: make quanta configurable
Make the pipeline instruction quanta configurable at build time. Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
parent
e2b8dc5256
commit
0b50ea60fb
@ -30,6 +30,15 @@
|
|||||||
#define THREAD_TIMER_PERIOD_MS 100
|
#define THREAD_TIMER_PERIOD_MS 100
|
||||||
#endif
|
#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
|
* Control thread: data plane thread context
|
||||||
*/
|
*/
|
||||||
@ -517,7 +526,7 @@ thread_main(void *arg __rte_unused)
|
|||||||
|
|
||||||
/* Data Plane */
|
/* Data Plane */
|
||||||
for (j = 0; j < t->n_pipelines; j++)
|
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 */
|
/* Control Plane */
|
||||||
if ((i & 0xF) == 0) {
|
if ((i & 0xF) == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user