From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3B24314EC for ; Wed, 16 Jan 2019 18:16:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 09:16:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,486,1539673200"; d="scan'208";a="110383085" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga008.jf.intel.com with ESMTP; 16 Jan 2019 09:16:23 -0800 Received: from irsmsx112.ger.corp.intel.com ([169.254.1.84]) by IRSMSX104.ger.corp.intel.com ([169.254.5.101]) with mapi id 14.03.0415.000; Wed, 16 Jan 2019 17:16:22 +0000 From: "De Lara Guarch, Pablo" To: "Kovacevic, Marko" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" Thread-Topic: [PATCH v4 2/3] test/compress: add out of space test Thread-Index: AQHUqc4eo6WtmF0rpUKH3j/HOq5p46WyJrhw Date: Wed, 16 Jan 2019 17:16:22 +0000 Message-ID: References: <20190111150900.11429-2-marko.kovacevic@intel.com> <20190111165253.14001-1-marko.kovacevic@intel.com> <20190111165253.14001-3-marko.kovacevic@intel.com> In-Reply-To: <20190111165253.14001-3-marko.kovacevic@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDJjODE0ZmEtOWJkNy00YmI0LWJmZDMtOGI5ZGM3MGNjODY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiXC85Nk14dXlxa3FLN2VRa1ZGTWM0SDZwNjh5MmRRWkpkTDg5MXFGYTgwaHErd3ZJUk1FNUdnam5lVnl6WUUyQ2IifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 2/3] test/compress: add out of space test 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, 16 Jan 2019 17:16:25 -0000 Hi Marko, Minor comments. > -----Original Message----- > From: Kovacevic, Marko > Sent: Friday, January 11, 2019 4:53 PM > To: dev@dpdk.org > Cc: akhil.goyal@nxp.com; De Lara Guarch, Pablo > ; Kovacevic, Marko > ; Kovacevic > Subject: [PATCH v4 2/3] test/compress: add out of space test >=20 > This patch adds new out of space testcase to check that the destination > mbuf is smaller than required for the output of compression to ensure the > driver doesn't crash and returns the valid error case. >=20 > Signed-off-by: Kovacevic, Marko > Acked-by: Lee Daly > Acked-by: Fiona Trahe >=20 > --- > v4: > Added Acks > V3: > Made requested changes(Pablo) >=20 > --- > test/test/test_compressdev.c | 178 > +++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 165 insertions(+), 13 deletions(-) >=20 > diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c > index 20895fc..1e41113 100644 > --- a/test/test/test_compressdev.c > +++ b/test/test/test_compressdev.c > @@ -42,6 +42,8 @@ > #define GZIP_HEADER_SIZE 10 > #define GZIP_TRAILER_SIZE 8 >=20 > +#define OUT_OF_SPACE_BUF 1 > + > const char * > huffman_type_strings[] =3D { > [RTE_COMP_HUFFMAN_DEFAULT] =3D "PMD default", > @@ -81,6 +83,7 @@ struct test_data_params { > enum rte_comp_op_type state; > unsigned int sgl; > enum zlib_direction zlib_dir; > + unsigned int out_of_space; > }; >=20 > static struct comp_testsuite_params testsuite_params =3D { 0 }; @@ -677,= 6 > +680,7 @@ test_deflate_comp_decomp(const struct interim_data_params > *int_data, > unsigned int num_xforms =3D int_data->num_xforms; > enum rte_comp_op_type state =3D test_data->state; > unsigned int sgl =3D test_data->sgl; > + unsigned int out_of_space =3D test_data->out_of_space; > enum zlib_direction zlib_dir =3D test_data->zlib_dir; > int ret_status =3D -1; > int ret; > @@ -693,6 +697,12 @@ test_deflate_comp_decomp(const struct > interim_data_params *int_data, > unsigned int i; > struct rte_mempool *buf_pool; > uint32_t data_size; > + /* Compressing with CompressDev */ > + unsigned int oos_zlib_decompress =3D > + (zlib_dir =3D=3D ZLIB_NONE || zlib_dir =3D=3D > ZLIB_DECOMPRESS); > + /* Decompressing with CompressDev */ > + unsigned int oos_zlib_compress =3D > + (zlib_dir =3D=3D ZLIB_NONE || zlib_dir =3D=3D > ZLIB_COMPRESS); > const struct rte_compressdev_capabilities *capa =3D > rte_compressdev_capability_get(0, > RTE_COMP_ALGO_DEFLATE); > char *contig_buf =3D NULL; > @@ -749,8 +759,12 @@ test_deflate_comp_decomp(const struct > interim_data_params *int_data, >=20 > if (sgl) { > for (i =3D 0; i < num_bufs; i++) { > - data_size =3D strlen(test_bufs[i]) * > - COMPRESS_BUF_SIZE_RATIO; > + if (out_of_space =3D=3D 1 && oos_zlib_decompress) { > + data_size =3D OUT_OF_SPACE_BUF; > + } else { > + (data_size =3D strlen(test_bufs[i]) * > + COMPRESS_BUF_SIZE_RATIO); No need for the parenthesis around this statement (plus, no need for the cu= rly braces). > + } > if (prepare_sgl_bufs(NULL, comp_bufs[i], > data_size, > ts_params->small_mbuf_pool, > @@ -761,8 +775,12 @@ test_deflate_comp_decomp(const struct > interim_data_params *int_data, >=20 > } else { > for (i =3D 0; i < num_bufs; i++) { > - data_size =3D strlen(test_bufs[i]) * > - COMPRESS_BUF_SIZE_RATIO; > + if (out_of_space =3D=3D 1 && oos_zlib_decompress) { > + data_size =3D OUT_OF_SPACE_BUF; > + } else { > + (data_size =3D strlen(test_bufs[i]) * > + COMPRESS_BUF_SIZE_RATIO); Same here. > + } > rte_pktmbuf_append(comp_bufs[i], data_size); > } > } > @@ -928,6 +946,18 @@ test_deflate_comp_decomp(const struct > interim_data_params *int_data, > * compress operation information is needed for the decompression > stage) > */ > for (i =3D 0; i < num_bufs; i++) { > + if (out_of_space && oos_zlib_decompress) { > + if (ops_processed[i]->status !=3D > + > RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) { Better to add an extra tab here, even though you cross the 80 char limit. > + ret_status =3D -1; > + > + RTE_LOG(ERR, USER1, > + "Out of Space operation was not > successful\n"); I would reword this to something more clear, like: Operation without expected out of space status error. Also, make these changes in the decompression side of the function (code be= low). Apart from this: Acked-by: Pablo de Lara