DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] crypto/ipsec_mb: fix jobs array used for burst
@ 2023-07-05 10:15 Ciara Power
  2023-07-05 10:23 ` Ji, Kai
  2023-07-05 10:25 ` [PATCH v2] " Ciara Power
  0 siblings, 2 replies; 5+ messages in thread
From: Ciara Power @ 2023-07-05 10:15 UTC (permalink / raw)
  To: dev; +Cc: gakhil, pablo.de.lara.guarch, Ciara Power, marcel.d.cornu, Kai Ji

The jobs variable was global, which meant it was not thread safe.
This casued a segmentation fault when running the crypto performance
app, using more than one lcore for crypto processing.

Moving this to the dequeue function where it is used fixes the issue.

Fixes: b50b8b5b38f8 ("crypto/ipsec_mb: use burst API in AESNI")
Cc: marcel.d.cornu@intel.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index f4322d9af4..f702127f7f 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -9,10 +9,6 @@ struct aesni_mb_op_buf_data {
 	uint32_t offset;
 };
 
-#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
-static IMB_JOB *jobs[IMB_MAX_BURST_SIZE] = {NULL};
-#endif
-
 /**
  * Calculate the authentication pre-computes
  *
@@ -2044,6 +2040,7 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 	IMB_JOB *job;
 	int retval, processed_jobs = 0;
 	uint16_t i, nb_jobs;
+	IMB_JOB *jobs[IMB_MAX_BURST_SIZE] = {NULL};
 
 	if (unlikely(nb_ops == 0 || mb_mgr == NULL))
 		return 0;
-- 
2.25.1


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

* Re: [PATCH] crypto/ipsec_mb: fix jobs array used for burst
  2023-07-05 10:15 [PATCH] crypto/ipsec_mb: fix jobs array used for burst Ciara Power
@ 2023-07-05 10:23 ` Ji, Kai
  2023-07-05 10:25 ` [PATCH v2] " Ciara Power
  1 sibling, 0 replies; 5+ messages in thread
From: Ji, Kai @ 2023-07-05 10:23 UTC (permalink / raw)
  To: Power, Ciara, dev; +Cc: gakhil, De Lara Guarch, Pablo, Cornu, Marcel D

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

Acked-by: Kai Ji <kai.ji@intel.com<mailto:kai.ji@intel.com>>
________________________________
From: Power, Ciara <ciara.power@intel.com>
Sent: 05 July 2023 11:15
To: dev@dpdk.org <dev@dpdk.org>
Cc: gakhil@marvell.com <gakhil@marvell.com>; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; Power, Ciara <ciara.power@intel.com>; Cornu, Marcel D <marcel.d.cornu@intel.com>; Ji, Kai <kai.ji@intel.com>
Subject: [PATCH] crypto/ipsec_mb: fix jobs array used for burst

The jobs variable was global, which meant it was not thread safe.
This casued a segmentation fault when running the crypto performance
app, using more than one lcore for crypto processing.

Moving this to the dequeue function where it is used fixes the issue.

Fixes: b50b8b5b38f8 ("crypto/ipsec_mb: use burst API in AESNI")
Cc: marcel.d.cornu@intel.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index f4322d9af4..f702127f7f 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -9,10 +9,6 @@ struct aesni_mb_op_buf_data {
         uint32_t offset;
 };

-#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
-static IMB_JOB *jobs[IMB_MAX_BURST_SIZE] = {NULL};
-#endif
-
 /**
  * Calculate the authentication pre-computes
  *
@@ -2044,6 +2040,7 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
         IMB_JOB *job;
         int retval, processed_jobs = 0;
         uint16_t i, nb_jobs;
+       IMB_JOB *jobs[IMB_MAX_BURST_SIZE] = {NULL};

         if (unlikely(nb_ops == 0 || mb_mgr == NULL))
                 return 0;
--
2.25.1


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

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

* [PATCH v2] crypto/ipsec_mb: fix jobs array used for burst
  2023-07-05 10:15 [PATCH] crypto/ipsec_mb: fix jobs array used for burst Ciara Power
  2023-07-05 10:23 ` Ji, Kai
@ 2023-07-05 10:25 ` Ciara Power
  2023-07-05 12:42   ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 5+ messages in thread
From: Ciara Power @ 2023-07-05 10:25 UTC (permalink / raw)
  To: dev; +Cc: gakhil, pablo.de.lara.guarch, Ciara Power, marcel.d.cornu, Kai Ji

The jobs variable was global, which meant it was not thread safe.
This caused a segmentation fault when running the crypto performance
app, using more than one lcore for crypto processing.

Moving this to the dequeue function where it is used fixes the issue.

Fixes: b50b8b5b38f8 ("crypto/ipsec_mb: use burst API in AESNI")
Cc: marcel.d.cornu@intel.com

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>

---
v2: fixed typo in commit
---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index f4322d9af4..f702127f7f 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -9,10 +9,6 @@ struct aesni_mb_op_buf_data {
 	uint32_t offset;
 };
 
-#if IMB_VERSION(1, 2, 0) < IMB_VERSION_NUM
-static IMB_JOB *jobs[IMB_MAX_BURST_SIZE] = {NULL};
-#endif
-
 /**
  * Calculate the authentication pre-computes
  *
@@ -2044,6 +2040,7 @@ aesni_mb_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,
 	IMB_JOB *job;
 	int retval, processed_jobs = 0;
 	uint16_t i, nb_jobs;
+	IMB_JOB *jobs[IMB_MAX_BURST_SIZE] = {NULL};
 
 	if (unlikely(nb_ops == 0 || mb_mgr == NULL))
 		return 0;
-- 
2.25.1


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

* RE: [PATCH v2] crypto/ipsec_mb: fix jobs array used for burst
  2023-07-05 10:25 ` [PATCH v2] " Ciara Power
@ 2023-07-05 12:42   ` De Lara Guarch, Pablo
  2023-07-05 13:51     ` Akhil Goyal
  0 siblings, 1 reply; 5+ messages in thread
From: De Lara Guarch, Pablo @ 2023-07-05 12:42 UTC (permalink / raw)
  To: Power, Ciara, dev; +Cc: gakhil, Cornu, Marcel D, Ji, Kai



> -----Original Message-----
> From: Power, Ciara <ciara.power@intel.com>
> Sent: Wednesday, July 5, 2023 11:26 AM
> To: dev@dpdk.org
> Cc: gakhil@marvell.com; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Power, Ciara <ciara.power@intel.com>;
> Cornu, Marcel D <marcel.d.cornu@intel.com>; Ji, Kai <kai.ji@intel.com>
> Subject: [PATCH v2] crypto/ipsec_mb: fix jobs array used for burst
> 
> The jobs variable was global, which meant it was not thread safe.
> This caused a segmentation fault when running the crypto performance app,
> using more than one lcore for crypto processing.
> 
> Moving this to the dequeue function where it is used fixes the issue.
> 
> Fixes: b50b8b5b38f8 ("crypto/ipsec_mb: use burst API in AESNI")
> Cc: marcel.d.cornu@intel.com
> 
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> Acked-by: Kai Ji <kai.ji@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>


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

* RE: [PATCH v2] crypto/ipsec_mb: fix jobs array used for burst
  2023-07-05 12:42   ` De Lara Guarch, Pablo
@ 2023-07-05 13:51     ` Akhil Goyal
  0 siblings, 0 replies; 5+ messages in thread
From: Akhil Goyal @ 2023-07-05 13:51 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, Power, Ciara, dev; +Cc: Cornu, Marcel D, Ji, Kai

> > Subject: [PATCH v2] crypto/ipsec_mb: fix jobs array used for burst
> >
> > The jobs variable was global, which meant it was not thread safe.
> > This caused a segmentation fault when running the crypto performance app,
> > using more than one lcore for crypto processing.
> >
> > Moving this to the dequeue function where it is used fixes the issue.
> >
> > Fixes: b50b8b5b38f8 ("crypto/ipsec_mb: use burst API in AESNI")
> > Cc: marcel.d.cornu@intel.com
> >
> > Signed-off-by: Ciara Power <ciara.power@intel.com>
> > Acked-by: Kai Ji <kai.ji@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Applied to dpdk-next-crypto

Thanks.

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

end of thread, other threads:[~2023-07-05 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-05 10:15 [PATCH] crypto/ipsec_mb: fix jobs array used for burst Ciara Power
2023-07-05 10:23 ` Ji, Kai
2023-07-05 10:25 ` [PATCH v2] " Ciara Power
2023-07-05 12:42   ` De Lara Guarch, Pablo
2023-07-05 13:51     ` 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).