DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Ji, Kai" <kai.ji@intel.com>
To: "Power, Ciara" <ciara.power@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "gakhil@marvell.com" <gakhil@marvell.com>,
	"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"Cornu, Marcel D" <marcel.d.cornu@intel.com>
Subject: Re: [PATCH] crypto/ipsec_mb: fix jobs array used for burst
Date: Wed, 5 Jul 2023 10:23:03 +0000	[thread overview]
Message-ID: <SN6PR11MB3408B816103A2EC2594ED233812FA@SN6PR11MB3408.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230705101521.1126253-1-ciara.power@intel.com>

[-- 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 --]

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 10:15 Ciara Power
2023-07-05 10:23 ` Ji, Kai [this message]
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

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=SN6PR11MB3408B816103A2EC2594ED233812FA@SN6PR11MB3408.namprd11.prod.outlook.com \
    --to=kai.ji@intel.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.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).