[dpdk-dev,05/12] cryptodev: only set PCI info when device is PCI

Message ID 1495639634-74846-6-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

De Lara Guarch, Pablo May 24, 2017, 3:27 p.m. UTC
  Do not set PCI information in the device information structure
for any crypto device, just for the ones that are PCI, so
this is set internally in the PCI crypto PMDs (only QAT now).

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 drivers/crypto/qat/qat_crypto.c      | 5 +++--
 lib/librte_cryptodev/rte_cryptodev.c | 1 -
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Doherty, Declan June 20, 2017, 2:36 p.m. UTC | #1
On 24/05/2017 4:27 PM, Pablo de Lara wrote:
> Do not set PCI information in the device information structure
> for any crypto device, just for the ones that are PCI, so
> this is set internally in the PCI crypto PMDs (only QAT now).
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> ---
...
>

Acked-by: Declan Doherty <declan.doherty@intel.com>
  

Patch

diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index 386aa45..c3dbd6c 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1240,8 +1240,8 @@  int qat_dev_close(struct rte_cryptodev *dev)
 	return 0;
 }
 
-void qat_dev_info_get(__rte_unused struct rte_cryptodev *dev,
-				struct rte_cryptodev_info *info)
+void qat_dev_info_get(struct rte_cryptodev *dev,
+			struct rte_cryptodev_info *info)
 {
 	struct qat_pmd_private *internals = dev->data->dev_private;
 
@@ -1254,6 +1254,7 @@  void qat_dev_info_get(__rte_unused struct rte_cryptodev *dev,
 		info->capabilities = internals->qat_dev_capabilities;
 		info->sym.max_nb_sessions = internals->max_nb_sessions;
 		info->dev_type = RTE_CRYPTODEV_QAT_SYM_PMD;
+		info->pci_dev = RTE_DEV_TO_PCI(dev->device);
 	}
 }
 
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 53534ac..85e4936 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1160,7 +1160,6 @@  rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
 	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
 
-	dev_info->pci_dev = RTE_DEV_TO_PCI(dev->device);
 	dev_info->driver_name = dev->device->driver->name;
 }