Skip to contentSkip to conversation

test/crypto-perf: fix number of sessions for cores

PATCH In review Ciara Power 2 participants 3 messages Nov 14, 2022 – Nov 15, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 test/crypto-perf: fix number of sessions for cores

Currently the performance application creates a device session per lcore. This was not reflected in how many session objects were available in the mempool, when using a scheduler device.

The number of lcores is now taken into consideration when calculating how many sessions are needed for the scheduler.

Fixes 09fcf99dcad2 ("test/crypto-perf: fix number of scheduler sessions")
---
 app/test-crypto-perf/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-crypto-perf/main.c +2 -2
index 0fe47c6caa..22f6b2b3ba 100644
@@ -269,8 +269,8 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs)
 			uint32_t nb_slaves =
 				rte_cryptodev_scheduler_workers_get(cdev_id,
 								NULL);
-			/* scheduler session header + 1 session per worker qp */
-			sessions_needed = 1 + enabled_cdev_count *
+			/* scheduler session header per lcore + 1 session per worker qp */
+			sessions_needed = nb_lcores + enabled_cdev_count *
 				opts->nb_qps * nb_slaves;
 #endif
 		} else
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/2 test/crypto-perf: replace slave with worker

Update the use of outdated language "slaves" with "workers".

---
 app/test-crypto-perf/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test-crypto-perf/main.c +2 -2
index 22f6b2b3ba..af5bd0d23b 100644
@@ -266,12 +266,12 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs)
 		if (!strcmp((const char *)opts->device_type,
 					"crypto_scheduler")) {
 #ifdef RTE_CRYPTO_SCHEDULER
-			uint32_t nb_slaves =
+			uint32_t nb_workers =
 				rte_cryptodev_scheduler_workers_get(cdev_id,
 								NULL);
 			/* scheduler session header per lcore + 1 session per worker qp */
 			sessions_needed = nb_lcores + enabled_cdev_count *
-				opts->nb_qps * nb_slaves;
+				opts->nb_qps * nb_workers;
 #endif
 		} else
 			sessions_needed = enabled_cdev_count * opts->nb_qps;
Signature · 1 line
2.34.1
#2 lore raw
In reply to Ciara Power
Quoted 11 lines

Currently the performance application creates a device session per lcore. This was not reflected in how many session objects were available in the mempool, when using a scheduler device.

The number of lcores is now taken into consideration when calculating how many sessions are needed for the scheduler.

Fixes 09fcf99dcad2 ("test/crypto-perf: fix number of scheduler sessions")

Series applied to dpdk-next-crypto

Thanks.