From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH v1 3/6] mempool: support block dequeue operation Date: Wed, 25 Apr 2018 12:49:22 +0300 Message-ID: <90fcec92-bef8-5f8d-b145-41ea35e6120a@solarflare.com> References: <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> <1522080779-25472-1-git-send-email-arybchenko@solarflare.com> <1522080779-25472-4-git-send-email-arybchenko@solarflare.com> <20180419164130.ghqbhz6qvkwhnnua@platinum> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , "Artem V. Andreev" To: Olivier Matz Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 177E12583 for ; Wed, 25 Apr 2018 11:49:32 +0200 (CEST) In-Reply-To: <20180419164130.ghqbhz6qvkwhnnua@platinum> Content-Language: en-GB 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 04/19/2018 07:41 PM, Olivier Matz wrote: > On Mon, Mar 26, 2018 at 05:12:56PM +0100, Andrew Rybchenko wrote: > [...] >> @@ -1531,6 +1615,71 @@ rte_mempool_get(struct rte_mempool *mp, void **obj_p) >> } >> >> /** >> + * @internal Get contiguous blocks of objects from the pool. Used internally. >> + * @param mp >> + * A pointer to the mempool structure. >> + * @param first_obj_table >> + * A pointer to a pointer to the first object in each block. >> + * @param n >> + * A number of blocks to get. >> + * @return >> + * - >0: Success >> + * - <0: Error > I guess it is 0 here, not >0. Yes, thanks. >> + */ >> +static __rte_always_inline int >> +__mempool_generic_get_contig_blocks(struct rte_mempool *mp, >> + void **first_obj_table, unsigned int n) >> +{ >> + int ret; >> + >> + ret = rte_mempool_ops_dequeue_contig_blocks(mp, first_obj_table, n); >> + if (ret < 0) >> + __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_fail, n); >> + else >> + __MEMPOOL_CONTIG_BLOCKS_STAT_ADD(mp, get_success, n); >> + >> + return ret; >> +} >> + > Is it worth having this function? Just to follow the same code structure as usual dequeue. > I think it would be simple to include the code in > rte_mempool_get_contig_blocks() below... or am I missing something? I agree. Will do in v3. [...]