[dpdk-dev] [PATCH v6 10/12] dma/ioat: add burst capacity function
Conor Walsh
conor.walsh at intel.com
Mon Sep 27 12:21:55 CEST 2021
Adds the ability to find the remaining space in the IOAT ring.
Signed-off-by: Conor Walsh <conor.walsh at intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/dma/ioat/ioat_dmadev.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c
index fe01a3b1db..6c783ec94f 100644
--- a/drivers/dma/ioat/ioat_dmadev.c
+++ b/drivers/dma/ioat/ioat_dmadev.c
@@ -509,6 +509,19 @@ ioat_completed_status(struct rte_dma_dev *dev, uint16_t qid __rte_unused,
return count;
}
+/* Get the remaining capacity of the ring. */
+static uint16_t
+ioat_burst_capacity(const struct rte_dma_dev *dev, uint16_t vchan __rte_unused)
+{
+ struct ioat_dmadev *ioat = dev->data->dev_private;
+ unsigned short size = ioat->qcfg.nb_desc - 1;
+ unsigned short read = ioat->next_read;
+ unsigned short write = ioat->next_write;
+ unsigned short space = size - (write - read);
+
+ return space;
+}
+
/* Retrieve the generic stats of a DMA device. */
static int
ioat_stats_get(const struct rte_dma_dev *dev, uint16_t vchan __rte_unused,
@@ -594,6 +607,7 @@ ioat_dmadev_create(const char *name, struct rte_pci_device *dev)
dmadev->dev_ops = &ioat_dmadev_ops;
+ dmadev->burst_capacity = ioat_burst_capacity;
dmadev->completed = ioat_completed;
dmadev->completed_status = ioat_completed_status;
dmadev->copy = ioat_enqueue_copy;
--
2.25.1
More information about the dev
mailing list