From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: Looks like rte_mempool_free_count() and rte_mempool_count() are swapped Date: Thu, 2 Jan 2014 14:32:22 +0100 Message-ID: <201401021432.22215.thomas.monjalon@6wind.com> References: <523172C3.2040309@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Dmitry Vyal Return-path: In-Reply-To: <523172C3.2040309-Re5JQEeQqe8AvxtiuMwx3w@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" 12/09/2013 09:52, Dmitry Vyal : > If I understand it correctly, the ring contains free buffers and > rte_ring_count() returns a number of entries inside a ring. So this > function actually calculates the number of free entries, not busy. Yes, you're right. mempool's objects are free mbufs. So mempool_count is the number of free mbufs, and mempool_free_count is the number of free slots to store more free mbufs. I agree that the naming is confusing but I'm not sure we should change it. -- Thomas