[v6,10/16] compress/qat: add fn to return device info
diff mbox series

Message ID 1531411499-13156-11-git-send-email-fiona.trahe@intel.com
State Superseded, archived
Delegated to: Pablo de Lara Guarch
Headers show
Series
  • compress/qat: add compression PMD
Related show

Checks

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

Commit Message

Trahe, Fiona July 12, 2018, 4:04 p.m. UTC
Add capabilities pointer to internal qat comp device
and function to return this and other info.

C
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 drivers/compress/qat/qat_comp_pmd.c | 19 +++++++++++++++++++
 drivers/compress/qat/qat_comp_pmd.h |  6 ++++++
 2 files changed, 25 insertions(+)

Patch
diff mbox series

diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index beab6e3..482ebd1 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -194,3 +194,22 @@  qat_comp_dev_close(struct rte_compressdev *dev)
 
 	return ret;
 }
+
+
+void
+qat_comp_dev_info_get(struct rte_compressdev *dev,
+			struct rte_compressdev_info *info)
+{
+	struct qat_comp_dev_private *comp_dev = dev->data->dev_private;
+	const struct qat_qp_hw_data *comp_hw_qps =
+		qat_gen_config[comp_dev->qat_dev->qat_dev_gen]
+			      .qp_hw_data[QAT_SERVICE_COMPRESSION];
+
+	if (info != NULL) {
+		info->max_nb_queue_pairs =
+			qat_qps_per_service(comp_hw_qps,
+					    QAT_SERVICE_COMPRESSION);
+		info->feature_flags = dev->feature_flags;
+		info->capabilities = comp_dev->qat_dev_capabilities;
+	}
+}
diff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h
index b10a66f..22576f4 100644
--- a/drivers/compress/qat/qat_comp_pmd.h
+++ b/drivers/compress/qat/qat_comp_pmd.h
@@ -21,6 +21,8 @@  struct qat_comp_dev_private {
 	/**< The qat pci device hosting the service */
 	struct rte_compressdev *compressdev;
 	/**< The pointer to this compression device structure */
+	const struct rte_compressdev_capabilities *qat_dev_capabilities;
+	/* QAT device compression capabilities */
 	const struct rte_memzone *interm_buff_mz;
 	/**< The device's memory for intermediate buffers */
 	struct rte_mempool *xformpool;
@@ -48,5 +50,9 @@  qat_comp_dev_config(struct rte_compressdev *dev,
 int
 qat_comp_dev_close(struct rte_compressdev *dev);
 
+void
+qat_comp_dev_info_get(struct rte_compressdev *dev,
+			struct rte_compressdev_info *info);
+
 #endif
 #endif /* _QAT_COMP_PMD_H_ */