Thread (10 messages) 10 messages, 4 authors, 2017-03-15

Re: [PATCH v2] mbuf: use pktmbuf helper to create the pool

From: Olivier Matz <hidden>
Date: 2017-01-31 09:55:38

Hi Hemant,

Sorry for the delay.

On Fri, 20 Jan 2017 12:41:20 +0530, Hemant Agrawal
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
When possible, replace the uses of rte_mempool_create() with
the helper provided in librte_mbuf: rte_pktmbuf_pool_create().

This is the preferred way to create a mbuf pool.

This also updates the documentation.

Signed-off-by: Olivier Matz <redacted>
Signed-off-by: Hemant Agrawal <redacted>

[...]
--- a/examples/ip_reassembly/main.c
@@ -909,11 +908,13 @@ struct rte_lpm6_config lpm6_config = {
 
 	snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
 
-	if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE,
0,
-			sizeof(struct rte_pktmbuf_pool_private),
-			rte_pktmbuf_pool_init, NULL,
rte_pktmbuf_init, NULL,
-			socket, MEMPOOL_F_SP_PUT |
MEMPOOL_F_SC_GET)) == NULL) { 
-		RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed",
buf);
+	rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf,
+		0, /* cache size */
+		0, /* priv size */
+		MBUF_DATA_SIZE, socket);
+	if (rxq->pool == NULL) {
+		RTE_LOG(ERR, IP_RSMBL,
+			"rte_pktmbuf_pool_create(%s) failed", buf);
 		return -1;
Here we loose the SP/SC flags. In the ip reassembly example, it looks
there is one mbuf pool per rx core since the beginning (commit
cc8f4d020). It's probably not critical, but I think we should remove
the ip reass part of the patch, what do you think?

Note that this issue was also in my RFC patch, so it's my
mistake :)


Apart from that, the patch looks good.

Thanks
Olivier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help