From: Conor Walsh Date: Mon, 18 Oct 2021 12:38:33 +0000 (+0000) Subject: dma/ioat: add burst capacity X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=96d783339330ec090f7f9ca8e3773677aaad7b1d;p=dpdk.git dma/ioat: add burst capacity Adds the ability to find the remaining space in the IOAT ring. Signed-off-by: Conor Walsh Signed-off-by: Kevin Laatz Acked-by: Bruce Richardson --- diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c index 3d4d7b66e2..a230496b11 100644 --- a/drivers/dma/ioat/ioat_dmadev.c +++ b/drivers/dma/ioat/ioat_dmadev.c @@ -516,6 +516,19 @@ ioat_completed_status(void *dev_private, uint16_t qid __rte_unused, return count; } +/* Get the remaining capacity of the ring. */ +static uint16_t +ioat_burst_capacity(const void *dev_private, uint16_t vchan __rte_unused) +{ + const struct ioat_dmadev *ioat = 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, @@ -601,6 +614,7 @@ ioat_dmadev_create(const char *name, struct rte_pci_device *dev) dmadev->dev_ops = &ioat_dmadev_ops; + dmadev->fp_obj->burst_capacity = ioat_burst_capacity; dmadev->fp_obj->completed = ioat_completed; dmadev->fp_obj->completed_status = ioat_completed_status; dmadev->fp_obj->copy = ioat_enqueue_copy;