From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 40212200 for ; Wed, 2 May 2018 15:44:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2018 06:44:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,354,1520924400"; d="scan'208";a="225159292" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga006.fm.intel.com with ESMTP; 02 May 2018 06:44:04 -0700 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.241]) by irsmsx110.ger.corp.intel.com ([169.254.15.125]) with mapi id 14.03.0319.002; Wed, 2 May 2018 14:44:03 +0100 From: "Daly, Lee" 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 Thread-Topic: [dpdk-dev] [PATCH v3 1/5] test/compress: add initial unit tests Thread-Index: AQHT3jI3TyewYy+OJUa7TkXGD8IAZaQceDmg Date: Wed, 2 May 2018 13:44:03 +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: <20180427141502.4288-2-pablo.de.lara.guarch@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzUwNTcwMzQtODhjNS00ZDNhLTk1ZTAtYTBlMTc2MWRmMjY3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ1Uk55NnJWSGN0MFwvWGdWQ1hRSndidnArdzRiZ0dIWVdRVWg2WWVtTTVwbGhUVktHMG5XQnJCODIyaXBoeW1ucyJ9 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: Wed, 02 May 2018 13:44:07 -0000 > -----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 >=20 > This commit introduces the initial tests for compressdev, performing basi= c > compression and decompression operations of sample test buffers, using > the Zlib library in one direction and compressdev in another direction, t= o > make sure that the library is compatible with Zlib. >=20 > Due to the use of Zlib API, the test is disabled by default, to avoid add= ing a > new dependency on DPDK. >=20 > Signed-off-by: Pablo de Lara > Signed-off-by: Ashish Gupta > Signed-off-by: Shally Verma <...> > +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; [Lee]At this point there is nothing to be freed yet, therefore TEST_FAILED = can be returned here without testsuite_teardown(); > + } > + > + 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; [Lee]Similar point here, wasted cycles on freeing memory which has not be a= llocated yet. May not be a major issue since this is only done on setup. > + } > + > + /* 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; > +} > + <...>