From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 928501B25A for ; Thu, 12 Oct 2017 13:39:01 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2017 04:39:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,365,1503385200"; d="scan'208";a="322432701" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga004.fm.intel.com with ESMTP; 12 Oct 2017 04:38:59 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Thu, 12 Oct 2017 12:38:11 +0100 From: "Ananyev, Konstantin" To: Hemant Agrawal , "dev@dpdk.org" CC: "ashish.jain@nxp.com" Thread-Topic: [PATCH] examples/ip_reassembly: use pktmbuf to create pool Thread-Index: AQHTJvNwD6GEYVrrBkmxSGsulluUVKLgPdMA///2zgCAABnzYA== Date: Thu, 12 Oct 2017 11:38:09 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772585FAA81B9@IRSMSX103.ger.corp.intel.com> References: <1504690460-30616-1-git-send-email-hemant.agrawal@nxp.com> <2601191342CEEE43887BDE71AB9772585FAA80B6@IRSMSX103.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjQ1MzhlZjYtNTZhZS00NDI0LWJlZWUtODA0NWZjMWJhZWIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkNzMXAzUFwvZlRCQ0ZhT1c1Sm41c1NrOUxFWklyZXNGcFwvNTBpU3Qyd2JiWT0ifQ== x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/ip_reassembly: use pktmbuf to create pool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 11:39:02 -0000 > -----Original Message----- > From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com] > Sent: Thursday, October 12, 2017 12:03 PM > To: Ananyev, Konstantin ; dev@dpdk.org > Cc: ashish.jain@nxp.com > Subject: Re: [PATCH] examples/ip_reassembly: use pktmbuf to create pool >=20 > On 10/12/2017 4:08 PM, Ananyev, Konstantin wrote: > > > > > >> -----Original Message----- > >> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com] > >> Sent: Wednesday, September 6, 2017 10:34 AM > >> To: dev@dpdk.org > >> Cc: Ananyev, Konstantin ; ashish.jain@nx= p.com > >> Subject: [PATCH] examples/ip_reassembly: use pktmbuf to create pool > >> > >> From: Ashish Jain > >> > >> Use 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 else > >> it may not work on implementation using the HW buffer pool > >> > >> Signed-off-by: Ashish Jain > >> --- > >> examples/ip_reassembly/main.c | 13 ++++++------- > >> 1 file changed, 6 insertions(+), 7 deletions(-) > >> > >> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/ma= in.c > >> index e62636c..20caeb3 100644 > >> --- a/examples/ip_reassembly/main.c > >> +++ b/examples/ip_reassembly/main.c > >> @@ -84,8 +84,7 @@ > >> #define MAX_JUMBO_PKT_LEN 9600 > >> > >> #define BUF_SIZE RTE_MBUF_DEFAULT_DATAROOM > >> -#define MBUF_SIZE \ > >> - (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM) > >> +#define MBUF_DATA_SIZE RTE_MBUF_DEFAULT_BUF_SIZE > >> > >> #define NB_MBUF 8192 > >> > >> @@ -909,11 +908,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t l= core, uint32_t queue) > >> > >> snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue); > >> > >> - if ((rxq->pool =3D 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)) =3D=3D NULL) { > >> - RTE_LOG(ERR, IP_RSMBL, "mempool_create(%s) failed", buf); > >> + rxq->pool =3D rte_pktmbuf_pool_create(buf, nb_mbuf, 0, 0, > >> + MBUF_DATA_SIZE, socket); > > > > As we can't pass SC|SP anymore can we then setup mempool cache size to = some non-zero value? > > Konstantin > > >=20 > #define MEMPOOL_CACHE_SIZE 256 > do you think "256" will be ok? Yes, sounds good enough. Konstantin >=20 >=20 > >> + if (rxq->pool =3D=3D NULL) { > >> + RTE_LOG(ERR, IP_RSMBL, > >> + "rte_pktmbuf_pool_create(%s) failed", buf); > >> return -1; > >> } > >> > >> -- > >> 2.7.4 > > > >