> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Blunck
> Sent: Wednesday, July 12, 2017 9:00 AM
> To: dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>
> Subject: [dpdk-dev] [PATCH 2/2] cryptodev: rework cryptodev PMD init to
> not require rte_vdev.h
>
> This reworks the library code so that it doesn't require to include
> rte_vdev.h. This is a preparation to move the vdev bus into a standalone
> library.
>
> Signed-off-by: Jan Blunck <jblunck@infradead.org>
...
> diff --git a/lib/librte_cryptodev/rte_cryptodev_vdev.h
> b/lib/librte_cryptodev/rte_cryptodev_vdev.h
> index 94ab9d33d..a877eed74 100644
> --- a/lib/librte_cryptodev/rte_cryptodev_vdev.h
> +++ b/lib/librte_cryptodev/rte_cryptodev_vdev.h
> @@ -33,7 +33,6 @@
> #ifndef _RTE_CRYPTODEV_VDEV_H_
> #define _RTE_CRYPTODEV_VDEV_H_
>
> -#include <rte_vdev.h>
> #include <inttypes.h>
>
> #include "rte_cryptodev.h"
> @@ -72,15 +71,15 @@ struct rte_crypto_vdev_init_params {
> * @param name PMD type name
> * @param dev_private_size Size of crypto PMDs private data
> * @param socket_id Socket to allocate resources on.
> - * @param vdev Pointer to virtual device structure.
> + * @param dev Pointer to device structure.
> *
> * @return
> * - Cryptodev pointer if device is successfully created.
> * - NULL if device cannot be created.
> */
> struct rte_cryptodev *
> -rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
> - int socket_id, struct rte_vdev_device *vdev);
> +rte_cryptodev_pmd_init(const char *name, size_t dev_private_size,
> + int socket_id, struct rte_device *dev);
Hi Jan,
Even though now this function does not require the rte_vdev_device structure,
I would still call it rte_cryptodev_vdev_pmd_init, as it is used for virtual crypto
devices and not physical ones.
The rest look ok to me.
Thanks,
Pablo
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of De Lara Guarch,
> Pablo
> Sent: Wednesday, July 12, 2017 1:40 PM
> To: Jan Blunck <jblunck@infradead.org>; dev@dpdk.org
> Cc: Doherty, Declan <declan.doherty@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 2/2] cryptodev: rework cryptodev PMD init
> to not require rte_vdev.h
>
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jan Blunck
> > Sent: Wednesday, July 12, 2017 9:00 AM
> > To: dev@dpdk.org
> > Cc: Doherty, Declan <declan.doherty@intel.com>
> > Subject: [dpdk-dev] [PATCH 2/2] cryptodev: rework cryptodev PMD init
> > to not require rte_vdev.h
> >
> > This reworks the library code so that it doesn't require to include
> > rte_vdev.h. This is a preparation to move the vdev bus into a
> > standalone library.
> >
> > Signed-off-by: Jan Blunck <jblunck@infradead.org>
>
> ...
>
> > diff --git a/lib/librte_cryptodev/rte_cryptodev_vdev.h
> > b/lib/librte_cryptodev/rte_cryptodev_vdev.h
> > index 94ab9d33d..a877eed74 100644
> > --- a/lib/librte_cryptodev/rte_cryptodev_vdev.h
> > +++ b/lib/librte_cryptodev/rte_cryptodev_vdev.h
> > @@ -33,7 +33,6 @@
> > #ifndef _RTE_CRYPTODEV_VDEV_H_
> > #define _RTE_CRYPTODEV_VDEV_H_
> >
> > -#include <rte_vdev.h>
> > #include <inttypes.h>
> >
> > #include "rte_cryptodev.h"
> > @@ -72,15 +71,15 @@ struct rte_crypto_vdev_init_params {
> > * @param name PMD type name
> > * @param dev_private_size Size of crypto PMDs private data
> > * @param socket_id Socket to allocate resources on.
> > - * @param vdev Pointer to virtual device structure.
> > + * @param dev Pointer to device structure.
> > *
> > * @return
> > * - Cryptodev pointer if device is successfully created.
> > * - NULL if device cannot be created.
> > */
> > struct rte_cryptodev *
> > -rte_cryptodev_vdev_pmd_init(const char *name, size_t
> dev_private_size,
> > - int socket_id, struct rte_vdev_device *vdev);
> > +rte_cryptodev_pmd_init(const char *name, size_t dev_private_size,
> > + int socket_id, struct rte_device *dev);
>
> Hi Jan,
>
> Even though now this function does not require the rte_vdev_device
> structure, I would still call it rte_cryptodev_vdev_pmd_init, as it is used for
> virtual crypto devices and not physical ones.
>
> The rest look ok to me.
Just another note. Check-git-log.sh complains about the title:
Wrong headline format:
cryptodev: rework cryptodev PMD init to not require rte_vdev.h
Headline too long:
cryptodev: rework cryptodev PMD init to not require rte_vdev.h
So this needs some rework (e.g. no need to use cryptodev word again).
Thanks,
Pablo
>
> Thanks,
> Pablo
@@ -529,9 +529,9 @@ aesni_gcm_create(const char *name,
else
vector_mode = RTE_AESNI_GCM_SSE;
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct aesni_gcm_private), init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
GCM_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -712,9 +712,9 @@ cryptodev_aesni_mb_create(const char *name,
else
vector_mode = RTE_AESNI_MB_SSE;
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct aesni_mb_private), init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
MB_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -820,10 +820,10 @@ cryptodev_armv8_crypto_create(const char *name,
snprintf(init_params->name, sizeof(init_params->name),
"%s", name);
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct armv8_crypto_private),
init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
ARMV8_CRYPTO_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -592,9 +592,9 @@ cryptodev_kasumi_create(const char *name,
else
cpu_flags |= RTE_CRYPTODEV_FF_CPU_SSE;
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct kasumi_private), init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
KASUMI_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -198,10 +198,10 @@ cryptodev_null_create(const char *name,
snprintf(init_params->name, sizeof(init_params->name),
"%s", name);
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct null_crypto_private),
init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
NULL_CRYPTO_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -1406,10 +1406,10 @@ cryptodev_openssl_create(const char *name,
snprintf(init_params->name, sizeof(init_params->name),
"%s", name);
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct openssl_private),
init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
OPENSSL_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -112,10 +112,10 @@ cryptodev_scheduler_create(const char *name,
sizeof(init_params->def_p.name),
"%s", name);
- dev = rte_cryptodev_vdev_pmd_init(init_params->def_p.name,
+ dev = rte_cryptodev_pmd_init(init_params->def_p.name,
sizeof(struct scheduler_ctx),
init_params->def_p.socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
CS_LOG_ERR("driver %s: failed to create cryptodev vdev",
name);
@@ -575,9 +575,9 @@ cryptodev_snow3g_create(const char *name,
snprintf(init_params->name, sizeof(init_params->name),
"%s", name);
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct snow3g_private), init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
SNOW3G_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -479,9 +479,9 @@ cryptodev_zuc_create(const char *name,
snprintf(init_params->name, sizeof(init_params->name),
"%s", name);
- dev = rte_cryptodev_vdev_pmd_init(init_params->name,
+ dev = rte_cryptodev_pmd_init(init_params->name,
sizeof(struct zuc_private), init_params->socket_id,
- vdev);
+ &vdev->device);
if (dev == NULL) {
ZUC_LOG_ERR("failed to create cryptodev vdev");
goto init_error;
@@ -76,8 +76,8 @@ rte_cryptodev_vdev_parse_integer_arg(const char *key __rte_unused,
}
struct rte_cryptodev *
-rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
- int socket_id, struct rte_vdev_device *vdev)
+rte_cryptodev_pmd_init(const char *name, size_t dev_private_size,
+ int socket_id, struct rte_device *dev)
{
struct rte_cryptodev *cryptodev;
@@ -99,7 +99,7 @@ rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
" data");
}
- cryptodev->device = &vdev->device;
+ cryptodev->device = dev;
/* initialise user call-back tail queue */
TAILQ_INIT(&(cryptodev->link_intr_cbs));
@@ -33,7 +33,6 @@
#ifndef _RTE_CRYPTODEV_VDEV_H_
#define _RTE_CRYPTODEV_VDEV_H_
-#include <rte_vdev.h>
#include <inttypes.h>
#include "rte_cryptodev.h"
@@ -72,15 +71,15 @@ struct rte_crypto_vdev_init_params {
* @param name PMD type name
* @param dev_private_size Size of crypto PMDs private data
* @param socket_id Socket to allocate resources on.
- * @param vdev Pointer to virtual device structure.
+ * @param dev Pointer to device structure.
*
* @return
* - Cryptodev pointer if device is successfully created.
* - NULL if device cannot be created.
*/
struct rte_cryptodev *
-rte_cryptodev_vdev_pmd_init(const char *name, size_t dev_private_size,
- int socket_id, struct rte_vdev_device *vdev);
+rte_cryptodev_pmd_init(const char *name, size_t dev_private_size,
+ int socket_id, struct rte_device *dev);
/**
* @internal
@@ -74,7 +74,7 @@ DPDK_17.08 {
rte_cryptodev_sym_session_init;
rte_cryptodev_sym_session_clear;
rte_cryptodev_vdev_parse_init_params;
- rte_cryptodev_vdev_pmd_init;
+ rte_cryptodev_pmd_init;
rte_crypto_aead_algorithm_strings;
rte_crypto_aead_operation_strings;