DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Verma, Shally" <Shally.Verma@cavium.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Trahe, Fiona" <fiona.trahe@intel.com>,
	"Daly, Lee" <lee.daly@intel.com>,
	 "ahmed.mansour@nxp.com" <ahmed.mansour@nxp.com>,
	"Gupta, Ashish" <Ashish.Gupta@cavium.com>,
	"Gupta, Ashish" <Ashish.Gupta@cavium.com>
Subject: Re: [dpdk-dev] [PATCH v4 1/5] test/compress: add initial unit tests
Date: Mon, 14 May 2018 08:40:21 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8976CD0A47D@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <CY4PR0701MB3634F4571ADCD15D4895763DF09C0@CY4PR0701MB3634.namprd07.prod.outlook.com>



> -----Original Message-----
> From: Verma, Shally [mailto:Shally.Verma@cavium.com]
> Sent: Monday, May 14, 2018 9:29 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; dev@dpdk.org
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; Daly, Lee <lee.daly@intel.com>;
> ahmed.mansour@nxp.com; Gupta, Ashish <Ashish.Gupta@cavium.com>; Gupta,
> Ashish <Ashish.Gupta@cavium.com>
> Subject: RE: [PATCH v4 1/5] test/compress: add initial unit tests
> 
> 
> 
> >-----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
> ><Shally.Verma@cavium.com>; ahmed.mansour@nxp.com; Gupta, Ashish
> ><Ashish.Gupta@cavium.com>; Pablo de Lara
> ><pablo.de.lara.guarch@intel.com>; Gupta, Ashish
> ><Ashish.Gupta@cavium.com>; Verma, Shally <Shally.Verma@cavium.com>
> >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 <pablo.de.lara.guarch@intel.com>
> >Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> >Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> >Acked-by: Lee Daly <lee.daly@intel.com>
> >---
> > 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
> 
> >+ * 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 = &testsuite_params;
> >+	int ret_status = -1;
> >+	int ret;
> >+	struct rte_mbuf *comp_buf = NULL;
> >+	struct rte_mbuf *uncomp_buf = NULL;
> >+	struct rte_comp_op *op = NULL;
> >+	struct rte_comp_op *op_processed = NULL;
> >+	void *priv_xform = NULL;
> >+	uint16_t num_deqd;
> >+	unsigned int deqd_retries = 0;
> >+	char *data_ptr;
> >+
> >+	/* Prepare the source mbuf with the data */
> >+	uncomp_buf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> >+	if (uncomp_buf == NULL) {
> >+		RTE_LOG(ERR, USER1,
> >+			"Source mbuf could not be allocated "
> >+			"from the mempool\n");
> >+		goto exit;
> >+	}
> >+
> >+	data_ptr = 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 = rte_pktmbuf_alloc(ts_params->mbuf_pool);
> >+	if (comp_buf == 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 = rte_comp_op_alloc(ts_params->op_pool);
> >+	if (op == NULL) {
> >+		RTE_LOG(ERR, USER1,
> >+			"Compress operation could not be allocated "
> >+			"from the mempool\n");
> >+		goto exit;
> >+	}
> >+
> >+	op->m_src = uncomp_buf;
> >+	op->m_dst = comp_buf;
> >+	op->src.offset = 0;
> >+	op->src.length = rte_pktmbuf_pkt_len(uncomp_buf);
> >+	op->dst.offset = 0;
> >+	if (state == RTE_COMP_OP_STATELESS) {
> >+		//TODO: FULL or FINAL?
> >+		op->flush_flag = RTE_COMP_FLUSH_FINAL;
> >+	} else {
> >+		RTE_LOG(ERR, USER1,
> >+			"Stateful operations are not supported "
> >+			"in these tests yet\n");
> >+		goto exit;
> >+	}
> >+	op->input_chksum = 0;
> >+
> >+	/* Compress data (either with Zlib API or compressdev API */
> >+	if (zlib_dir == ZLIB_COMPRESS || zlib_dir == ZLIB_ALL) {
> >+		ret = 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 this was "fixed"
in the second patch.

Thanks,
Pablo

> 
> Thanks
> Shally

  reply	other threads:[~2018-05-14  8:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 14:00 [dpdk-dev] [PATCH 0/5] Initial compressdev " Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 1/5] compressdev: add const for xform in session init Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 2/5] test/compress: add initial unit tests Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 3/5] test/compress: add multi op test Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 4/5] test/compress: add multi level test Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 5/5] test/compress: add multi session test Pablo de Lara
2018-04-08 14:00 ` [dpdk-dev] [PATCH v2 0/5] Initial compressdev unit tests Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 1/5] test/compress: add initial " Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 2/5] test/compress: add multi op test Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 3/5] test/compress: add multi level test Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 4/5] test/compress: add multi xform test Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 5/5] test/compress: add invalid configuration tests Pablo de Lara
2018-04-27 14:14 ` [dpdk-dev] [PATCH v3 0/5] Initial compressdev unit tests Pablo de Lara
2018-04-27 14:14   ` [dpdk-dev] [PATCH v3 1/5] test/compress: add initial " Pablo de Lara
2018-05-02 13:44     ` Daly, Lee
2018-05-04  8:49       ` De Lara Guarch, Pablo
2018-04-27 14:14   ` [dpdk-dev] [PATCH v3 2/5] test/compress: add multi op test Pablo de Lara
2018-04-27 14:15   ` [dpdk-dev] [PATCH v3 3/5] test/compress: add multi level test Pablo de Lara
2018-04-27 14:15   ` [dpdk-dev] [PATCH v3 4/5] test/compress: add multi xform test Pablo de Lara
2018-05-02 13:49     ` Daly, Lee
2018-04-27 14:15   ` [dpdk-dev] [PATCH v3 5/5] test/compress: add invalid configuration tests Pablo de Lara
2018-05-01 13:00   ` [dpdk-dev] [PATCH v3 0/5] Initial compressdev unit tests Daly, Lee
2018-05-04 10:22 ` [dpdk-dev] [PATCH v4 " Pablo de Lara
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 1/5] test/compress: add initial " Pablo de Lara
2018-05-14  8:29     ` Verma, Shally
2018-05-14  8:40       ` De Lara Guarch, Pablo [this message]
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 2/5] test/compress: add multi op test Pablo de Lara
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 3/5] test/compress: add multi level test Pablo de Lara
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 4/5] test/compress: add multi xform test Pablo de Lara
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 5/5] test/compress: add invalid configuration tests Pablo de Lara
2018-05-08 15:47   ` [dpdk-dev] [PATCH v4 0/5] Initial compressdev unit tests Trahe, Fiona
2018-05-08 21:26   ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E115CCD9D858EF4F90C690B0DCB4D8976CD0A47D@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=Ashish.Gupta@cavium.com \
    --cc=Shally.Verma@cavium.com \
    --cc=ahmed.mansour@nxp.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=lee.daly@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).