[dpdk-dev] [PATCH 1/3] net/ark: add recovery code for lack of mbufs during runtime

Ferruh Yigit ferruh.yigit at intel.com
Tue Oct 9 17:57:45 CEST 2018


On 10/8/2018 10:16 PM, Ed Czeck wrote:
> Fail with rte_exit() when the lack of mbufs is not recoverable.
> 
> Signed-off-by: Ed Czeck <ed.czeck at atomicrules.com>

<...>

> @@ -495,6 +508,33 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)
>  	return 0;
>  }
>  
> +int
> +eth_ark_rx_seed_recovery(struct ark_rx_queue *queue,
> +			 uint32_t *pnb,
> +			 struct rte_mbuf **mbufs)
> +{
> +	int status = -1;
> +
> +	/* Ignore small allocation failures */
> +	if (*pnb <= 64)
> +		return -1;
> +
> +	*pnb = 64U;
> +	status = rte_pktmbuf_alloc_bulk(queue->mb_pool, mbufs, *pnb);
> +	if (status != 0) {
> +		PMD_DRV_LOG(ERR,
> +			    "ARK: Could not allocate %u mbufs from pool for RX queue %u;"
> +			    " %u free buffers remaining in queue\n",
> +			    *pnb, queue->queue_index,
> +			    queue->seed_index - queue->cons_index);
> +		if (queue->seed_index - queue->cons_index < 64) {
> +			rte_exit(EXIT_FAILURE,
> +				 "ARK: No mbufs in pool;  do you have a leak?\n");

Hi Ed,

We are trying to get rid of rte_exit() calls, reasoning is DPDK is a library and
application should decide to exit or not, and a DPDK application may be using
multiple NICs/libraries/functionalities, failure in one of them should not cause
all application to exit.

Can you please replace rte_exit() usage?


More information about the dev mailing list