From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 19AD31BFD1 for ; Thu, 5 Jul 2018 18:06:01 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2018 09:06:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,313,1526367600"; d="scan'208";a="213680498" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by orsmga004.jf.intel.com with ESMTP; 05 Jul 2018 09:06:00 -0700 From: Fiona Trahe To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com, tomaszx.jozwiak@intel.com Date: Thu, 5 Jul 2018 17:05:27 +0100 Message-Id: <1530806730-11822-14-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1527100807-30814-1-git-send-email-fiona.trahe@intel.com> References: <1527100807-30814-1-git-send-email-fiona.trahe@intel.com> Subject: [dpdk-dev] [PATCH v2 13/16] compress/qat: create and populate the ops structure 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: Thu, 05 Jul 2018 16:06:02 -0000 Create an ops structure and populate it with the qat-specific finctions. Change-Id: I4fec917df598b983b889e4e07e5aa110774e446d Signed-off-by: Fiona Trahe Signed-off-by: Tomasz Jozwiak --- drivers/compress/qat/qat_comp_pmd.c | 38 ++++++++++++++++++++++++++++--------- drivers/compress/qat/qat_comp_pmd.h | 30 ----------------------------- 2 files changed, 29 insertions(+), 39 deletions(-) diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c index bf07989..41946af 100644 --- a/drivers/compress/qat/qat_comp_pmd.c +++ b/drivers/compress/qat/qat_comp_pmd.c @@ -5,7 +5,7 @@ #include "qat_comp.h" #include "qat_comp_pmd.h" -void +static void qat_comp_stats_get(struct rte_compressdev *dev, struct rte_compressdev_stats *stats) { @@ -25,7 +25,7 @@ qat_comp_stats_get(struct rte_compressdev *dev, stats->dequeue_err_count = qat_stats.dequeue_err_count; } -void +static void qat_comp_stats_reset(struct rte_compressdev *dev) { struct qat_comp_dev_private *qat_priv; @@ -40,7 +40,7 @@ qat_comp_stats_reset(struct rte_compressdev *dev) } -int +static int qat_comp_qp_release(struct rte_compressdev *dev, uint16_t queue_pair_id) { struct qat_comp_dev_private *qat_private = dev->data->dev_private; @@ -55,7 +55,7 @@ qat_comp_qp_release(struct rte_compressdev *dev, uint16_t queue_pair_id) &(dev->data->queue_pairs[queue_pair_id])); } -int +static int qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, uint32_t max_inflight_ops, int socket_id) { @@ -150,7 +150,7 @@ _qat_comp_dev_config_clear(struct qat_comp_dev_private *comp_dev) } } -int +static int qat_comp_dev_config(struct rte_compressdev *dev, struct rte_compressdev_config *config) { @@ -177,19 +177,19 @@ qat_comp_dev_config(struct rte_compressdev *dev, return ret; } -int +static int qat_comp_dev_start(struct rte_compressdev *dev __rte_unused) { return 0; } -void +static void qat_comp_dev_stop(struct rte_compressdev *dev __rte_unused) { } -int +static int qat_comp_dev_close(struct rte_compressdev *dev) { int i; @@ -208,7 +208,7 @@ qat_comp_dev_close(struct rte_compressdev *dev) } -void +static void qat_comp_dev_info_get(struct rte_compressdev *dev, struct rte_compressdev_info *info) { @@ -239,3 +239,23 @@ qat_comp_pmd_dequeue_op_burst(void *qp, struct rte_comp_op **ops, { return qat_dequeue_op_burst(qp, (void **)ops, nb_ops); } + + +struct rte_compressdev_ops compress_qat_ops = { + + /* Device related operations */ + .dev_configure = qat_comp_dev_config, + .dev_start = qat_comp_dev_start, + .dev_stop = qat_comp_dev_stop, + .dev_close = qat_comp_dev_close, + .dev_infos_get = qat_comp_dev_info_get, + + .stats_get = qat_comp_stats_get, + .stats_reset = qat_comp_stats_reset, + .queue_pair_setup = qat_comp_qp_setup, + .queue_pair_release = qat_comp_qp_release, + + /* Compression related operations */ + .private_xform_create = qat_comp_private_xform_create, + .private_xform_free = qat_comp_private_xform_free +}; diff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h index 22cbefb..7ba1b8d 100644 --- a/drivers/compress/qat/qat_comp_pmd.h +++ b/drivers/compress/qat/qat_comp_pmd.h @@ -30,30 +30,6 @@ 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); -int -qat_comp_qp_release(struct rte_compressdev *dev, uint16_t queue_pair_id); - -int -qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, - uint32_t max_inflight_ops, int socket_id); - -int -qat_comp_dev_config(struct rte_compressdev *dev, - struct rte_compressdev_config *config); - -int -qat_comp_dev_close(struct rte_compressdev *dev); - -void -qat_comp_dev_info_get(struct rte_compressdev *dev, - struct rte_compressdev_info *info); - uint16_t qat_comp_pmd_enqueue_op_burst(void *qp, struct rte_comp_op **ops, uint16_t nb_ops); @@ -62,11 +38,5 @@ uint16_t qat_comp_pmd_dequeue_op_burst(void *qp, struct rte_comp_op **ops, uint16_t nb_ops); -int -qat_comp_dev_start(struct rte_compressdev *dev __rte_unused); - -void -qat_comp_dev_stop(struct rte_compressdev *dev __rte_unused); - #endif #endif /* _QAT_COMP_PMD_H_ */ -- 2.7.4