summaryrefslogtreecommitdiff
path: root/drivers/compress
diff options
context:
space:
mode:
authorFiona Trahe <fiona.trahe@intel.com>2018-07-13 03:28:16 +0100
committerPablo de Lara <pablo.de.lara.guarch@intel.com>2018-07-24 01:48:10 +0200
commit72385564e9e601e83903441c6d8d5df296e556f2 (patch)
tree8c5e1d251491fca14d6f5d94c584efcc264f62db /drivers/compress
parent3cc14fc48e3509dd190f961387a466370447228c (diff)
downloaddpdk-next-eventdev-72385564e9e601e83903441c6d8d5df296e556f2.zip
dpdk-next-eventdev-72385564e9e601e83903441c6d8d5df296e556f2.tar.gz
dpdk-next-eventdev-72385564e9e601e83903441c6d8d5df296e556f2.tar.xz
compress/qat: add stats functions
Add functions to get and clear compression queue-pair statistics. Signed-off-by: Fiona Trahe <fiona.trahe@intel.com> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Diffstat (limited to 'drivers/compress')
-rw-r--r--drivers/compress/qat/qat_comp_pmd.c35
-rw-r--r--drivers/compress/qat/qat_comp_pmd.h7
2 files changed, 42 insertions, 0 deletions
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index fb035d1..6feffb7 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -3,3 +3,38 @@
*/
#include "qat_comp_pmd.h"
+
+void
+qat_comp_stats_get(struct rte_compressdev *dev,
+ struct rte_compressdev_stats *stats)
+{
+ struct qat_common_stats qat_stats = {0};
+ struct qat_comp_dev_private *qat_priv;
+
+ if (stats == NULL || dev == NULL) {
+ QAT_LOG(ERR, "invalid ptr: stats %p, dev %p", stats, dev);
+ return;
+ }
+ qat_priv = dev->data->dev_private;
+
+ qat_stats_get(qat_priv->qat_dev, &qat_stats, QAT_SERVICE_COMPRESSION);
+ stats->enqueued_count = qat_stats.enqueued_count;
+ stats->dequeued_count = qat_stats.dequeued_count;
+ stats->enqueue_err_count = qat_stats.enqueue_err_count;
+ stats->dequeue_err_count = qat_stats.dequeue_err_count;
+}
+
+void
+qat_comp_stats_reset(struct rte_compressdev *dev)
+{
+ struct qat_comp_dev_private *qat_priv;
+
+ if (dev == NULL) {
+ QAT_LOG(ERR, "invalid compressdev ptr %p", dev);
+ return;
+ }
+ qat_priv = dev->data->dev_private;
+
+ qat_stats_reset(qat_priv->qat_dev, QAT_SERVICE_COMPRESSION);
+
+}
diff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h
index cd04f11..27d84c8 100644
--- a/drivers/compress/qat/qat_comp_pmd.h
+++ b/drivers/compress/qat/qat_comp_pmd.h
@@ -28,5 +28,12 @@ struct qat_comp_dev_private {
};
+void
+qat_comp_stats_reset(struct rte_compressdev *dev);
+
+void
+qat_comp_stats_get(struct rte_compressdev *dev,
+ struct rte_compressdev_stats *stats);
+
#endif
#endif /* _QAT_COMP_PMD_H_ */