DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] crypto/scheduler: fix incorrect variable usage
@ 2024-09-18 14:15 Yong Liang
  2024-10-07 10:35 ` Ji, Kai
  0 siblings, 1 reply; 4+ messages in thread
From: Yong Liang @ 2024-09-18 14:15 UTC (permalink / raw)
  To: dev; +Cc: roy.fan.zhang

The variable `pending_deq_ops` was incorrectly used
instead of `pending_enq_ops`.
This causes the program to crash
when the worker PMD accesses the session

Bugzilla ID: 1537
Fixes: 6812b9bf470e ("crypto/scheduler: use unified session")
Cc: roy.fan.zhang@intel.com

Signed-off-by: Yong Liang <1269690261@qq.com>
---
 drivers/crypto/scheduler/scheduler_multicore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index a21b522f9f..70f8a25b70 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -191,11 +191,11 @@ mc_scheduler_worker(struct rte_cryptodev *dev)
 					worker->qp_id,
 					&enq_ops[pending_enq_ops_idx],
 					pending_enq_ops);
-			if (processed_ops < pending_deq_ops)
+			if (processed_ops < pending_enq_ops)
 				scheduler_retrieve_sessions(
 					&enq_ops[pending_enq_ops_idx +
 						processed_ops],
-					pending_deq_ops - processed_ops);
+					pending_enq_ops - processed_ops);
 			pending_enq_ops -= processed_ops;
 			pending_enq_ops_idx += processed_ops;
 			inflight_ops += processed_ops;
-- 
2.43.0


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

* Re: [PATCH] crypto/scheduler: fix incorrect variable usage
  2024-09-18 14:15 [PATCH] crypto/scheduler: fix incorrect variable usage Yong Liang
@ 2024-10-07 10:35 ` Ji, Kai
  2024-10-09  8:59   ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Ji, Kai @ 2024-10-07 10:35 UTC (permalink / raw)
  To: Yong Liang, dev; +Cc: roy.fan.zhang

[-- Attachment #1: Type: text/plain, Size: 2046 bytes --]

I'm not see any issue with original code, can you give more details about crash so I can try to reproduce at my end.
 cc kirill.rybalchenko@intel.com for review

________________________________
From: Yong Liang <1269690261@qq.com>
Sent: 18 September 2024 15:15
To: dev@dpdk.org <dev@dpdk.org>
Cc: roy.fan.zhang@intel.com <roy.fan.zhang@intel.com>
Subject: [PATCH] crypto/scheduler: fix incorrect variable usage

The variable `pending_deq_ops` was incorrectly used
instead of `pending_enq_ops`.
This causes the program to crash
when the worker PMD accesses the session

Bugzilla ID: 1537
Fixes: 6812b9bf470e ("crypto/scheduler: use unified session")
Cc: roy.fan.zhang@intel.com

Signed-off-by: Yong Liang <1269690261@qq.com>
---
 drivers/crypto/scheduler/scheduler_multicore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c
index a21b522f9f..70f8a25b70 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -191,11 +191,11 @@ mc_scheduler_worker(struct rte_cryptodev *dev)
                                         worker->qp_id,
                                         &enq_ops[pending_enq_ops_idx],
                                         pending_enq_ops);
-                       if (processed_ops < pending_deq_ops)
+                       if (processed_ops < pending_enq_ops)
                                 scheduler_retrieve_sessions(
                                         &enq_ops[pending_enq_ops_idx +
                                                 processed_ops],
-                                       pending_deq_ops - processed_ops);
+                                       pending_enq_ops - processed_ops);
                         pending_enq_ops -= processed_ops;
                         pending_enq_ops_idx += processed_ops;
                         inflight_ops += processed_ops;
--
2.43.0


[-- Attachment #2: Type: text/html, Size: 5551 bytes --]

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

* RE: [PATCH] crypto/scheduler: fix incorrect variable usage
  2024-10-07 10:35 ` Ji, Kai
@ 2024-10-09  8:59   ` Akhil Goyal
  2024-11-06 11:53     ` Akhil Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Akhil Goyal @ 2024-10-09  8:59 UTC (permalink / raw)
  To: Ji, Kai, Yong Liang, dev, Kirill Rybalchenko

> I'm not see any issue with original code, can you give more details about crash so
> I can try to reproduce at my end.
>  cc kirill.rybalchenko@intel.com for review

The details are there in Bugzilla
https://bugs.dpdk.org/show_bug.cgi?id=1537

> 
> ________________________________
> 
> From: Yong Liang <1269690261@qq.com>
> Sent: 18 September 2024 15:15
> To: dev@dpdk.org <dev@dpdk.org>
> Cc: roy.fan.zhang@intel.com <roy.fan.zhang@intel.com>
> Subject: [PATCH] crypto/scheduler: fix incorrect variable usage
> 
> The variable `pending_deq_ops` was incorrectly used
> instead of `pending_enq_ops`.
> This causes the program to crash
> when the worker PMD accesses the session
> 
> Bugzilla ID: 1537
> Fixes: 6812b9bf470e ("crypto/scheduler: use unified session")
> Cc: roy.fan.zhang@intel.com
> 
> Signed-off-by: Yong Liang <1269690261@qq.com>
> ---
>  drivers/crypto/scheduler/scheduler_multicore.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/crypto/scheduler/scheduler_multicore.c
> b/drivers/crypto/scheduler/scheduler_multicore.c
> index a21b522f9f..70f8a25b70 100644
> --- a/drivers/crypto/scheduler/scheduler_multicore.c
> +++ b/drivers/crypto/scheduler/scheduler_multicore.c
> @@ -191,11 +191,11 @@ mc_scheduler_worker(struct rte_cryptodev *dev)
>                                          worker->qp_id,
>                                          &enq_ops[pending_enq_ops_idx],
>                                          pending_enq_ops);
> -                       if (processed_ops < pending_deq_ops)
> +                       if (processed_ops < pending_enq_ops)
>                                  scheduler_retrieve_sessions(
>                                          &enq_ops[pending_enq_ops_idx +
>                                                  processed_ops],
> -                                       pending_deq_ops - processed_ops);
> +                                       pending_enq_ops - processed_ops);
>                          pending_enq_ops -= processed_ops;
>                          pending_enq_ops_idx += processed_ops;
>                          inflight_ops += processed_ops;
> --
> 2.43.0
> 


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

* RE: [PATCH] crypto/scheduler: fix incorrect variable usage
  2024-10-09  8:59   ` Akhil Goyal
@ 2024-11-06 11:53     ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2024-11-06 11:53 UTC (permalink / raw)
  To: Akhil Goyal, Ji, Kai, Yong Liang, dev, Kirill Rybalchenko

Hi Kai,

Any update on this patch?

> > I'm not see any issue with original code, can you give more details about crash
> so
> > I can try to reproduce at my end.
> >  cc kirill.rybalchenko@intel.com for review
> 
> The details are there in Bugzilla
> https://bugs.dpdk.org/show_bug.cgi?id=1537




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

end of thread, other threads:[~2024-11-06 11:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-18 14:15 [PATCH] crypto/scheduler: fix incorrect variable usage Yong Liang
2024-10-07 10:35 ` Ji, Kai
2024-10-09  8:59   ` Akhil Goyal
2024-11-06 11: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).