From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 3/5] mempool: add walk iterator Date: Fri, 16 May 2014 14:36:44 +0200 Message-ID: <5376065C.8080005@6wind.com> References: <20140502234251.707598579@vyatta.com> <20140502234404.328560724@vyatta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit To: Stephen Hemminger , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <20140502234404.328560724-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Stephen, > +void rte_mempool_walk(void (*func)(const struct rte_mempool *, void *), > + void *arg) > +{ > + struct rte_mempool *mp = NULL; > + struct rte_mempool_list *mempool_list; > + > + if ((mempool_list = > + RTE_TAILQ_LOOKUP_BY_IDX(RTE_TAILQ_MEMPOOL, rte_mempool_list)) == NULL) { > + rte_errno = E_RTE_NO_TAILQ; > + return; > + } At the first read, I thought it was better to return -E_RTE_NO_TAILQ instead of returning void and setting rte_errno. But it seems it's the usage, for instance in rte_ring_list_dump(). Acked-by: Olivier Matz