From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] mempool: fix alignment of memzone length when populating Date: Tue, 08 May 2018 15:59:41 +0200 Message-ID: <14277227.BBJkrYStU1@xps> References: <20180502201349.15568-1-olivier.matz@6wind.com> <20180507081801.15050-1-olivier.matz@6wind.com> <0797b346-61e4-53d0-691a-147d8f2be989@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Andrew Rybchenko , Anatoly Burakov To: Olivier Matz Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 9056B8D90 for ; Tue, 8 May 2018 15:59:45 +0200 (CEST) In-Reply-To: <0797b346-61e4-53d0-691a-147d8f2be989@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 07/05/2018 10:30, Andrew Rybchenko: > On 05/07/2018 11:18 AM, Olivier Matz wrote: > > When populating a mempool with the default function, if there is not > > enough virtually contiguous memory for the whole mempool, it will be > > populated with several chunks. A chunk of the maximum available length > > is requested with: > > > > mz = rte_memzone_reserve_aligned(..., len=0, ..., align=x) > > > > If align is smaller than the page size, the address and the length of > > the memzone may not be a multiple of the page size. This makes > > rte_mempool_populate_virt() to fail because it requires them to be > > page-aligned. This patch fixes that. > > > > The problem can be reproduced easily by allocating more than available > > memory: > > ./build/app/testpmd -l 0,1 -- --total-num-mbufs=65536 > > ... > > Cause: Creation of mbuf pool for socket 0 failed: Invalid argument > > > > After the patch, the error code is correct: > > ./build/app/testpmd -l 0,1 -- --total-num-mbufs=65536 > > ... > > Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate memory > > > > Signed-off-by: Olivier Matz > > Fixes: ba0009560c30 ("mempool: support new allocation methods") > > Acked-by: Anatoly Burakov > Reviewed-by: Andrew Rybchenko Applied, thanks