From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 9D9281BC30 for ; Mon, 14 May 2018 10:40:56 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 01:40:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,399,1520924400"; d="scan'208";a="50629669" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga003.jf.intel.com with ESMTP; 14 May 2018 01:40:54 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by irsmsx110.ger.corp.intel.com ([169.254.15.125]) with mapi id 14.03.0319.002; Mon, 14 May 2018 09:40:22 +0100 From: "De Lara Guarch, Pablo" To: "Verma, Shally" , "dev@dpdk.org" CC: "Trahe, Fiona" , "Daly, Lee" , "ahmed.mansour@nxp.com" , "Gupta, Ashish" , "Gupta, Ashish" Thread-Topic: [PATCH v4 1/5] test/compress: add initial unit tests Thread-Index: AQHT45HgAxic1GsSYkeNLgidlHzR4KQu41OAgAASRRA= Date: Mon, 14 May 2018 08:40:21 +0000 Message-ID: References: <20180228140010.27251-1-pablo.de.lara.guarch@intel.com> <20180504102218.30672-1-pablo.de.lara.guarch@intel.com> <20180504102218.30672-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmU5ZjRiNDAtMzI1Ny00N2VlLTg4NjEtYWNmZGNjN2VjNGJhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkRqK0o1NndKa3dyc1VqcUdsckRlRU05ZUQ4TnQyRWMzUTF1TCt4NElmTTg9In0= 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 v4 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: Mon, 14 May 2018 08:40:57 -0000 > -----Original Message----- > From: Verma, Shally [mailto:Shally.Verma@cavium.com] > Sent: Monday, May 14, 2018 9:29 AM > To: De Lara Guarch, Pablo ; dev@dpdk.org > Cc: Trahe, Fiona ; Daly, Lee ; > ahmed.mansour@nxp.com; Gupta, Ashish ; Gupta, > Ashish > Subject: RE: [PATCH v4 1/5] test/compress: add initial unit tests >=20 >=20 >=20 > >-----Original Message----- > >From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com] > >Sent: 04 May 2018 15:52 > >To: dev@dpdk.org > >Cc: fiona.trahe@intel.com; lee.daly@intel.com; Verma, Shally > >; ahmed.mansour@nxp.com; Gupta, Ashish > >; Pablo de Lara > >; Gupta, Ashish > >; Verma, Shally > >Subject: [PATCH v4 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 > >Acked-by: Lee Daly > >--- > > config/common_base | 5 + > > test/test/Makefile | 9 + > > test/test/meson.build | 8 + > > test/test/test_compressdev.c | 725 +++++++++++++++++++++++ > > test/test/test_compressdev_test_buffer.h | 295 +++++++++ > > 5 files changed, 1042 insertions(+) > > create mode 100644 test/test/test_compressdev.c create mode 100644 > >test/test/test_compressdev_test_buffer.h > > > //snip >=20 > >+ * Compresses and decompresses buffer with compressdev API and Zlib > >+API */ static int test_deflate_comp_decomp(const char *test_buffer, > >+ struct rte_comp_xform *compress_xform, > >+ struct rte_comp_xform *decompress_xform, > >+ enum rte_comp_op_type state, > >+ enum zlib_direction zlib_dir) > >+{ > >+ struct comp_testsuite_params *ts_params =3D &testsuite_params; > >+ int ret_status =3D -1; > >+ int ret; > >+ struct rte_mbuf *comp_buf =3D NULL; > >+ struct rte_mbuf *uncomp_buf =3D NULL; > >+ struct rte_comp_op *op =3D NULL; > >+ struct rte_comp_op *op_processed =3D NULL; > >+ void *priv_xform =3D NULL; > >+ uint16_t num_deqd; > >+ unsigned int deqd_retries =3D 0; > >+ char *data_ptr; > >+ > >+ /* Prepare the source mbuf with the data */ > >+ uncomp_buf =3D rte_pktmbuf_alloc(ts_params->mbuf_pool); > >+ if (uncomp_buf =3D=3D NULL) { > >+ RTE_LOG(ERR, USER1, > >+ "Source mbuf could not be allocated " > >+ "from the mempool\n"); > >+ goto exit; > >+ } > >+ > >+ data_ptr =3D rte_pktmbuf_append(uncomp_buf, strlen(test_buffer) + 1); > >+ snprintf(data_ptr, strlen(test_buffer) + 1, "%s", test_buffer); > >+ > >+ /* Prepare the destination mbuf */ > >+ comp_buf =3D rte_pktmbuf_alloc(ts_params->mbuf_pool); > >+ if (comp_buf =3D=3D NULL) { > >+ RTE_LOG(ERR, USER1, > >+ "Destination mbuf could not be allocated " > >+ "from the mempool\n"); > >+ goto exit; > >+ } > >+ > >+ rte_pktmbuf_append(comp_buf, > >+ strlen(test_buffer) * COMPRESS_BUF_SIZE_RATIO); > >+ > >+ /* Build the compression operations */ > >+ op =3D rte_comp_op_alloc(ts_params->op_pool); > >+ if (op =3D=3D NULL) { > >+ RTE_LOG(ERR, USER1, > >+ "Compress operation could not be allocated " > >+ "from the mempool\n"); > >+ goto exit; > >+ } > >+ > >+ op->m_src =3D uncomp_buf; > >+ op->m_dst =3D comp_buf; > >+ op->src.offset =3D 0; > >+ op->src.length =3D rte_pktmbuf_pkt_len(uncomp_buf); > >+ op->dst.offset =3D 0; > >+ if (state =3D=3D RTE_COMP_OP_STATELESS) { > >+ //TODO: FULL or FINAL? > >+ op->flush_flag =3D RTE_COMP_FLUSH_FINAL; > >+ } else { > >+ RTE_LOG(ERR, USER1, > >+ "Stateful operations are not supported " > >+ "in these tests yet\n"); > >+ goto exit; > >+ } > >+ op->input_chksum =3D 0; > >+ > >+ /* Compress data (either with Zlib API or compressdev API */ > >+ if (zlib_dir =3D=3D ZLIB_COMPRESS || zlib_dir =3D=3D ZLIB_ALL) { > >+ ret =3D compress_zlib(op, > >+ (const struct rte_comp_xform *)&compress_xform, > [Shally] why are we passing ** here, compress_zlib() input rte_comp_xform= *, > this will cause a bug here. So, in call to decompress_zlib() below. Hi Shally, Looks like you are right. However, this code has been already merged and th= is was "fixed" in the second patch. Thanks, Pablo >=20 > Thanks > Shally