> -----Original Message-----
> From: Akhil Goyal <[email protected]>
> Sent: Wednesday, October 20, 2021 12:28 PM
> To: [email protected]
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; De Lara Guarch, Pablo
> <[email protected]>; Trahe, Fiona <[email protected]>;
> Doherty, Declan <[email protected]>; [email protected];
> [email protected]; Zhang, Roy Fan <[email protected]>;
> [email protected]; [email protected]; [email protected];
> Ananyev, Konstantin <[email protected]>; Nicolau, Radu
> <[email protected]>; [email protected];
> [email protected]; [email protected]; Power, Ciara
> <[email protected]>; Akhil Goyal <[email protected]>
> Subject: [PATCH v4 4/8] crypto/scheduler: use proper API for device
> start/stop
>
> The worker PMDs were using direct device start/stop
> functions rather than rte_cryptodev_start(),
> so rte_crypto_fp_ops never get set. This patch calls
> the rte_cryptodev_start and stop APIs which start and
> stop devices properly and fp_ops get set.
>
> Reported-by: Ciara Power <[email protected]>
> Signed-off-by: Akhil Goyal <[email protected]>
> ---
> drivers/crypto/scheduler/scheduler_pmd_ops.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c
> b/drivers/crypto/scheduler/scheduler_pmd_ops.c
> index 465b88ade8..f61640c9d6 100644
> --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
> +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
> @@ -181,10 +181,7 @@ scheduler_pmd_start(struct rte_cryptodev *dev)
> /* start all workers */
> for (i = 0; i < sched_ctx->nb_workers; i++) {
> uint8_t worker_dev_id = sched_ctx->workers[i].dev_id;
> - struct rte_cryptodev *worker_dev =
> -
> rte_cryptodev_pmd_get_dev(worker_dev_id);
> -
> - ret = (*worker_dev->dev_ops->dev_start)(worker_dev);
> + ret = rte_cryptodev_start(worker_dev_id);
> if (ret < 0) {
> CR_SCHED_LOG(ERR, "Failed to start worker dev %u",
> worker_dev_id);
> @@ -208,10 +205,8 @@ scheduler_pmd_stop(struct rte_cryptodev *dev)
> /* stop all workers first */
> for (i = 0; i < sched_ctx->nb_workers; i++) {
> uint8_t worker_dev_id = sched_ctx->workers[i].dev_id;
> - struct rte_cryptodev *worker_dev =
> -
> rte_cryptodev_pmd_get_dev(worker_dev_id);
>
> - (*worker_dev->dev_ops->dev_stop)(worker_dev);
> + rte_cryptodev_stop(worker_dev_id);
> }
>
> if (*sched_ctx->ops.scheduler_stop)
> --
> 2.25.1
Acked-by: Fan Zhang <[email protected]>