DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: conor.walsh@intel.com, kevin.laatz@intel.com,
	fengchengwen@huawei.com, jerinj@marvell.com,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH v6 01/13] dmadev: add channel status check for testing use
Date: Fri, 24 Sep 2021 11:29:34 +0100	[thread overview]
Message-ID: <20210924102942.2878051-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20210924102942.2878051-1-bruce.richardson@intel.com>

Add in a function to check if a device or vchan has completed all jobs
assigned to it, without gathering in the results. This is primarily for
use in testing, to allow the hardware to be in a known-state prior to
gathering completions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
---
 lib/dmadev/rte_dmadev.c      | 15 +++++++++++++++
 lib/dmadev/rte_dmadev.h      | 34 ++++++++++++++++++++++++++++++++++
 lib/dmadev/rte_dmadev_core.h |  6 ++++++
 lib/dmadev/version.map       |  1 +
 4 files changed, 56 insertions(+)

diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c
index 544937acf8..e61116260b 100644
--- a/lib/dmadev/rte_dmadev.c
+++ b/lib/dmadev/rte_dmadev.c
@@ -716,3 +716,18 @@ rte_dma_dump(int16_t dev_id, FILE *f)
 
 	return 0;
 }
+
+int
+rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status *status)
+{
+	struct rte_dma_dev *dev = &rte_dma_devices[dev_id];
+
+	RTE_DMA_VALID_DEV_ID_OR_ERR_RET(dev_id, -EINVAL);
+	if (vchan >= dev->data->dev_conf.nb_vchans) {
+		RTE_DMA_LOG(ERR, "Device %u vchan %u out of range\n", dev_id, vchan);
+		return -EINVAL;
+	}
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->vchan_status, -ENOTSUP);
+	return (*dev->dev_ops->vchan_status)(dev, vchan, status);
+}
diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h
index be54f2cb9d..f4c6546d87 100644
--- a/lib/dmadev/rte_dmadev.h
+++ b/lib/dmadev/rte_dmadev.h
@@ -660,6 +660,40 @@ int rte_dma_stats_get(int16_t dev_id, uint16_t vchan,
 __rte_experimental
 int rte_dma_stats_reset(int16_t dev_id, uint16_t vchan);
 
+/**
+ * device vchannel status
+ *
+ * Enum with the options for the channel status, either idle, active or halted due to error
+ * @see rte_dma_vchan_status
+ */
+enum rte_dma_vchan_status {
+	RTE_DMA_VCHAN_IDLE,          /**< not processing, awaiting ops */
+	RTE_DMA_VCHAN_ACTIVE,        /**< currently processing jobs */
+	RTE_DMA_VCHAN_HALTED_ERROR,  /**< not processing due to error, cannot accept new ops */
+};
+
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice.
+ *
+ * Determine if all jobs have completed on a device channel.
+ * This function is primarily designed for testing use, as it allows a process to check if
+ * all jobs are completed, without actually gathering completions from those jobs.
+ *
+ * @param dev_id
+ *   The identifier of the device.
+ * @param vchan
+ *   The identifier of virtual DMA channel.
+ * @param[out] status
+ *   The vchan status
+ * @return
+ *   0 - call completed successfully
+ *   < 0 - error code indicating there was a problem calling the API
+ */
+__rte_experimental
+int
+rte_dma_vchan_status(int16_t dev_id, uint16_t vchan, enum rte_dma_vchan_status *status);
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice.
diff --git a/lib/dmadev/rte_dmadev_core.h b/lib/dmadev/rte_dmadev_core.h
index edb3286cbb..0eec1aa43b 100644
--- a/lib/dmadev/rte_dmadev_core.h
+++ b/lib/dmadev/rte_dmadev_core.h
@@ -46,6 +46,10 @@ typedef int (*rte_dma_vchan_setup_t)(struct rte_dma_dev *dev, uint16_t vchan,
 				const struct rte_dma_vchan_conf *conf,
 				uint32_t conf_sz);
 
+/** @internal Used to check if a virtual channel has finished all jobs. */
+typedef int (*rte_dma_vchan_status_t)(const struct rte_dma_dev *dev, uint16_t vchan,
+		enum rte_dma_vchan_status *status);
+
 /** @internal Used to retrieve basic statistics. */
 typedef int (*rte_dma_stats_get_t)(const struct rte_dma_dev *dev,
 			uint16_t vchan, struct rte_dma_stats *stats,
@@ -119,6 +123,8 @@ struct rte_dma_dev_ops {
 	rte_dma_stats_reset_t    stats_reset;
 
 	rte_dma_dump_t           dev_dump;
+	rte_dma_vchan_status_t   vchan_status;
+
 };
 
 /**
diff --git a/lib/dmadev/version.map b/lib/dmadev/version.map
index c780463bb2..40ea517016 100644
--- a/lib/dmadev/version.map
+++ b/lib/dmadev/version.map
@@ -20,6 +20,7 @@ EXPERIMENTAL {
 	rte_dma_stop;
 	rte_dma_submit;
 	rte_dma_vchan_setup;
+	rte_dma_vchan_status;
 
 	local: *;
 };
-- 
2.30.2


  reply	other threads:[~2021-09-24 10:30 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 18:32 [dpdk-dev] [RFC PATCH 0/7] add test suite for DMA drivers Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 1/7] app/test: take API tests from skeleton dmadev Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 2/7] dmadev: remove selftest support Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 3/7] app/test: add basic dmadev instance tests Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 4/7] app/test: add basic dmadev copy tests Bruce Richardson
2021-08-27  7:14   ` Jerin Jacob
2021-08-27 10:41     ` Bruce Richardson
2021-08-26 18:32 ` [dpdk-dev] [RFC PATCH 5/7] app/test: add more comprehensive " Bruce Richardson
2021-08-26 18:33 ` [dpdk-dev] [RFC PATCH 6/7] app/test: test dmadev instance failure handling Bruce Richardson
2021-08-26 18:33 ` [dpdk-dev] [RFC PATCH 7/7] app/test: add dmadev fill tests Bruce Richardson
2021-09-01 16:32 ` [dpdk-dev] [PATCH v2 0/6] add test suite for DMA drivers Bruce Richardson
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 1/6] dmadev: add device idle check for testing use Bruce Richardson
2021-09-02 12:54     ` fengchengwen
2021-09-02 14:21       ` Bruce Richardson
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 2/6] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-01 19:24     ` Mattias Rönnblom
2021-09-02 10:30       ` Bruce Richardson
2021-09-03 16:07     ` Conor Walsh
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 3/6] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-02  7:44     ` Jerin Jacob
2021-09-02  8:06       ` Bruce Richardson
2021-09-02 10:54         ` Jerin Jacob
2021-09-02 11:43           ` Bruce Richardson
2021-09-02 13:05             ` Jerin Jacob
2021-09-02 14:21               ` Bruce Richardson
2021-09-03 16:05     ` Kevin Laatz
2021-09-03 16:07     ` Conor Walsh
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 4/6] app/test: add more comprehensive " Bruce Richardson
2021-09-03 16:08     ` Conor Walsh
2021-09-03 16:11     ` Kevin Laatz
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 5/6] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-01 19:53     ` Mattias Rönnblom
2021-09-03 16:08     ` Conor Walsh
2021-09-03 16:21     ` Kevin Laatz
2021-09-01 16:32   ` [dpdk-dev] [PATCH v2 6/6] app/test: add dmadev fill tests Bruce Richardson
2021-09-03 16:09     ` Conor Walsh
2021-09-03 16:17       ` Conor Walsh
2021-09-03 16:33         ` Bruce Richardson
2021-09-07 16:49 ` [dpdk-dev] [PATCH v3 0/8] add test suite for DMA drivers Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 1/8] dmadev: add channel status check for testing use Bruce Richardson
2021-09-08 10:50     ` Walsh, Conor
2021-09-08 13:20     ` Kevin Laatz
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 2/8] dmadev: add burst capacity API Bruce Richardson
2021-09-08 10:53     ` Walsh, Conor
2021-09-08 18:17     ` Jerin Jacob
2021-09-09  8:16       ` Bruce Richardson
2021-09-17 13:54         ` Jerin Jacob
2021-09-17 14:37           ` Pai G, Sunil
2021-09-18 12:18             ` Jerin Jacob
2021-09-18  1:06           ` Hu, Jiayu
2021-09-18 12:12             ` Jerin Jacob
2021-09-21 13:57               ` Pai G, Sunil
2021-09-21 14:56                 ` Jerin Jacob
2021-09-21 15:34                   ` Pai G, Sunil
2021-09-21 16:58                     ` Jerin Jacob
2021-09-21 17:12                       ` Pai G, Sunil
2021-09-21 18:11                         ` Jerin Jacob
2021-09-22  1:51                           ` fengchengwen
2021-09-22  7:56                             ` Bruce Richardson
2021-09-22 16:35                               ` Bruce Richardson
2021-09-22 17:29                                 ` Jerin Jacob
2021-09-23 13:24                                   ` fengchengwen
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 3/8] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-08 13:21     ` Kevin Laatz
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 4/8] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 5/8] app/test: add more comprehensive " Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 6/8] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 7/8] app/test: add dmadev fill tests Bruce Richardson
2021-09-07 16:49   ` [dpdk-dev] [PATCH v3 8/8] app/test: add dmadev burst capacity API test Bruce Richardson
2021-09-08 11:03     ` Walsh, Conor
2021-09-17 13:30 ` [dpdk-dev] [PATCH v4 0/9] add test suite for DMA drivers Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 1/9] dmadev: add channel status check for testing use Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 2/9] dmadev: add burst capacity API Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 3/9] dmadev: add device iterator Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 4/9] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 5/9] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 6/9] app/test: add more comprehensive " Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 7/9] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 8/9] app/test: add dmadev fill tests Bruce Richardson
2021-09-17 13:30   ` [dpdk-dev] [PATCH v4 9/9] app/test: add dmadev burst capacity API test Bruce Richardson
2021-09-17 13:54 ` [dpdk-dev] [PATCH v5 0/9] add test suite for DMA drivers Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 1/9] dmadev: add channel status check for testing use Bruce Richardson
2021-09-22  8:25     ` fengchengwen
2021-09-22  8:31       ` Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 2/9] dmadev: add burst capacity API Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 3/9] dmadev: add device iterator Bruce Richardson
2021-09-22  8:46     ` fengchengwen
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 4/9] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 5/9] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 6/9] app/test: add more comprehensive " Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 7/9] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 8/9] app/test: add dmadev fill tests Bruce Richardson
2021-09-17 13:54   ` [dpdk-dev] [PATCH v5 9/9] app/test: add dmadev burst capacity API test Bruce Richardson
2021-09-24 10:29 ` [dpdk-dev] [PATCH v6 00/13] add test suite for DMA drivers Bruce Richardson
2021-09-24 10:29   ` Bruce Richardson [this message]
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 02/13] dma/skeleton: add channel status function Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 03/13] dmadev: add burst capacity API Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 04/13] dma/skeleton: add burst capacity function Bruce Richardson
2021-09-24 14:51     ` Conor Walsh
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 05/13] dmadev: add device iterator Bruce Richardson
2021-09-24 14:52     ` Conor Walsh
2021-09-24 15:58     ` Kevin Laatz
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 06/13] app/test: add basic dmadev instance tests Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 07/13] app/test: add basic dmadev copy tests Bruce Richardson
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 08/13] app/test: run test suite on skeleton driver Bruce Richardson
2021-09-24 15:58     ` Kevin Laatz
2021-09-24 10:29   ` [dpdk-dev] [PATCH v6 09/13] app/test: add more comprehensive dmadev copy tests Bruce Richardson
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 10/13] dmadev: add flag for error handling support Bruce Richardson
2021-09-24 14:52     ` Conor Walsh
2021-09-24 15:58     ` Kevin Laatz
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 11/13] app/test: test dmadev instance failure handling Bruce Richardson
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 12/13] app/test: add dmadev fill tests Bruce Richardson
2021-09-24 10:31   ` [dpdk-dev] [PATCH v6 13/13] app/test: add dmadev burst capacity API test Bruce Richardson
2021-10-13 15:17   ` [dpdk-dev] [PATCH v7 00/13] add test suite for DMA drivers Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 01/13] dmadev: add channel status check for testing use Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 02/13] dma/skeleton: add channel status function Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 03/13] dmadev: add burst capacity API Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 04/13] dma/skeleton: add burst capacity function Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 05/13] dmadev: add device iterator Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 06/13] app/test: add basic dmadev instance tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 07/13] app/test: add basic dmadev copy tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 08/13] app/test: run test suite on skeleton driver Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 09/13] app/test: add more comprehensive dmadev copy tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 10/13] dmadev: add flag for error handling support Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 11/13] app/test: test dmadev instance failure handling Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 12/13] app/test: add dmadev fill tests Bruce Richardson
2021-10-13 15:17     ` [dpdk-dev] [PATCH v7 13/13] app/test: add dmadev burst capacity API test Bruce Richardson
2021-10-18  9:20     ` [dpdk-dev] [PATCH v7 00/13] add test suite for DMA drivers Thomas Monjalon
2021-10-21 12:06       ` fengchengwen
2021-10-21 14:55         ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210924102942.2878051-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=conor.walsh@intel.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=jerinj@marvell.com \
    --cc=kevin.laatz@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).