app/test: Fix test_stats for dpaa_sec

Message ID 20200513171918.14128-1-apeksha.gupta@nxp.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series app/test: Fix test_stats for dpaa_sec |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing fail Testing issues

Commit Message

Apeksha Gupta May 13, 2020, 5:19 p.m. UTC
  Test case test_stats should be unsupported for dpaa_sec and return
-ENOTSUP.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
---
 app/test/test_cryptodev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Ruifeng Wang May 14, 2020, 1:11 a.m. UTC | #1
> -----Original Message-----
> From: Apeksha Gupta <apeksha.gupta@nxp.com>
> Sent: Thursday, May 14, 2020 1:19 AM
> To: dev@dpdk.org
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; declan.doherty@intel.com;
> asomalap@amd.com; anoobj@marvell.com; roy.fan.zhang@intel.com;
> fiona.trahe@intel.com; rnagadheeraj@marvell.com; adwivedi@marvell.com;
> jianjay.zhou@huawei.com; pablo.de.lara.guarch@intel.com;
> adamx.dybkowski@intel.com; Akhil.goyal@nxp.com; Apeksha Gupta
> <apeksha.gupta@nxp.com>
> Subject: [PATCH] app/test: Fix test_stats for dpaa_sec
> 
> Test case test_stats should be unsupported for dpaa_sec and return -
> ENOTSUP.
> 
> Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
> ---
>  app/test/test_cryptodev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index
> c624018ee..5aafe52f1 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -8821,6 +8821,8 @@ test_stats(void)
>  	TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0],
> 0) != 0),
>  		"rte_cryptodev_stats_get invalid Param failed");
>  	dev = &rte_cryptodevs[ts_params->valid_devs[0]];
> +	if (dev->dev_ops->stats_get == 0)
> +		return -ENOTSUP;

There are two tests prior to this check. IMO, this check should be hoisted.
What do you think?

>  	temp_pfn = dev->dev_ops->stats_get;
>  	dev->dev_ops->stats_get = (cryptodev_stats_get_t)0;
>  	TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0],
> &stats)
> --
> 2.17.1
  

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index c624018ee..5aafe52f1 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8821,6 +8821,8 @@  test_stats(void)
 	TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], 0) != 0),
 		"rte_cryptodev_stats_get invalid Param failed");
 	dev = &rte_cryptodevs[ts_params->valid_devs[0]];
+	if (dev->dev_ops->stats_get == 0)
+		return -ENOTSUP;
 	temp_pfn = dev->dev_ops->stats_get;
 	dev->dev_ops->stats_get = (cryptodev_stats_get_t)0;
 	TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats)