From: Ferruh Yigit Subject: Re: [PATCH 1/3] net/ark: add recovery code for lack of mbufs during runtime Date: Tue, 9 Oct 2018 16:57:45 +0100 Message-ID: References: <1539033410-21422-1-git-send-email-ed.czeck@atomicrules.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: john.miller@atomicrules.com, shepard.siegel@atomicrules.com To: Ed Czeck , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D7C3B1B59C for ; Tue, 9 Oct 2018 17:57:47 +0200 (CEST) In-Reply-To: <1539033410-21422-1-git-send-email-ed.czeck@atomicrules.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 <...> > @@ -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?