From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 53BF61B28A for ; Thu, 12 Oct 2017 15:29:07 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP; 12 Oct 2017 06:29:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,366,1503385200"; d="scan'208";a="161879612" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga005.fm.intel.com with ESMTP; 12 Oct 2017 06:29:04 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by IRSMSX152.ger.corp.intel.com ([169.254.6.87]) with mapi id 14.03.0319.002; Thu, 12 Oct 2017 14:29:04 +0100 From: "Ananyev, Konstantin" To: Hemant Agrawal , "dev@dpdk.org" Thread-Topic: [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool Thread-Index: AQHTQ12zXkxlidj/qkCLR5TBsk+jJ6LgNSgg Date: Thu, 12 Oct 2017 13:29:03 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772585FAA8411@IRSMSX103.ger.corp.intel.com> References: <1504690460-30616-1-git-send-email-hemant.agrawal@nxp.com> <1507814717-13306-1-git-send-email-hemant.agrawal@nxp.com> In-Reply-To: <1507814717-13306-1-git-send-email-hemant.agrawal@nxp.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDMxYTExMGYtMDdiNi00ZTg4LWFhMDgtZjUwNDZmZTFmZGY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlFOdnd5WFdmdHJ4WDVyMitSWWFLY2NZOXlIbFFvYkhPVXRRMEtCQVRacEk9In0= 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 v2] 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 13:29:07 -0000 > -----Original Message----- > From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com] > Sent: Thursday, October 12, 2017 2:25 PM > To: dev@dpdk.org; Ananyev, Konstantin > Subject: [PATCH v2] examples/ip_reassembly: use pktmbuf to create pool >=20 > From: Ashish Jain >=20 > 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 >=20 > Signed-off-by: Ashish Jain > --- > v2: add mempool caches - as suggested by Konstantin >=20 > examples/ip_reassembly/main.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.= c > index cadf4c5..2f662ba 100644 > --- a/examples/ip_reassembly/main.c > +++ b/examples/ip_reassembly/main.c > @@ -84,10 +84,10 @@ > #define MAX_JUMBO_PKT_LEN 9600 >=20 > #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 >=20 > #define NB_MBUF 8192 > +#define MEMPOOL_CACHE_SIZE 256 >=20 > /* allow max jumbo frame 9.5 KB */ > #define JUMBO_FRAME_MAX_SIZE 0x2600 > @@ -909,11 +909,11 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcor= e, uint32_t queue) >=20 > snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue); >=20 > - 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, MEMPOOL_CACHE_SIZE,= 0, > + MBUF_DATA_SIZE, socket); > + if (rxq->pool =3D=3D NULL) { > + RTE_LOG(ERR, IP_RSMBL, > + "rte_pktmbuf_pool_create(%s) failed", buf); > return -1; > } >=20 > -- Acked-by: Konstantin Ananyev > 2.7.4