From: Shijith Thotton Date: Fri, 17 Dec 2021 09:19:49 +0000 (+0530) Subject: crypto/cnxk: enable allocated queues only X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2ff2a87d8a49ba4ba9ff55fc29a0743d23f80b61;p=dpdk.git crypto/cnxk: enable allocated queues only Only enable/disable queue pairs that are allocated during cryptodev start/stop. Fixes: 52008104e9a6 ("crypto/cnxk: update instruction queue in start/stop") Cc: stable@dpdk.org Signed-off-by: Shijith Thotton Acked-by: Akhil Goyal --- diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c index a2281fb8de..21ee09f962 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c @@ -100,8 +100,13 @@ cnxk_cpt_dev_start(struct rte_cryptodev *dev) uint16_t nb_lf = roc_cpt->nb_lf; uint16_t qp_id; - for (qp_id = 0; qp_id < nb_lf; qp_id++) + for (qp_id = 0; qp_id < nb_lf; qp_id++) { + /* Application may not setup all queue pair */ + if (roc_cpt->lf[qp_id] == NULL) + continue; + roc_cpt_iq_enable(roc_cpt->lf[qp_id]); + } return 0; } @@ -114,8 +119,12 @@ cnxk_cpt_dev_stop(struct rte_cryptodev *dev) uint16_t nb_lf = roc_cpt->nb_lf; uint16_t qp_id; - for (qp_id = 0; qp_id < nb_lf; qp_id++) + for (qp_id = 0; qp_id < nb_lf; qp_id++) { + if (roc_cpt->lf[qp_id] == NULL) + continue; + roc_cpt_iq_disable(roc_cpt->lf[qp_id]); + } } int