diff mbox

[dpdk-dev,v3,3/8] app/eventdev: add pktmbuf pool for ethdev

Message ID 20171211151346.14405-3-pbhagavatula@caviumnetworks.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Pavan Nikhilesh Dec. 11, 2017, 3:13 p.m. UTC
Add pktmbuf pool creation used when configuring ethernet device as event
producer.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

 v2 Changes:
   - Set cache size as 512.

 app/test-eventdev/test_perf_common.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--
2.14.1
diff mbox

Patch

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 114210ea6..18945c0eb 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -412,13 +412,24 @@  perf_mempool_setup(struct evt_test *test, struct evt_options *opt)
 {
 	struct test_perf *t = evt_test_priv(test);

-	t->pool = rte_mempool_create(test->name, /* mempool name */
+	if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+		t->pool = rte_mempool_create(test->name, /* mempool name */
 				opt->pool_sz, /* number of elements*/
 				sizeof(struct perf_elt), /* element size*/
 				512, /* cache size*/
 				0, NULL, NULL,
 				perf_elt_init, /* obj constructor */
 				NULL, opt->socket_id, 0); /* flags */
+	} else {
+		t->pool = rte_pktmbuf_pool_create(test->name, /* mempool name */
+				opt->pool_sz, /* number of elements*/
+				512, /* cache size*/
+				0,
+				RTE_MBUF_DEFAULT_BUF_SIZE,
+				opt->socket_id); /* flags */
+
+	}
+
 	if (t->pool == NULL) {
 		evt_err("failed to create mempool");
 		return -ENOMEM;