driver: crypto: scheduler: fix session size computation

Message ID 20240705125756.227677-1-jhascoet@kalrayinc.com (mailing list archive)
State New
Delegated to: akhil goyal
Headers
Series driver: crypto: scheduler: fix session size computation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

jhascoet July 5, 2024, 12:57 p.m. UTC
From: Julien Hascoet <ju.hascoet@gmail.com>

The crypto scheduler session size computation was taking
into account only the worker session sizes and not its own.

Fixes: e2af4e403c1 ("crypto/scheduler: support DOCSIS security protocol")
Cc: stable@dpdk.org

Signed-off-by: Julien Hascoet <ju.hascoet@gmail.com>
---
 drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Akhil Goyal July 19, 2024, 1:06 p.m. UTC | #1
Hi Kai,
Please review.

> From: Julien Hascoet <ju.hascoet@gmail.com>
> 
> The crypto scheduler session size computation was taking
> into account only the worker session sizes and not its own.
> 
> Fixes: e2af4e403c1 ("crypto/scheduler: support DOCSIS security protocol")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Julien Hascoet <ju.hascoet@gmail.com>
> ---
>  drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c
> b/drivers/crypto/scheduler/scheduler_pmd_ops.c
> index a18f7a08b0..6e43438469 100644
> --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
> +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
> @@ -185,7 +185,7 @@ scheduler_session_size_get(struct scheduler_ctx
> *sched_ctx,
>  		uint8_t session_type)
>  {
>  	uint8_t i = 0;
> -	uint32_t max_priv_sess_size = 0;
> +	uint32_t max_priv_sess_size = sizeof(struct scheduler_session_ctx);
> 
>  	/* Check what is the maximum private session size for all workers */
>  	for (i = 0; i < sched_ctx->nb_workers; i++) {
  

Patch

diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index a18f7a08b0..6e43438469 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -185,7 +185,7 @@  scheduler_session_size_get(struct scheduler_ctx *sched_ctx,
 		uint8_t session_type)
 {
 	uint8_t i = 0;
-	uint32_t max_priv_sess_size = 0;
+	uint32_t max_priv_sess_size = sizeof(struct scheduler_session_ctx);
 
 	/* Check what is the maximum private session size for all workers */
 	for (i = 0; i < sched_ctx->nb_workers; i++) {