diff mbox series

[v6,04/13] dma/skeleton: add burst capacity function

Message ID 20210924102942.2878051-5-bruce.richardson@intel.com (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers show
Series add test suite for DMA drivers | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Sept. 24, 2021, 10:29 a.m. UTC
Implement function to return the remaining space for operations.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/dma/skeleton/skeleton_dmadev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Conor Walsh Sept. 24, 2021, 2:51 p.m. UTC | #1
On 24/09/2021 11:29, Bruce Richardson wrote:
> Implement function to return the remaining space for operations.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

<snip>

Reviewed-by: Conor Walsh <conor.walsh@intel.com>
diff mbox series

Patch

diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index ada9a3be68..65655261e6 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -432,6 +432,15 @@  skeldma_completed_status(struct rte_dma_dev *dev,
 	return count;
 }
 
+static uint16_t
+skeldma_burst_capacity(const struct rte_dma_dev *dev, uint16_t vchan)
+{
+	struct skeldma_hw *hw = dev->dev_private;
+
+	RTE_SET_USED(vchan);
+	return rte_ring_count(hw->desc_empty);
+}
+
 static const struct rte_dma_dev_ops skeldma_ops = {
 	.dev_info_get  = skeldma_info_get,
 	.dev_configure = skeldma_configure,
@@ -467,6 +476,7 @@  skeldma_create(const char *name, struct rte_vdev_device *vdev, int lcore_id)
 	dev->submit = skeldma_submit;
 	dev->completed = skeldma_completed;
 	dev->completed_status = skeldma_completed_status;
+	dev->burst_capacity = skeldma_burst_capacity;
 	dev->dev_ops = &skeldma_ops;
 	dev->device = &vdev->device;