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 A6B771B1C0 for ; Thu, 12 Oct 2017 12:38:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 12 Oct 2017 03:38:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,365,1503385200"; d="scan'208";a="145660781" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by orsmga002.jf.intel.com with ESMTP; 12 Oct 2017 03:38:39 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.49]) by IRSMSX109.ger.corp.intel.com ([169.254.13.28]) with mapi id 14.03.0319.002; Thu, 12 Oct 2017 11:38:38 +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 Date: Thu, 12 Oct 2017 10:38:38 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772585FAA80B6@IRSMSX103.ger.corp.intel.com> References: <1504690460-30616-1-git-send-email-hemant.agrawal@nxp.com> In-Reply-To: <1504690460-30616-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjU5NzJmMzAtNGQ0NS00MWU2LWI5NzUtZjZiNDZhYTA5Yzg1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Iit4SmxrK3lKRUhkTmZvc3ltVkNsMWRJcVYwSU5rSmMyS05VY0ExMldtTm89In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] 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 10:38:44 -0000 > -----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@nxp.c= om > Subject: [PATCH] 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 > --- > examples/ip_reassembly/main.c | 13 ++++++------- > 1 file changed, 6 insertions(+), 7 deletions(-) >=20 > diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.= 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 >=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 >=20 > @@ -909,11 +908,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, 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 > + if (rxq->pool =3D=3D NULL) { > + RTE_LOG(ERR, IP_RSMBL, > + "rte_pktmbuf_pool_create(%s) failed", buf); > return -1; > } >=20 > -- > 2.7.4