From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 68EADDD2 for ; Fri, 4 May 2018 10:49:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2018 01:49:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,361,1520924400"; d="scan'208";a="225724552" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by fmsmga005.fm.intel.com with ESMTP; 04 May 2018 01:49:32 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by IRSMSX153.ger.corp.intel.com ([169.254.9.5]) with mapi id 14.03.0319.002; Fri, 4 May 2018 09:49:31 +0100 From: "De Lara Guarch, Pablo" To: "Daly, Lee" , "dev@dpdk.org" CC: "Trahe, Fiona" , "shally.verma@cavium.com" , "ahmed.mansour@nxp.com" , "Ashish.Gupta@cavium.com" , Ashish Gupta , Shally Verma Thread-Topic: [dpdk-dev] [PATCH v3 1/5] test/compress: add initial unit tests Thread-Index: AQHT3jIgCD7OmHub20u0Q73pOjhXkaQcahuAgALi10A= Date: Fri, 4 May 2018 08:49:30 +0000 Message-ID: References: <20180228140010.27251-1-pablo.de.lara.guarch@intel.com> <20180427141502.4288-1-pablo.de.lara.guarch@intel.com> <20180427141502.4288-2-pablo.de.lara.guarch@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzUwNTcwMzQtODhjNS00ZDNhLTk1ZTAtYTBlMTc2MWRmMjY3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InplZklSeEFsYWlGOUFITSt5SzdwRFZlMyt2eW5rS0JYN09scWZmQ29qVm89In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 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 v3 1/5] test/compress: add initial unit tests 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: Fri, 04 May 2018 08:49:36 -0000 Hi Lee, > -----Original Message----- > From: Daly, Lee > Sent: Wednesday, May 2, 2018 2:44 PM > To: De Lara Guarch, Pablo ; dev@dpdk.org > Cc: Trahe, Fiona ; shally.verma@cavium.com; > ahmed.mansour@nxp.com; Ashish.Gupta@cavium.com; De Lara Guarch, Pablo > ; Ashish Gupta > ; Shally Verma > > Subject: RE: [dpdk-dev] [PATCH v3 1/5] test/compress: add initial unit te= sts >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara > > Sent: Friday, April 27, 2018 3:15 PM > > To: dev@dpdk.org > > Cc: Trahe, Fiona ; shally.verma@cavium.com; > > ahmed.mansour@nxp.com; Ashish.Gupta@cavium.com; De Lara Guarch, > Pablo > > ; Ashish Gupta > > ; Shally Verma > > > > Subject: [dpdk-dev] [PATCH v3 1/5] test/compress: add initial unit > > tests > > > > This commit introduces the initial tests for compressdev, performing > > basic compression and decompression operations of sample test buffers, > > using the Zlib library in one direction and compressdev in another > > direction, to make sure that the library is compatible with Zlib. > > > > Due to the use of Zlib API, the test is disabled by default, to avoid > > adding a new dependency on DPDK. > > > > Signed-off-by: Pablo de Lara > > Signed-off-by: Ashish Gupta > > Signed-off-by: Shally Verma >=20 >=20 > <...> >=20 > > +static int > > +testsuite_setup(void) > > +{ > > + struct comp_testsuite_params *ts_params =3D &testsuite_params; > > + unsigned int i; > > + > > + if (rte_compressdev_count() =3D=3D 0) { > > + RTE_LOG(ERR, USER1, "Need at least one compress > > device\n"); > > + return -EINVAL; > > + } > > + > > + uint32_t max_buf_size =3D 0; > > + for (i =3D 0; i < RTE_DIM(compress_test_bufs); i++) > > + max_buf_size =3D RTE_MAX(max_buf_size, > > + strlen(compress_test_bufs[i]) + 1); > > + > > + max_buf_size *=3D COMPRESS_BUF_SIZE_RATIO; > > + /* > > + * Buffers to be used in compression and decompression. > > + * Since decompressed data might be larger than > > + * compressed data (due to block header), > > + * buffers should be big enough for both cases. > > + */ > > + ts_params->mbuf_pool =3D rte_pktmbuf_pool_create("mbuf_pool", > > + NUM_MBUFS, > > + CACHE_SIZE, 0, > > + max_buf_size + RTE_PKTMBUF_HEADROOM, > > + rte_socket_id()); > > + if (ts_params->mbuf_pool =3D=3D NULL) { > > + RTE_LOG(ERR, USER1, "Large mbuf pool could not be > > created\n"); > > + goto exit; >=20 > [Lee]At this point there is nothing to be freed yet, therefore TEST_FAILE= D can be > returned here without testsuite_teardown(); Right, will change. >=20 > > + } > > + > > + ts_params->op_pool =3D rte_comp_op_pool_create("op_pool", > > NUM_OPS, > > + 0, 0, rte_socket_id()); > > + if (ts_params->op_pool =3D=3D NULL) { > > + RTE_LOG(ERR, USER1, "Operation pool could not be > > created\n"); > > + goto exit; >=20 > [Lee]Similar point here, wasted cycles on freeing memory which has not be > allocated yet. > May not be a major issue since this is only done on setup. Well, at this point mbuf_pool has been created, so we need to free that. >=20 > > + } > > + > > + /* Initializes default values for compress/decompress xforms */ > > + ts_params->def_comp_xform.type =3D RTE_COMP_COMPRESS; > > + ts_params->def_comp_xform.compress.algo =3D > > RTE_COMP_ALGO_DEFLATE, > > + ts_params->def_comp_xform.compress.deflate.huffman =3D > > + > > RTE_COMP_HUFFMAN_DEFAULT; > > + ts_params->def_comp_xform.compress.level =3D > > RTE_COMP_LEVEL_PMD_DEFAULT; > > + ts_params->def_comp_xform.compress.chksum =3D > > RTE_COMP_CHECKSUM_NONE; > > + ts_params->def_comp_xform.compress.window_size =3D > > DEFAULT_WINDOW_SIZE; > > + > > + ts_params->def_decomp_xform.type =3D RTE_COMP_DECOMPRESS; > > + ts_params->def_decomp_xform.decompress.algo =3D > > RTE_COMP_ALGO_DEFLATE, > > + ts_params->def_decomp_xform.decompress.chksum =3D > > RTE_COMP_CHECKSUM_NONE; > > + ts_params->def_decomp_xform.decompress.window_size =3D > > +DEFAULT_WINDOW_SIZE; > > + > > + return TEST_SUCCESS; > > + > > +exit: > > + testsuite_teardown(); > > + > > + return TEST_FAILED; > > +} > > + > <...>