From: Sergio Gonzalez Monroy Date: Thu, 7 Sep 2017 11:50:36 +0000 (+0100) Subject: crypto/aesni_mb: fix invalid session error X-Git-Tag: spdx-start~1431 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6fcd9fdf379b8218202e7213623da9b7359bb518;p=dpdk.git crypto/aesni_mb: fix invalid session error Setting an invalid session in the crypto op results in SEGFAULT because the JOB user_data was never set to the crypto op. Fixes: 0f548b50a160 ("crypto/aesni_mb: process crypto op on dequeue") Cc: stable@dpdk.org Signed-off-by: Sergio Gonzalez Monroy --- diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index 1d93b8e3e2..f91504d660 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -609,13 +609,16 @@ flush_mb_mgr(struct aesni_mb_qp *qp, struct rte_crypto_op **ops, } static inline JOB_AES_HMAC * -set_job_null_op(JOB_AES_HMAC *job) +set_job_null_op(JOB_AES_HMAC *job, struct rte_crypto_op *op) { job->chain_order = HASH_CIPHER; job->cipher_mode = NULL_CIPHER; job->hash_alg = NULL_HASH; job->cipher_direction = DECRYPT; + /* Set user data to be crypto operation data struct */ + job->user_data = op; + return job; } @@ -654,7 +657,7 @@ aesni_mb_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops, retval = set_mb_job_params(job, qp, op, &digest_idx); if (unlikely(retval != 0)) { qp->stats.dequeue_err_count++; - set_job_null_op(job); + set_job_null_op(job, op); } /* Submit job to multi-buffer for processing */