From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Mrozowicz, SlawomirX" <slawomirx.mrozowicz@intel.com>,
"Doherty, Declan" <declan.doherty@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"Mrozowicz, SlawomirX" <slawomirx.mrozowicz@intel.com>
Subject: Re: [dpdk-dev] [PATCH] cryptodev: remove crypto device type enumeration
Date: Wed, 17 May 2017 09:00:04 +0000 [thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8974781E4CB@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <20170515095542.108383-1-slawomirx.mrozowicz@intel.com>
Hi Slawomir,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slawomir
> Mrozowicz
> Sent: Monday, May 15, 2017 10:56 AM
> To: Doherty, Declan
> Cc: dev@dpdk.org; Mrozowicz, SlawomirX
> Subject: [dpdk-dev] [PATCH] cryptodev: remove crypto device type
> enumeration
>
> Changes device type identification to be based on a unique
> driver id replacing the current device type enumeration, which needed
> library changes every time a new crypto driver was added.
>
> The driver id is assigned dynamically during driver registration using
> the new macro RTE_PMD_REGISTER_CRYPTO_DRIVER which returns a
> unique
> uint8_t identifier for that driver. New APIs are also introduced
> to allow retrieval of the driver id using the driver name.
>
> Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
There are compilation issues with the patch: http://dpdk.org/ml/archives/test-report/2017-May/019815.html
Could you add some information in the release notes?
There is an API change here, that should be noted.
> ---
> doc/guides/prog_guide/cryptodev_lib.rst | 5 +-
> drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 12 +-
> drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 2 +-
> drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 12 +-
> drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 2 +-
> drivers/crypto/armv8/rte_armv8_pmd.c | 12 +-
> drivers/crypto/armv8/rte_armv8_pmd_ops.c | 2 +-
> drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 10 +-
> drivers/crypto/kasumi/rte_kasumi_pmd.c | 12 +-
> drivers/crypto/kasumi/rte_kasumi_pmd_ops.c | 2 +-
> drivers/crypto/null/null_crypto_pmd.c | 12 +-
> drivers/crypto/null/null_crypto_pmd_ops.c | 2 +-
> drivers/crypto/openssl/rte_openssl_pmd.c | 12 +-
> drivers/crypto/openssl/rte_openssl_pmd_ops.c | 2 +-
> drivers/crypto/qat/qat_crypto.c | 7 +-
> drivers/crypto/qat/rte_qat_cryptodev.c | 8 +-
> drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 31 ++--
> drivers/crypto/scheduler/scheduler_pmd.c | 7 +-
> drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 +-
> drivers/crypto/scheduler/scheduler_pmd_private.h | 2 +-
> drivers/crypto/snow3g/rte_snow3g_pmd.c | 12 +-
> drivers/crypto/snow3g/rte_snow3g_pmd_ops.c | 2 +-
> drivers/crypto/zuc/rte_zuc_pmd.c | 12 +-
> drivers/crypto/zuc/rte_zuc_pmd_ops.c | 2 +-
> lib/librte_cryptodev/rte_cryptodev.c | 39 ++++-
> lib/librte_cryptodev/rte_cryptodev.h | 68 ++++---
> lib/librte_cryptodev/rte_cryptodev_pmd.h | 2 +-
> lib/librte_cryptodev/rte_cryptodev_version.map | 11 +-
> test/test/test_cryptodev.c | 195 ++++++++++++++-------
> test/test/test_cryptodev_blockcipher.c | 68 ++++---
> test/test/test_cryptodev_blockcipher.h | 2 +-
> test/test/test_cryptodev_perf.c | 124 ++++++++-----
> 32 files changed, 472 insertions(+), 221 deletions(-)
>
...
> diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> index 101ef98..64a0ba0 100644
> --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
> @@ -143,8 +143,9 @@ aesni_gcm_get_session(struct aesni_gcm_qp *qp,
> struct rte_crypto_sym_op *op)
> struct aesni_gcm_session *sess = NULL;
>
> if (op->sess_type == RTE_CRYPTO_SYM_OP_WITH_SESSION) {
> - if (unlikely(op->session->dev_type
> - !=
> RTE_CRYPTODEV_AESNI_GCM_PMD))
> + if (unlikely(op->session->driver_id !=
> + rte_cryptodev_driver_id_get(
> +
I would store the driver id of the PMD somewhere (maybe in aesni_gcm_qp or access dev->driver_id?),
and not call this function for all operations (same for other PMDs).
...
> diff --git a/lib/librte_cryptodev/rte_cryptodev.h
> b/lib/librte_cryptodev/rte_cryptodev.h
> index 88aeb87..533017c 100644
> --- a/lib/librte_cryptodev/rte_cryptodev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev.h
...
> +
> +/**
> + * Provide driver name.
> + *
> + * @param driver_id
> + * The driver identifier.
> + * @return
> + * The driver name or null if no driver found
> + */
> +char *rte_cryptodev_driver_name_get(uint8_t driver_id);
> +
> +/**
> + * Allocate driver identifier.
> + *
Mark this as internal, as this will only be used by PMDs, not apps.
next prev parent reply other threads:[~2017-05-17 9:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 9:55 Slawomir Mrozowicz
2017-05-17 9:00 ` De Lara Guarch, Pablo [this message]
2017-05-22 11:10 ` [dpdk-dev] [PATCH v2] " Slawomir Mrozowicz
2017-06-30 14:10 ` [dpdk-dev] [PATCH v3] " Pablo de Lara
2017-06-30 14:34 ` [dpdk-dev] [PATCH v4] " Pablo de Lara
2017-07-03 9:47 ` Declan Doherty
2017-07-04 10:16 ` De Lara Guarch, Pablo
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=E115CCD9D858EF4F90C690B0DCB4D8974781E4CB@IRSMSX108.ger.corp.intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=slawomirx.mrozowicz@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).