From mboxrd@z Thu Jan 1 00:00:00 1970 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 B95E82E81 for ; Mon, 7 May 2018 10:31:07 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 7A330980067; Mon, 7 May 2018 08:31:06 +0000 (UTC) Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Mon, 7 May 2018 09:31:01 +0100 To: Olivier Matz , CC: Anatoly Burakov References: <20180502201349.15568-1-olivier.matz@6wind.com> <20180507081801.15050-1-olivier.matz@6wind.com> From: Andrew Rybchenko Message-ID: <0797b346-61e4-53d0-691a-147d8f2be989@solarflare.com> Date: Mon, 7 May 2018 11:30:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180507081801.15050-1-olivier.matz@6wind.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Originating-IP: [84.52.114.114] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23828.003 X-TM-AS-Result: No--12.942100-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1525681867-E8hF4XmDwfz4 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: Mon, 07 May 2018 08:31:08 -0000 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