src/dpdk/drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c
static inline int
dma_queue_finish(struct dpi_vf_s *dpivf)
{
	uint32_t timeout = 0, sleep = 1;
	uint64_t reg = 0ULL;

	/* Wait for SADDR to become idle */
	reg = otx2_read64(dpivf->vf_bar0 + DPI_VDMA_SADDR);
	while (!(reg & BIT_ULL(DPI_VDMA_SADDR_REQ_IDLE))) {
		rte_delay_ms(sleep);
		timeout++;
		if (timeout >= DPI_QFINISH_TIMEOUT) {
			otx2_dpi_dbg("Timeout!!! Closing Forcibly");
			break;
		}
		reg = otx2_read64(dpivf->vf_bar0 + DPI_VDMA_SADDR);
	}

	if (otx2_dpi_queue_close(dpivf) < 0)
		return -EACCES;

	rte_mempool_put(dpivf->chunk_pool, dpivf->base_ptr);
	dpivf->vf_bar0 = (uintptr_t)NULL;

	return DPI_DMA_QUEUE_SUCCESS;
}
/* Free DMA Queue instruction buffers, and send close notification to PF */
Free DMA Queue instruction buffers, and send close notification to PF
Free DMA Queue instruction buffers and send close notification to PF
static inline int
dma_queue_finish(struct dpi_vf_s *dpivf)
{
	uint32_t timeout = 0, sleep = 1;
	uint64_t reg = 0ULL;
	reg = otx2_read64(dpivf->vf_bar0 + DPI_VDMA_SADDR);
	while (!(reg & BIT_ULL(DPI_VDMA_SADDR_REQ_IDLE))) {
		rte_delay_ms(sleep);
		timeout++;
		if (timeout >= DPI_QFINISH_TIMEOUT) {
			otx2_dpi_dbg("Timeout!!! Closing Forcibly");
			break;
		}
		reg = otx2_read64(dpivf->vf_bar0 + DPI_VDMA_SADDR);
	}
	if (otx2_dpi_queue_close(dpivf) < 0)
		return -EACCES;
	rte_mempool_put(dpivf->chunk_pool, dpivf->base_ptr);
	dpivf->vf_bar0 = (uintptr_t)NULL;
	return DPI_DMA_QUEUE_SUCCESS;
}
static inline int dma_queue_finish ( struct dpi_vf_s * dpivf ) { uint32_t timeout = 0 , sleep = 1 ; uint64_t reg = 0ULL ; reg = otx2_read64 ( dpivf -> vf_bar0 + DPI_VDMA_SADDR ) ; while ( ! ( reg & BIT_ULL ( DPI_VDMA_SADDR_REQ_IDLE ) ) ) { rte_delay_ms ( sleep ) ; timeout ++ ; if ( timeout >= DPI_QFINISH_TIMEOUT ) { otx2_dpi_dbg ( " " ) ; break ; } reg = otx2_read64 ( dpivf -> vf_bar0 + DPI_VDMA_SADDR ) ; } if ( otx2_dpi_queue_close ( dpivf ) < 0 ) return - EACCES ; rte_mempool_put ( dpivf -> chunk_pool , dpivf -> base_ptr ) ; dpivf -> vf_bar0 = ( uintptr_t ) NULL ; return DPI_DMA_QUEUE_SUCCESS ; }
Free DMA Queue instruction buffers, and send close notification to PF
Free DMA Queue instruction buffers and send close notification to PF
/* Wait for SADDR to become idle */