When testing dmadev drivers, it is useful to have the HW device in a known
state. This patch adds the implementation of the function which will wait
for the device to be idle (all jobs completed) before proceeding.
Signed-off-by: Kevin Laatz <[email protected]>
<snip>
+int
+idxd_vchan_status(const struct rte_dmadev *dev, uint16_t vchan __rte_unused,
+ enum rte_dmadev_vchan_status *status)
+{
+ struct idxd_dmadev *idxd = dev->dev_private;
+ uint16_t last_batch_write = idxd->batch_idx_write == 0 ?
idxd->max_batches :
+ idxd->batch_idx_write - 1;
+ uint8_t bstatus = (idxd->batch_comp_ring[last_batch_write].status != 0);
+
+ *status = bstatus ? RTE_DMA_VCHAN_IDLE : RTE_DMA_VCHAN_ACTIVE;
+
+ return 0;
+}
Should there be a comment noting that RTE_DMA_VCHAN_HALTED_ERROR does
not apply to IDXD?
Reviewed-by: Conor Walsh <[email protected]>