DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Trybula, ArturX" <arturx.trybula@intel.com>
To: "Trahe, Fiona" <fiona.trahe@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"shallyv@marvell.com" <shallyv@marvell.com>,
	"Dybkowski, AdamX" <adamx.dybkowski@intel.com>,
	"akhil.goyal@nxp.com" <akhil.goyal@nxp.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/2] test/compress: unit test for stateless overflow recovery
Date: Mon, 14 Oct 2019 14:20:21 +0000	[thread overview]
Message-ID: <5B6D1C77E9D7034C93E97BD83D1D9F572F22BBAB@hasmsx107.ger.corp.intel.com> (raw)
In-Reply-To: <348A99DA5F5B7549AA880327E580B435A21709CB@IRSMSX101.ger.corp.intel.com>

Hi Fiona,

Please find my answer below,

-----Original Message-----
From: Trahe, Fiona 
Sent: Monday, October 14, 2019 15:49
To: Trybula, ArturX <arturx.trybula@intel.com>; dev@dpdk.org; shallyv@marvell.com; Dybkowski, AdamX <adamx.dybkowski@intel.com>; akhil.goyal@nxp.com
Cc: Trahe, Fiona <fiona.trahe@intel.com>
Subject: RE: [PATCH v3 2/2] test/compress: unit test for stateless overflow recovery

Hi Artur,

> -----Original Message-----
> From: Trybula, ArturX
> Sent: Friday, October 11, 2019 6:46 PM
> To: dev@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; 
> shallyv@marvell.com; Dybkowski, AdamX <adamx.dybkowski@intel.com>; 
> Trybula, ArturX <arturx.trybula@intel.com>; akhil.goyal@nxp.com
> Subject: [PATCH v3 2/2] test/compress: unit test for stateless 
> overflow recovery
> 
> Added unit test to check out-of-space recoverable feature.
> 
> Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
> ---
>  app/test/test_compressdev.c | 261 
> +++++++++++++++++++++++++++++-------
>  1 file changed, 214 insertions(+), 47 deletions(-)


//snip//

> @@ -987,40 +1058,41 @@ test_deflate_comp_decomp(const struct interim_data_params *int_data,
>  				ops[i]->private_xform = priv_xforms[i];
>  		}
> 
> -		/* Enqueue and dequeue all operations */
> -		num_enqd = rte_compressdev_enqueue_burst(0, 0, ops, num_bufs);
> -		if (num_enqd < num_bufs) {
> +recovery_lb:
> +		ret = test_run_enqueue_dequeue(ops, num_bufs, ops_processed);
> +		if (ret < 0) {
>  			RTE_LOG(ERR, USER1,
> -				"The operations could not be enqueued\n");
> +				"Enqueue/dequeue operation failed\n");
>  			goto exit;
>  		}
> 
> -		num_total_deqd = 0;
> -		do {
> -			/*
> -			 * If retrying a dequeue call, wait for 10 ms to allow
> -			 * enough time to the driver to process the operations
> -			 */
> -			if (deqd_retries != 0) {
> -				/*
> -				 * Avoid infinite loop if not all the
> -				 * operations get out of the device
> -				 */
> -				if (deqd_retries == MAX_DEQD_RETRIES) {
> +		for (i = 0; i < num_bufs; i++) {
> +			compressed_data_size[i] += ops_processed[i]->produced;
> +
> +			if (ops_processed[i]->status ==
> +				RTE_COMP_OP_STATUS_OUT_OF_SPACE_RECOVERABLE) {
> +
> +				ops[i]->status =
> +					RTE_COMP_OP_STATUS_NOT_PROCESSED;
> +				ops[i]->src.offset +=
> +					ops_processed[i]->consumed;
> +				ops[i]->src.length -=
> +					ops_processed[i]->consumed;
> +				ops[i]->dst.offset +=
> +					ops_processed[i]->produced;
> +
> +				buf_ptr = rte_pktmbuf_append(
> +					ops[i]->m_dst,
> +					ops_processed[i]->produced);
> +
> +				if (buf_ptr == NULL) {
>  					RTE_LOG(ERR, USER1,
> -						"Not all operations could be "
> -						"dequeued\n");
> +						"Data recovery: append extra bytes to the current
> mbuf failed\n");
>  					goto exit;
>  				}
> -				usleep(DEQUEUE_WAIT_TIME);
> +				goto recovery_lb;
>  			}
> -			num_deqd = rte_compressdev_dequeue_burst(0, 0,
> -					&ops_processed[num_total_deqd], num_bufs);
> -			num_total_deqd += num_deqd;
> -			deqd_retries++;
> -
> -		} while (num_total_deqd < num_enqd);
> -
> +		}
>  		deqd_retries = 0;
//snip//

Not all drivers support OUT_OF_SPACE_RECOVERABLE - some may return OUT_OF_SPACE_TERMINATED.
There's no capability feature-flag which can be checked before running the test.
How would this test behave in this case?
Ideally it should recognise that OUT_OF_SPACE_TERMINATED is a valid response, but indicates that the driver doesn't support RECOVERABLE status and so return unsupported rather than failed.
[Artur] It can fail if a device doesn't support overflow capability. Tomorrow I will run tests using ISAL. 

  reply	other threads:[~2019-10-14 14:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 11:11 [dpdk-dev] [PATCH 1/2] compress/qat: overflow catching Artur Trybula
2019-09-06 11:11 ` [dpdk-dev] [PATCH 2/2] test/compress: unit test for stateless overflow recovery Artur Trybula
2019-09-26  9:32 ` [dpdk-dev] [PATCH v2 0/2] Add overflow recovery for stateless compression Artur Trybula
2019-09-26  9:32   ` [dpdk-dev] [PATCH v2 1/2] compress/qat: overflow catch " Artur Trybula
2019-09-26  9:32   ` [dpdk-dev] [PATCH v2 2/2] test/compress: unit test for stateless overflow recovery Artur Trybula
2019-10-11 17:46   ` [dpdk-dev] [PATCH v3 0/2] Add overflow recovery for stateless compression Artur Trybula
2019-10-11 17:46     ` [dpdk-dev] [PATCH v3 1/2] compress/qat: overflow catch " Artur Trybula
2019-10-14 13:38       ` Trahe, Fiona
2019-10-11 17:46     ` [dpdk-dev] [PATCH v3 2/2] test/compress: unit test for stateless overflow recovery Artur Trybula
2019-10-14 13:48       ` Trahe, Fiona
2019-10-14 14:20         ` Trybula, ArturX [this message]
2019-10-16  9:40     ` [dpdk-dev] [PATCH v4 0/2] Add overflow recovery for stateless compression Artur Trybula
2019-10-16  9:40       ` [dpdk-dev] [PATCH v4 1/2] compress/qat: overflow catch " Artur Trybula
2019-10-16  9:40       ` [dpdk-dev] [PATCH v4 2/2] test/compress: unit test for stateless overflow recovery Artur Trybula
2019-10-16 11:16       ` [dpdk-dev] [PATCH v4 0/2] Add overflow recovery for stateless compression Trahe, Fiona
2019-10-16 13:13         ` Akhil Goyal

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=5B6D1C77E9D7034C93E97BD83D1D9F572F22BBAB@hasmsx107.ger.corp.intel.com \
    --to=arturx.trybula@intel.com \
    --cc=adamx.dybkowski@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=shallyv@marvell.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).