DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Daly, Lee" <lee.daly@intel.com>
To: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Trahe, Fiona" <fiona.trahe@intel.com>,
	"shally.verma@cavium.com" <shally.verma@cavium.com>,
	"ahmed.mansour@nxp.com" <ahmed.mansour@nxp.com>,
	"Ashish.Gupta@cavium.com" <Ashish.Gupta@cavium.com>,
	"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	Ashish Gupta <ashish.gupta@caviumnetworks.com>,
	Shally Verma <shally.verma@caviumnetworks.com>
Subject: Re: [dpdk-dev] [PATCH v3 1/5] test/compress: add initial unit tests
Date: Wed, 2 May 2018 13:44:03 +0000	[thread overview]
Message-ID: <F5C6929789601049BEB7272E2673559850CBBB@IRSMSX106.ger.corp.intel.com> (raw)
In-Reply-To: <20180427141502.4288-2-pablo.de.lara.guarch@intel.com>



> -----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 <fiona.trahe@intel.com>; shally.verma@cavium.com;
> ahmed.mansour@nxp.com; Ashish.Gupta@cavium.com; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Shally Verma
> <shally.verma@caviumnetworks.com>
> 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 <pablo.de.lara.guarch@intel.com>
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>


<...>

> +static int
> +testsuite_setup(void)
> +{
> +	struct comp_testsuite_params *ts_params = &testsuite_params;
> +	unsigned int i;
> +
> +	if (rte_compressdev_count() == 0) {
> +		RTE_LOG(ERR, USER1, "Need at least one compress
> device\n");
> +		return -EINVAL;
> +	}
> +
> +	uint32_t max_buf_size = 0;
> +	for (i = 0; i < RTE_DIM(compress_test_bufs); i++)
> +		max_buf_size = RTE_MAX(max_buf_size,
> +				strlen(compress_test_bufs[i]) + 1);
> +
> +	max_buf_size *= 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 = 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 == 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 = rte_comp_op_pool_create("op_pool",
> NUM_OPS,
> +						0, 0, rte_socket_id());
> +	if (ts_params->op_pool == 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 allocated 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 = RTE_COMP_COMPRESS;
> +	ts_params->def_comp_xform.compress.algo =
> RTE_COMP_ALGO_DEFLATE,
> +	ts_params->def_comp_xform.compress.deflate.huffman =
> +
> 	RTE_COMP_HUFFMAN_DEFAULT;
> +	ts_params->def_comp_xform.compress.level =
> RTE_COMP_LEVEL_PMD_DEFAULT;
> +	ts_params->def_comp_xform.compress.chksum =
> RTE_COMP_CHECKSUM_NONE;
> +	ts_params->def_comp_xform.compress.window_size =
> DEFAULT_WINDOW_SIZE;
> +
> +	ts_params->def_decomp_xform.type = RTE_COMP_DECOMPRESS;
> +	ts_params->def_decomp_xform.decompress.algo =
> RTE_COMP_ALGO_DEFLATE,
> +	ts_params->def_decomp_xform.decompress.chksum =
> RTE_COMP_CHECKSUM_NONE;
> +	ts_params->def_decomp_xform.decompress.window_size =
> +DEFAULT_WINDOW_SIZE;
> +
> +	return TEST_SUCCESS;
> +
> +exit:
> +	testsuite_teardown();
> +
> +	return TEST_FAILED;
> +}
> +
<...>

  reply	other threads:[~2018-05-02 13:44 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 [this message]
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
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=F5C6929789601049BEB7272E2673559850CBBB@IRSMSX106.ger.corp.intel.com \
    --to=lee.daly@intel.com \
    --cc=Ashish.Gupta@cavium.com \
    --cc=ahmed.mansour@nxp.com \
    --cc=ashish.gupta@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=shally.verma@cavium.com \
    --cc=shally.verma@caviumnetworks.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).