From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH v2] mbuf: use pktmbuf helper to create the pool Date: Tue, 31 Jan 2017 10:55:35 +0100 Message-ID: <20170131105535.2831ac3d@platinum> References: <1484678576-3925-1-git-send-email-hemant.agrawal@nxp.com> <1484896280-18814-1-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , To: Hemant Agrawal Return-path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 2CEE42B98 for ; Tue, 31 Jan 2017 10:55:38 +0100 (CET) Received: by mail-wm0-f43.google.com with SMTP id c85so253020012wmi.1 for ; Tue, 31 Jan 2017 01:55:38 -0800 (PST) In-Reply-To: <1484896280-18814-1-git-send-email-hemant.agrawal@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Hemant, Sorry for the delay. On Fri, 20 Jan 2017 12:41:20 +0530, Hemant Agrawal wrote: > 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 > Signed-off-by: Hemant Agrawal > > [...] > > --- 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