Thread (74 messages) 74 messages, 7 authors, 2021-10-20

Re: [dpdk-dev] [PATCH v3 0/7] cryptodev: hide internal structures

From: Power, Ciara <hidden>
Date: 2021-10-20 10:25:52
Subsystem: crypto api, the rest · Maintainers: Herbert Xu, "David S. Miller", Linus Torvalds

Hi Akhil,

-----Original Message-----
From: Akhil Goyal <redacted>
Sent: Monday 18 October 2021 15:42
To: dev@dpdk.org
Cc: thomas@monjalon.net; david.marchand@redhat.com;
hemant.agrawal@nxp.com; anoobj@marvell.com; De Lara Guarch, Pablo
[off-list ref]; Trahe, Fiona [off-list ref];
Doherty, Declan [off-list ref]; matan@nvidia.com;
g.singh@nxp.com; Zhang, Roy Fan [off-list ref];
jianjay.zhou@huawei.com; asomalap@amd.com; ruifeng.wang@arm.com;
Ananyev, Konstantin [off-list ref]; Nicolau, Radu
[off-list ref]; ajit.khaparde@broadcom.com;
rnagadheeraj@marvell.com; adwivedi@marvell.com; Power, Ciara
[off-list ref]; Akhil Goyal [off-list ref]
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help