DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ciara Power <ciara.power@intel.com>
To: dev@dpdk.org
Cc: gakhil@marvell.com, pablo.de.lara.guarch@intel.com,
	Ciara Power <ciara.power@intel.com>,
	marcel.d.cornu@intel.com, Kai Ji <kai.ji@intel.com>
Subject: [PATCH v2] crypto/ipsec_mb: fix jobs array used for burst
Date: Wed,  5 Jul 2023 10:25:30 +0000	[thread overview]
Message-ID: <20230705102530.1127021-1-ciara.power@intel.com> (raw)
In-Reply-To: <20230705101521.1126253-1-ciara.power@intel.com>

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


  parent reply	other threads:[~2023-07-05 10:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 10:15 [PATCH] " Ciara Power
2023-07-05 10:23 ` Ji, Kai
2023-07-05 10:25 ` Ciara Power [this message]
2023-07-05 12:42   ` [PATCH v2] " De Lara Guarch, Pablo
2023-07-05 13:51     ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230705102530.1127021-1-ciara.power@intel.com \
    --to=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=kai.ji@intel.com \
    --cc=marcel.d.cornu@intel.com \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).