[1/2] app/test-crypto-perf: fix number of scheduler sessions

Message ID 20221025141429.3463350-1-ciara.power@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [1/2] app/test-crypto-perf: fix number of scheduler sessions |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Power, Ciara Oct. 25, 2022, 2:14 p.m. UTC
  The scheduler PMD needs 1 session header,
along with a session per worker.

After the session rework, this change was made to other apps,
for example l2fwd-crypto, but was missed in test-crypto-perf.

Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
Cc: gakhil@marvell.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test-crypto-perf/main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
  

Comments

Akhil Goyal Oct. 25, 2022, 3:10 p.m. UTC | #1
> The scheduler PMD needs 1 session header,
> along with a session per worker.
> 
> After the session rework, this change was made to other apps,
> for example l2fwd-crypto, but was missed in test-crypto-perf.
> 
> Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
> Cc: gakhil@marvell.com
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
  
Akhil Goyal Oct. 27, 2022, 9:59 a.m. UTC | #2
> Subject: RE: [EXT] [PATCH 1/2] app/test-crypto-perf: fix number of scheduler
> sessions
> 
> > The scheduler PMD needs 1 session header,
> > along with a session per worker.
> >
> > After the session rework, this change was made to other apps,
> > for example l2fwd-crypto, but was missed in test-crypto-perf.
> >
> > Fixes: bdce2564dbf7 ("cryptodev: rework session framework")
> > Cc: gakhil@marvell.com
> >
> > Signed-off-by: Ciara Power <ciara.power@intel.com>
> Acked-by: Akhil Goyal <gakhil@marvell.com>

Series Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test-crypto-perf/main.c b/app/test-crypto-perf/main.c
index 420acc3c6d..0fe47c6caa 100644
--- a/app/test-crypto-perf/main.c
+++ b/app/test-crypto-perf/main.c
@@ -263,18 +263,14 @@  cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs)
 		opts->segment_sz += (opts->headroom_sz + opts->tailroom_sz);
 
 		uint32_t dev_max_nb_sess = cdev_info.sym.max_nb_sessions;
-		/*
-		 * Two sessions objects are required for each session
-		 * (one for the header, one for the private data)
-		 */
 		if (!strcmp((const char *)opts->device_type,
 					"crypto_scheduler")) {
 #ifdef RTE_CRYPTO_SCHEDULER
 			uint32_t nb_slaves =
 				rte_cryptodev_scheduler_workers_get(cdev_id,
 								NULL);
-
-			sessions_needed = enabled_cdev_count *
+			/* scheduler session header + 1 session per worker qp */
+			sessions_needed = 1 + enabled_cdev_count *
 				opts->nb_qps * nb_slaves;
 #endif
 		} else