src/dpdk/lib/librte_distributor/rte_distributor.c
int
rte_distributor_flush(struct rte_distributor *d)
{
	unsigned int flushed;
	unsigned int wkr;

	if (d->alg_type == RTE_DIST_ALG_SINGLE) {
		/* Call the old API */
		return rte_distributor_flush_single(d->d_single);
	}

	flushed = total_outstanding(d);

	while (total_outstanding(d) > 0)
		rte_distributor_process(d, NULL, 0);

	/* wait 10ms to allow all worker drain the pkts */
	rte_delay_us(10000);

	/*
	 * Send empty burst to all workers to allow them to exit
	 * gracefully, should they need to.
	 */
	rte_distributor_process(d, NULL, 0);

	for (wkr = 0; wkr < d->num_workers; wkr++)
		handle_returns(d, wkr);

	return flushed;
}
/*
 * Flush the distributor, so that there are no outstanding packets in flight or
 * queued up.
 */
Flush the distributor, so that there are no outstanding packets in flight or
queued up.
Flush the distributor so that there are no outstanding packets in flight or queued up .
int
rte_distributor_flush(struct rte_distributor *d)
{
	unsigned int flushed;
	unsigned int wkr;
	if (d->alg_type == RTE_DIST_ALG_SINGLE) {
		return rte_distributor_flush_single(d->d_single);
	}
	flushed = total_outstanding(d);
	while (total_outstanding(d) > 0)
		rte_distributor_process(d, NULL, 0);
	rte_delay_us(10000);
	rte_distributor_process(d, NULL, 0);
	for (wkr = 0; wkr < d->num_workers; wkr++)
		handle_returns(d, wkr);
	return flushed;
}
int rte_distributor_flush ( struct rte_distributor * d ) { unsigned int flushed ; unsigned int wkr ; if ( d -> alg_type == RTE_DIST_ALG_SINGLE ) { return rte_distributor_flush_single ( d -> d_single ) ; } flushed = total_outstanding ( d ) ; while ( total_outstanding ( d ) > 0 ) rte_distributor_process ( d , NULL , 0 ) ; rte_delay_us ( 10000 ) ; rte_distributor_process ( d , NULL , 0 ) ; for ( wkr = 0 ; wkr < d -> num_workers ; wkr ++ ) handle_returns ( d , wkr ) ; return flushed ; }
Flush the distributor, so that there are no outstanding packets in flight or
 queued up.
Flush the distributor so that there are no outstanding packets in flight or queued up .
/* Call the old API */ /* wait 10ms to allow all worker drain the pkts */ /*
	 * Send empty burst to all workers to allow them to exit
	 * gracefully, should they need to.
	 */