From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id A0A492C8 for ; Tue, 20 Jun 2017 16:34:13 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 20 Jun 2017 07:34:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,364,1493708400"; d="scan'208";a="983073701" Received: from dwdohert-mobl1.ger.corp.intel.com (HELO [163.33.228.228]) ([163.33.228.228]) by orsmga003.jf.intel.com with ESMTP; 20 Jun 2017 07:34:11 -0700 To: Pablo de Lara , thomas@monjalon.net References: <1495639634-74846-1-git-send-email-pablo.de.lara.guarch@intel.com> <1495639634-74846-2-git-send-email-pablo.de.lara.guarch@intel.com> Cc: dev@dpdk.org From: Declan Doherty Message-ID: <02967bef-5a48-adbb-1f54-a1bc9afb0c7d@intel.com> Date: Tue, 20 Jun 2017 15:34:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1495639634-74846-2-git-send-email-pablo.de.lara.guarch@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 01/12] cryptodev: store device pointer in virtual devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 14:34:14 -0000 On 24/05/2017 4:27 PM, Pablo de Lara wrote: > Only non virtual devices were storing the pointer to > rte_device structure in rte_cryptodev, which will be needed > to retrieve the driver name for any device. > > Signed-off-by: Pablo de Lara > --- ... > diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > index 45b25c9..49d3f32 100644 > --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c > @@ -699,12 +699,14 @@ cryptodev_aesni_mb_create(const char *name, > } > > dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name, > - sizeof(struct aesni_mb_private), init_params->socket_id); > + sizeof(struct aesni_mb_private), init_params->socket_id, > + vdev); > if (dev == NULL) { > MB_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > } > > + dev->device = &vdev->device; This is set in the rte_cryptodev_pmd_virtual_dev_init now so it isn't needed here. > dev->dev_type = RTE_CRYPTODEV_AESNI_MB_PMD; > dev->dev_ops = rte_aesni_mb_pmd_ops; > > diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c > index 3d603a5..29905d6 100644 > --- a/drivers/crypto/armv8/rte_armv8_pmd.c > +++ b/drivers/crypto/armv8/rte_armv8_pmd.c > @@ -808,7 +808,8 @@ cryptodev_armv8_crypto_create(const char *name, > > dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name, > sizeof(struct armv8_crypto_private), > - init_params->socket_id); > + init_params->socket_id, > + vdev); > if (dev == NULL) { > ARMV8_CRYPTO_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c b/drivers/crypto/kasumi/rte_kasumi_pmd.c > index 9da9e89..a95f503 100644 > --- a/drivers/crypto/kasumi/rte_kasumi_pmd.c > +++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c > @@ -574,7 +574,8 @@ cryptodev_kasumi_create(const char *name, > } > > dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name, > - sizeof(struct kasumi_private), init_params->socket_id); > + sizeof(struct kasumi_private), init_params->socket_id, > + vdev); > if (dev == NULL) { > KASUMI_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c > index 023450a..8124eba 100644 > --- a/drivers/crypto/null/null_crypto_pmd.c > +++ b/drivers/crypto/null/null_crypto_pmd.c > @@ -166,6 +166,7 @@ static int cryptodev_null_remove(const char *name); > /** Create crypto device */ > static int > cryptodev_null_create(const char *name, > + struct rte_vdev_device *vdev, > struct rte_crypto_vdev_init_params *init_params) > { > struct rte_cryptodev *dev; > @@ -177,12 +178,14 @@ cryptodev_null_create(const char *name, > > dev = rte_cryptodev_pmd_virtual_dev_init(init_params->name, > sizeof(struct null_crypto_private), > - init_params->socket_id); > + init_params->socket_id, > + vdev); > if (dev == NULL) { > NULL_CRYPTO_LOG_ERR("failed to create cryptodev vdev"); > goto init_error; > } > > + dev->device = &vdev->device; Same as above. > dev->dev_type = RTE_CRYPTODEV_NULL_PMD; > dev->dev_ops = null_crypto_pmd_ops; > > @@ -235,7 +238,7 @@ cryptodev_null_probe(struct rte_vdev_device *dev) > RTE_LOG(INFO, PMD, " Max number of sessions = %d\n", > init_params.max_nb_sessions); > > - return cryptodev_null_create(name, &init_params); > + return cryptodev_null_create(name, dev, &init_params); > } > > /** Uninitialise null crypto device */ .. > Acked-by: Declan Doherty