crypto/ipsec_mb: fix jobs array used for burst
Checks
Commit Message
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(-)
Comments
Acked-by: Kai Ji <kai.ji@intel.com<mailto:kai.ji@intel.com>>
@@ -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;