From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 736841B4F7 for ; Thu, 12 Jul 2018 18:05:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2018 09:05:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,343,1526367600"; d="scan'208";a="245184213" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by fmsmga006.fm.intel.com with ESMTP; 12 Jul 2018 09:05:23 -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, 12 Jul 2018 17:04:53 +0100 Message-Id: <1531411499-13156-11-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1531310229-17448-1-git-send-email-fiona.trahe@intel.com> References: <1531310229-17448-1-git-send-email-fiona.trahe@intel.com> Subject: [dpdk-dev] [PATCH v6 10/16] compress/qat: add fn to return device info 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, 12 Jul 2018 16:05:36 -0000 Add capabilities pointer to internal qat comp device and function to return this and other info. C Signed-off-by: Fiona Trahe Signed-off-by: Tomasz Jozwiak --- drivers/compress/qat/qat_comp_pmd.c | 19 +++++++++++++++++++ drivers/compress/qat/qat_comp_pmd.h | 6 ++++++ 2 files changed, 25 insertions(+) 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_ */ -- 2.7.4