X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fpipeline%2Fthread.c;h=5fe7eae00eb61813047add16517614b07d571d5e;hb=d04bb1c52647952e191f5ba2c56319c0139afc73;hp=7ff22e97f3384bdd2b0e0cbb37895c6aee760224;hpb=b77f660028127061b05a8a14cc6c93becb9e73bb;p=dpdk.git diff --git a/examples/pipeline/thread.c b/examples/pipeline/thread.c index 7ff22e97f3..5fe7eae00e 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 */ @@ -80,11 +89,9 @@ thread_free(void) continue; /* MSGQs */ - if (t->msgq_req) - rte_ring_free(t->msgq_req); + rte_ring_free(t->msgq_req); - if (t->msgq_rsp) - rte_ring_free(t->msgq_rsp); + rte_ring_free(t->msgq_rsp); } } @@ -93,7 +100,7 @@ thread_init(void) { uint32_t i; - RTE_LCORE_FOREACH_SLAVE(i) { + RTE_LCORE_FOREACH_WORKER(i) { char name[NAME_MAX]; struct rte_ring *msgq_req, *msgq_rsp; struct thread *t = &thread[i]; @@ -517,7 +524,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) {