DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/crypto: refactor scheduler test worker PMDs
@ 2021-09-02 11:54 Rebecca Troy
  2021-09-03 12:55 ` Zhang, Roy Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Rebecca Troy @ 2021-09-02 11:54 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang, Rebecca Troy, Akhil Goyal, Declan Doherty

Previously, the scheduler unit test only created and attached 1 or 2
AESNI-MB cryptodev PMDs as workers if less than 2 AESNI-MB PMDs had
already been initialized.

This commit changes this to always create and attach 2 new AESNI-MB
cryptodev PMDs, regardless of previously initialized AESNI-MB PMDs.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
---
 app/test/test_cryptodev.c | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 9ad0b37473..843d07ba37 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -13475,31 +13475,32 @@ test_scheduler_attach_worker_op(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	uint8_t sched_id = ts_params->valid_devs[0];
-	uint32_t nb_devs, i, nb_devs_attached = 0;
+	uint32_t i, nb_devs_attached = 0;
 	int ret;
 	char vdev_name[32];
+	unsigned int count = rte_cryptodev_count();
 
-	/* create 2 AESNI_MB if necessary */
-	nb_devs = rte_cryptodev_device_count_by_driver(
-			rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)));
-	if (nb_devs < 2) {
-		for (i = nb_devs; i < 2; i++) {
-			snprintf(vdev_name, sizeof(vdev_name), "%s_%u",
-					RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD),
-					i);
-			ret = rte_vdev_init(vdev_name, NULL);
+	/* create 2 AESNI_MB vdevs on top of existing devices */
+	for (i = count; i < count + 2; i++) {
+		snprintf(vdev_name, sizeof(vdev_name), "%s_%u",
+				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD),
+				i);
+		ret = rte_vdev_init(vdev_name, NULL);
 
-			TEST_ASSERT(ret == 0,
-				"Failed to create instance %u of"
-				" pmd : %s",
-				i, RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
+		TEST_ASSERT(ret == 0,
+			"Failed to create instance %u of"
+			" pmd : %s",
+			i, RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
+
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1,
+				"Failed to create 2 AESNI MB PMDs.\n");
+			return TEST_SKIPPED;
 		}
 	}
 
 	/* attach 2 AESNI_MB cdevs */
-	for (i = 0; i < rte_cryptodev_count() && nb_devs_attached < 2;
-			i++) {
+	for (i = count; i < count + 2; i++) {
 		struct rte_cryptodev_info info;
 		unsigned int session_size;
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] test/crypto: refactor scheduler test worker PMDs
  2021-09-02 11:54 [dpdk-dev] [PATCH] test/crypto: refactor scheduler test worker PMDs Rebecca Troy
@ 2021-09-03 12:55 ` Zhang, Roy Fan
  2021-09-06 19:53   ` Akhil Goyal
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Roy Fan @ 2021-09-03 12:55 UTC (permalink / raw)
  To: Troy, Rebecca, dev; +Cc: Akhil Goyal, Doherty, Declan

> -----Original Message-----
> From: Troy, Rebecca <rebecca.troy@intel.com>
> Sent: Thursday, September 2, 2021 12:54 PM
> To: dev@dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang@intel.com>; Troy, Rebecca
> <rebecca.troy@intel.com>; Akhil Goyal <gakhil@marvell.com>; Doherty,
> Declan <declan.doherty@intel.com>
> Subject: [PATCH] test/crypto: refactor scheduler test worker PMDs
> 
> Previously, the scheduler unit test only created and attached 1 or 2
> AESNI-MB cryptodev PMDs as workers if less than 2 AESNI-MB PMDs had
> already been initialized.
> 
> This commit changes this to always create and attach 2 new AESNI-MB
> cryptodev PMDs, regardless of previously initialized AESNI-MB PMDs.
> 
> Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] test/crypto: refactor scheduler test worker PMDs
  2021-09-03 12:55 ` Zhang, Roy Fan
@ 2021-09-06 19:53   ` Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2021-09-06 19:53 UTC (permalink / raw)
  To: Zhang, Roy Fan, Troy, Rebecca, dev; +Cc: Doherty, Declan

> >
> > Previously, the scheduler unit test only created and attached 1 or 2
> > AESNI-MB cryptodev PMDs as workers if less than 2 AESNI-MB PMDs had
> > already been initialized.
> >
> > This commit changes this to always create and attach 2 new AESNI-MB
> > cryptodev PMDs, regardless of previously initialized AESNI-MB PMDs.
> >
> > Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
> > ---
> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>

Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-06 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 11:54 [dpdk-dev] [PATCH] test/crypto: refactor scheduler test worker PMDs Rebecca Troy
2021-09-03 12:55 ` Zhang, Roy Fan
2021-09-06 19:53   ` Akhil Goyal

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).