Skip to contentSkip to conversation

app/test-crypto-perf: fix number of scheduler sessions

PATCH In review Ciara Power 2 participants 4 messages Oct 25, 2022 – Oct 27, 2022 Crypto API

lore
Share & tools
lore
#0 lore raw

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")
---
 app/test-crypto-perf/main.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
app/test-crypto-perf/main.c +2 -6
index 420acc3c6d..0fe47c6caa 100644
@@ -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
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 crypto/scheduler: fix op session in pkt size distr mode

The index for sess_ctx was incorrect when setting the op session.

Fixes 6812b9bf470e ("crypto/scheduler: use unified session")
---
 drivers/crypto/scheduler/scheduler_pkt_size_distr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/scheduler/scheduler_pkt_size_distr.c +1 -1
index 396cc3723d..41f05e6a47 100644
@@ -148,7 +148,7 @@ schedule_enqueue(void *qp, struct rte_crypto_op **ops, uint16_t nb_ops)
 		target[3] = !(job_len[3] & psd_qp_ctx->threshold);
 		if (ops[i + 3]->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
 			ops[i + 3]->sym->session =
-				sess_ctx[1]->worker_sess[target[3]];
+				sess_ctx[3]->worker_sess[target[3]];
 		p_enq_op = &enq_ops[target[3]];
 
 		if (p_enq_op->pos + in_flight_ops[p_enq_op->worker_idx] ==
Signature · 1 line
2.25.1
#3 lore raw
Quoted 6 lines

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

Quoted 3 lines

The scheduler PMD needs 1 session header,
along with a session per worker.

Quoted 8 lines
Quoted 7 lines

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

Series Applied to dpdk-next-crypto

Thanks.