From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B30BAA04AF; Fri, 21 Aug 2020 18:32:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 789041C192; Fri, 21 Aug 2020 18:30:43 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id CF41C2C02 for ; Fri, 21 Aug 2020 18:30:41 +0200 (CEST) IronPort-SDR: 2DHnRgrmJnUD3ZZ1Q1H9f90fLKM5Mmnkk2Ny1JrzNdCob3fAudco8j+IZSTciL6tfnInrgEbPj +0MO9F76KR2w== X-IronPort-AV: E=McAfee;i="6000,8403,9719"; a="173615926" X-IronPort-AV: E=Sophos;i="5.76,337,1592895600"; d="scan'208";a="173615926" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2020 09:30:41 -0700 IronPort-SDR: PG7lW00W2jN5VBBgF/WI5vw8w5nAqDGd/xW/EiKThgi9oK4iOcrEEKXrLvwBrzGwDHfbKfHxf9 5e4Uks3SLLag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,337,1592895600"; d="scan'208";a="297992945" Received: from silpixa00399126.ir.intel.com ([10.237.222.56]) by orsmga006.jf.intel.com with ESMTP; 21 Aug 2020 09:30:39 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: cheng1.jiang@intel.com, patrick.fu@intel.com, ping.yu@intel.com, kevin.laatz@intel.com, Bruce Richardson Date: Fri, 21 Aug 2020 17:29:40 +0100 Message-Id: <20200821162944.29840-15-bruce.richardson@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200821162944.29840-1-bruce.richardson@intel.com> References: <20200721095140.719297-1-bruce.richardson@intel.com> <20200821162944.29840-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 14/18] raw/ioat: add info function for idxd devices 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the info get function for DSA devices, returning just the ring size info about the device, same as is returned for existing IOAT/CBDMA devices. Signed-off-by: Bruce Richardson --- drivers/raw/ioat/idxd_pci.c | 1 + drivers/raw/ioat/idxd_vdev.c | 1 + drivers/raw/ioat/ioat_common.c | 18 ++++++++++++++++++ drivers/raw/ioat/ioat_private.h | 3 +++ 4 files changed, 23 insertions(+) diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c index 13a0a03211..1ae20bc04f 100644 --- a/drivers/raw/ioat/idxd_pci.c +++ b/drivers/raw/ioat/idxd_pci.c @@ -105,6 +105,7 @@ static const struct rte_rawdev_ops idxd_pci_ops = { .dev_configure = idxd_dev_configure, .dev_start = idxd_pci_dev_start, .dev_stop = idxd_pci_dev_stop, + .dev_info_get = idxd_dev_info_get, }; /* each portal uses 4 x 4k pages */ diff --git a/drivers/raw/ioat/idxd_vdev.c b/drivers/raw/ioat/idxd_vdev.c index 73cb5d938f..3d6aa31f48 100644 --- a/drivers/raw/ioat/idxd_vdev.c +++ b/drivers/raw/ioat/idxd_vdev.c @@ -34,6 +34,7 @@ static const struct rte_rawdev_ops idxd_vdev_ops = { .dev_selftest = idxd_rawdev_test, .dump = idxd_dev_dump, .dev_configure = idxd_dev_configure, + .dev_info_get = idxd_dev_info_get, }; static void * diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c index 23a9d71dd3..4c225762bd 100644 --- a/drivers/raw/ioat/ioat_common.c +++ b/drivers/raw/ioat/ioat_common.c @@ -37,6 +37,24 @@ idxd_dev_dump(struct rte_rawdev *dev, FILE *f) return 0; } +int +idxd_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info, + size_t info_size) +{ + struct rte_ioat_rawdev_config *cfg = dev_info; + struct idxd_rawdev *idxd = dev->dev_private; + struct rte_idxd_rawdev *rte_idxd = &idxd->public; + + if (info_size != sizeof(*cfg)) + return -EINVAL; + + if (cfg != NULL) { + cfg->ring_size = rte_idxd->hdl_ring_sz; + cfg->hdls_disable = rte_idxd->hdls_disable; + } + return 0; +} + int idxd_dev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config, size_t config_size) diff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h index 928c9b497c..0b17a8646b 100644 --- a/drivers/raw/ioat/ioat_private.h +++ b/drivers/raw/ioat/ioat_private.h @@ -60,6 +60,9 @@ extern int idxd_rawdev_create(const char *name, struct rte_device *dev, extern int idxd_dev_configure(const struct rte_rawdev *dev, rte_rawdev_obj_t config, size_t config_size); +extern int idxd_dev_info_get(struct rte_rawdev *dev, rte_rawdev_obj_t dev_info, + size_t info_size); + extern int idxd_rawdev_test(uint16_t dev_id); extern int idxd_dev_dump(struct rte_rawdev *dev, FILE *f); -- 2.25.1