Skip to content

Commit

Permalink
crypto/cnxk: enable allocated queues only
Browse files Browse the repository at this point in the history
[ upstream commit 2ff2a87 ]

Only enable/disable queue pairs that are allocated during cryptodev
start/stop.

Fixes: 5200810 ("crypto/cnxk: update instruction queue in start/stop")

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
  • Loading branch information
Shijith Thotton authored and kevintraynor committed Feb 21, 2022
1 parent de6b483 commit 99d6741
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/crypto/cnxk/cnxk_cryptodev_ops.c
Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 99d6741

Please sign in to comment.