test/crypto: fix the devid testcases

Message ID 1530697778-1598-1-git-send-email-hemant.agrawal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Pablo de Lara Guarch
Headers
Series test/crypto: fix the devid testcases |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Hemant Agrawal July 4, 2018, 9:49 a.m. UTC
  devid is valid, while ts_params->valid_devs[devid] may
result a different value in case multiple devices are present
and any of the device is being used.

Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org
Cc: declan.doherty@intel.com

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 test/test/test_cryptodev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

De Lara Guarch, Pablo July 5, 2018, 12:29 p.m. UTC | #1
> -----Original Message-----
> From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> Sent: Wednesday, July 4, 2018 10:50 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Doherty, Declan
> <declan.doherty@intel.com>
> Subject: [PATCH] test/crypto: fix the devid testcases
> 
> devid is valid, while ts_params->valid_devs[devid] may result a different value in
> case multiple devices are present and any of the device is being used.
> 
> Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
> Cc: stable@dpdk.org
> Cc: declan.doherty@intel.com
> 
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  
De Lara Guarch, Pablo July 5, 2018, 4:11 p.m. UTC | #2
> -----Original Message-----
> From: stable [mailto:stable-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Thursday, July 5, 2018 1:29 PM
> To: Hemant Agrawal <hemant.agrawal@nxp.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Doherty, Declan
> <declan.doherty@intel.com>
> Subject: Re: [dpdk-stable] [PATCH] test/crypto: fix the devid testcases
> 
> 
> 
> > -----Original Message-----
> > From: Hemant Agrawal [mailto:hemant.agrawal@nxp.com]
> > Sent: Wednesday, July 4, 2018 10:50 AM
> > To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> > Cc: dev@dpdk.org; stable@dpdk.org; Doherty, Declan
> > <declan.doherty@intel.com>
> > Subject: [PATCH] test/crypto: fix the devid testcases
> >
> > devid is valid, while ts_params->valid_devs[devid] may result a
> > different value in case multiple devices are present and any of the device is
> being used.
> >
> > Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance
> > tests")
> > Cc: stable@dpdk.org
> > Cc: declan.doherty@intel.com
> >
> > Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied to dpdk-next-crypto.
Thanks,

Pablo
  

Patch

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 389f796..e252fee 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -585,7 +585,7 @@  test_device_configure_invalid_dev_id(void)
 	dev_id = ts_params->valid_devs[ts_params->valid_dev_count - 1];
 
 	/* Stop the device in case it's started so it can be configured */
-	rte_cryptodev_stop(ts_params->valid_devs[dev_id]);
+	rte_cryptodev_stop(dev_id);
 
 	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params->conf),
 			"Failed test for rte_cryptodev_configure: "