Hi Akhil,

>-----Original Message-----
>From: Akhil Goyal <gak...@marvell.com>
>Sent: Monday 18 October 2021 15:42
>To: dev@dpdk.org
>Cc: tho...@monjalon.net; david.march...@redhat.com;
>hemant.agra...@nxp.com; ano...@marvell.com; De Lara Guarch, Pablo
><pablo.de.lara.gua...@intel.com>; Trahe, Fiona <fiona.tr...@intel.com>;
>Doherty, Declan <declan.dohe...@intel.com>; ma...@nvidia.com;
>g.si...@nxp.com; Zhang, Roy Fan <roy.fan.zh...@intel.com>;
>jianjay.z...@huawei.com; asoma...@amd.com; ruifeng.w...@arm.com;
>Ananyev, Konstantin <konstantin.anan...@intel.com>; Nicolau, Radu
><radu.nico...@intel.com>; ajit.khapa...@broadcom.com;
>rnagadhee...@marvell.com; adwiv...@marvell.com; Power, Ciara
><ciara.po...@intel.com>; Akhil Goyal <gak...@marvell.com>
>Subject: [PATCH v3 0/7] cryptodev: hide internal structures
>
>Structures rte_cryptodev and rte_cryptodev_data are not supposed to be
>directly used by the application. These are made public as they are used by
>inline datapath public APIs.
>This patchset, creates a new rte_cryptodev_core.h file which helps in defining
>a data structure to hold datapath APIs in a flat array based on the device
>identifier which is filled by the PMD.
>
>Similar series for ethdev and eventdev are also floated on ML.
>https://patchwork.dpdk.org/project/dpdk/list/?series=19428
>https://patchwork.dpdk.org/project/dpdk/list/?series=19405
>
>
<snip>

With this patchset I see a seg fault with the cryptodev_scheduler_autotest.
It is due to the worker PMDs using the direct device start functions rather 
than rte_cryptodev_start(), so fp_ops never get set.

I believe this fix is needed:

diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c 
b/drivers/crypto/scheduler/scheduler_pmd_ops.c
index 465b88ade8..d6f8d3ab78 100644
--- a/drivers/crypto/scheduler/scheduler_pmd_ops.c
+++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c
@@ -181,10 +181,8 @@ 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 +206,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)


Thanks,
Ciara

Reply via email to