From: Zhangfei Gao <zhangfei.gao@linaro.org>
To: Akhil Goyal <gakhil@marvell.com>,
Declan Doherty <declan.doherty@intel.com>,
Fan Zhang <roy.fan.zhang@intel.com>,
Ashish Gupta <ashishg@marvell.com>, Ray Kinsella <mdr@ashroe.eu>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "acc@openeuler.org" <acc@openeuler.org>
Subject: Re: [EXT] [PATCH v2 2/5] crypto/uadk: introduce uadk crypto driver
Date: Thu, 29 Sep 2022 11:36:40 +0800 [thread overview]
Message-ID: <9cab7e73-029c-79b1-c63e-ddb39ce8194f@linaro.org> (raw)
In-Reply-To: <CO6PR18MB44841BE40C5F3ABDDDC3CEBAD8529@CO6PR18MB4484.namprd18.prod.outlook.com>
Hi, Akhil
On 2022/9/26 下午4:36, Akhil Goyal wrote:
>> Introduce a new crypto PMD for hardware accelerators based on UADK [1].
>>
>> UADK is a framework for user applications to access hardware accelerators.
>> UADK relies on IOMMU SVA (Shared Virtual Address) feature, which share
>> the same page table between IOMMU and MMU.
>> Thereby user application can directly use virtual address for device dma,
>> which enhances the performance as well as easy usability.
>>
>> This patch adds the basic framework.
>>
>> [1] https://github.com/Linaro/uadk
>>
>> Test:
>> sudo dpdk-test --vdev=crypto_uadk (--log-level=6)
>> RTE>>cryptodev_uadk_autotest
>> RTE>>quit
> Remove this test info. It can be in your last patch where test app changes are introduced.
>
>
>> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
>> ---
>> drivers/crypto/meson.build | 1 +
>> drivers/crypto/uadk/meson.build | 36 +++
>> drivers/crypto/uadk/uadk_crypto_pmd.c | 450 ++++++++++++++++++++++++++
>> drivers/crypto/uadk/version.map | 3 +
>> 4 files changed, 490 insertions(+)
>> create mode 100644 drivers/crypto/uadk/meson.build
>> create mode 100644 drivers/crypto/uadk/uadk_crypto_pmd.c
>> create mode 100644 drivers/crypto/uadk/version.map
>>
>> diff --git a/drivers/crypto/meson.build b/drivers/crypto/meson.build
>> index 147b8cf633..ee5377deff 100644
>> --- a/drivers/crypto/meson.build
>> +++ b/drivers/crypto/meson.build
>> @@ -18,6 +18,7 @@ drivers = [
>> 'octeontx',
>> 'openssl',
>> 'scheduler',
>> + 'uadk',
>> 'virtio',
>> ]
>>
>> diff --git a/drivers/crypto/uadk/meson.build b/drivers/crypto/uadk/meson.build
>> new file mode 100644
>> index 0000000000..a67c6c7ca5
>> --- /dev/null
>> +++ b/drivers/crypto/uadk/meson.build
>> @@ -0,0 +1,36 @@
>> +# SPDX-License-Identifier: BSD-3-Clause
>> +# Copyright 2022-2023 Huawei Technologies Co.,Ltd. All rights reserved.
>> +# Copyright 2022-2023 Linaro ltd.
>> +
>> +if not is_linux
>> + build = false
>> + reason = 'only supported on Linux'
>> + subdir_done()
>> +endif
>> +
>> +if arch_subdir != 'arm' or not dpdk_conf.get('RTE_ARCH_64')
>> + build = false
>> + reason = 'only supported on aarch64'
>> + subdir_done()
>> +endif
>> +
>> +sources = files(
>> + 'uadk_crypto_pmd.c',
>> +)
>> +
>> +deps += 'bus_vdev'
>> +dep = cc.find_library('libwd_crypto', dirs: ['/usr/local/lib'], required: false)
> I believe dirs is not required. You cannot assume that the lib is installed in /usr/local/lib/.
> Check other PMDs which have such dependencies. Eg. Ipsec-mb
>
>> +if not dep.found()
>> + build = false
>> + reason = 'missing dependency, "libwd_crypto"'
>> +else
>> + ext_deps += dep
>> +endif
>> +
>> +dep = cc.find_library('libwd', dirs: ['/usr/local/lib'], required: false)
>> +if not dep.found()
>> + build = false
>> + reason = 'missing dependency, "libwd"'
>> +else
>> + ext_deps += dep
>> +endif
>> diff --git a/drivers/crypto/uadk/uadk_crypto_pmd.c
>> b/drivers/crypto/uadk/uadk_crypto_pmd.c
>> new file mode 100644
>> index 0000000000..aad42524d6
>> --- /dev/null
>> +++ b/drivers/crypto/uadk/uadk_crypto_pmd.c
>> @@ -0,0 +1,450 @@
>> +/* SPDX-License-Identifier: BSD-3-Clause
>> + * Copyright 2022-2023 Huawei Technologies Co.,Ltd. All rights reserved.
>> + * Copyright 2022-2023 Linaro ltd.
>> + */
>> +
>> +#include <cryptodev_pmd.h>
>> +#include <rte_bus_vdev.h>
>> +#include <rte_comp.h>
>> +#include <uadk/wd_cipher.h>
>> +#include <uadk/wd_digest.h>
>> +#include <uadk/wd_sched.h>
>> +
>> +/* Maximum length for digest (SHA-512 needs 64 bytes) */
>> +#define DIGEST_LENGTH_MAX 64
>> +
>> +struct uadk_qp {
>> + struct rte_ring *processed_pkts;
>> + /* Ring for placing process packets */
>> + struct rte_cryptodev_stats qp_stats;
>> + /* Queue pair statistics */
>> + uint16_t id;
>> + /* Queue Pair Identifier */
>> + char name[RTE_CRYPTODEV_NAME_MAX_LEN];
>> + /* Unique Queue Pair Name */
>> + uint8_t temp_digest[DIGEST_LENGTH_MAX];
>> + /* Buffer used to store the digest generated
>> + * by the driver when verifying a digest provided
>> + * by the user (using authentication verify operation)
>> + */
>> +} __rte_cache_aligned;
> These comments should be added before the variable name or else use '<'
>
> The patches are not properly organized.
> I am skipping the review for now.
>
> Please split the patches as below.
> 1. introduce driver - create files with meson.build and with probe/remove
> and device ops defined but not implemented. You do not need to write empty functions.
> Add basic documentation also which defines what the driver is.
> You can explain the build dependency here.
> 2. define queue structs and setup/remove APIs
> 3. Add data path
> 4. implement cipher op. Add capabilities and documentation of what is supported in each of the patch. Add feature flags etc.
> 5. implement auth, add capabilities and documentation
> 6. test app changes.
Have updated v3 according to your suggestion.
https://patches.dpdk.org/project/dpdk/cover/20220929032746.10659-1-zhangfei.gao@linaro.org/
Would you mind take a look, in case my misunderstanding.
Thanks for your time
next prev parent reply other threads:[~2022-09-29 3:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 2:40 [PATCH v2 0/5] " Zhangfei Gao
2022-09-23 2:40 ` [PATCH v2 1/5] test/crypto: add cryptodev_uadk_autotest Zhangfei Gao
2022-09-26 7:59 ` [EXT] " Akhil Goyal
2022-09-23 2:40 ` [PATCH v2 2/5] crypto/uadk: introduce uadk crypto driver Zhangfei Gao
2022-09-26 8:36 ` [EXT] " Akhil Goyal
2022-09-26 9:10 ` Zhangfei Gao
2022-09-27 9:57 ` Zhangfei Gao
2022-09-29 3:36 ` Zhangfei Gao [this message]
2022-09-23 2:40 ` [PATCH v2 3/5] crypto/uadk: support cipher algorithms Zhangfei Gao
2022-09-23 2:40 ` [PATCH v2 4/5] crypto/uadk: support auth algorithms Zhangfei Gao
2022-09-23 2:40 ` [PATCH v2 5/5] doc: Update doc for UADK crypto PMD Zhangfei Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9cab7e73-029c-79b1-c63e-ddb39ce8194f@linaro.org \
--to=zhangfei.gao@linaro.org \
--cc=acc@openeuler.org \
--cc=ashishg@marvell.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=mdr@ashroe.eu \
--cc=roy.fan.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).