[dpdk-dev] [PATCH v2 3/6] app/test: add basic dmadev copy tests

Conor Walsh conor.walsh at intel.com
Fri Sep 3 18:07:41 CEST 2021


> For each dmadev instance, perform some basic copy tests to validate that
> functionality.
>
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
> ---
<snip>
> +static inline void
> +await_hw(int dev_id, uint16_t vchan)
> +{
> +	int idle = rte_dmadev_vchan_idle(dev_id, vchan);
> +	if (idle < 0) {
> +		/* for drivers that don't support this op, just sleep for 25 microseconds */
> +		usleep(25);
> +		return;
> +	}
> +
> +	/* for those that do, *max* end time is one second from now, but all should be faster */
> +	const uint64_t end_cycles = rte_get_timer_cycles() + rte_get_timer_hz();
> +	while (!idle && rte_get_timer_cycles() < end_cycles) {
> +		rte_pause();
> +		idle = rte_dmadev_vchan_idle(dev_id, vchan);
> +	}
> +}

The new DMA IOAT driver works fine with this function and will not be 
affected by an increase in timeout time as suggested by Jerin.

Reviewed-by: Conor Walsh <conor.walsh at intel.com>



More information about the dev mailing list