From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0B14921756; Tue, 8 May 2018 09:59:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 08 May 2018 09:59:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=PjXMEMQFITQkySb3F647sXCXye GG17bXwTtzc3eT0d4=; b=ZJ6bpnJ1LS3KYzHcqtJEFLmFYDOnN+krG4iH5Gz5rH xdM/VOajhtpXJo1IuE0eB/yW58blRXiugs8Hy6KlcvDMz2e9hl00cFSRPgF5mM6C /2Ds8fIuKzbnNU4t+l/O7YyiPLrSZrsbdYjR+Gu/m6ZGcMsd/SKqARA9hvp96rjI 8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=PjXMEM QFITQkySb3F647sXCXyeGG17bXwTtzc3eT0d4=; b=N4fbwvkQCdULJfhf+Tgt3F OolfEix6+LIC8Ll3A34fHAkKJoVkyEhRqzBPIJeEKZHcWY3jRiMLVME/OvLz2/iC 2H11GQ9+BDB+En30gx0Owag8PZZa2CMDeduTyixWN2QE7Jgj4laHMVkYLg0jwJu2 5O989GDAr+MrnpIxq0843LdhVZbsiDEvtEV+FXTq7GLNB0Qp7mW16i+kQGIZOAQ/ CWHgRGfSRIW6isQqYpopwh3zoA6nsBN41TiFmS3D5tVqDqFNhu/iRjW6I+J3AdFD OmKSwmgbW05oxAfk5jCdObwRFSBuyKu0uW6tSo2Tt6khadglak4N+qlOEOnI4ssQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 42C44E4EEF; Tue, 8 May 2018 09:59:42 -0400 (EDT) From: Thomas Monjalon To: Olivier Matz Cc: dev@dpdk.org, Andrew Rybchenko , Anatoly Burakov Date: Tue, 08 May 2018 15:59:41 +0200 Message-ID: <14277227.BBJkrYStU1@xps> In-Reply-To: <0797b346-61e4-53d0-691a-147d8f2be989@solarflare.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] mempool: fix alignment of memzone length when populating X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2018 13:59:45 -0000 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