From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 3976323D for ; Wed, 11 Apr 2018 17:03:35 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2018 08:03:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,436,1517904000"; d="scan'208";a="33496880" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.9.73]) ([10.252.9.73]) by orsmga006.jf.intel.com with ESMTP; 11 Apr 2018 08:03:29 -0700 To: Andrew Rybchenko , dev@dpdk.org Cc: Olivier Matz , keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com, benjamin.walker@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, konstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, gowrishankar.m@linux.vnet.ibm.com References: <17e7d16a54e2d3383a3857733589b91e2c691f66.1523448978.git.anatoly.burakov@intel.com> From: "Burakov, Anatoly" Message-ID: <9f1a4933-8544-af13-6b6a-3fceb5b3a41e@intel.com> Date: Wed, 11 Apr 2018 16:03:28 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 24/70] mempool: add support for the new allocation methods 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: Wed, 11 Apr 2018 15:03:35 -0000 On 11-Apr-18 3:43 PM, Andrew Rybchenko wrote: > On 04/11/2018 03:29 PM, Anatoly Burakov wrote: >> If a user has specified that the zone should have contiguous memory, >> use the new _contig allocation API's instead of normal ones. > > Just one minor nit.. > As I understand _contig above is an artefact of the previous approach > with dedicated function for contiguous allocation. If so, description > should be updated to avoid confusion. > >> Otherwise, account for the fact that unless we're in IOVA_AS_VA >> mode, we cannot guarantee that the pages would be physically >> contiguous, so we calculate the memzone size and alignments as if >> we were getting the smallest page size available. >> >> However, for the non-IOVA contiguous case, existing mempool size >> calculation function doesn't give us expected results, because it >> will return memzone sizes aligned to page size (e.g. a 1MB mempool >> may use an entire 1GB page), therefore in cases where we weren't >> specifically asked to reserve non-contiguous memory, first try >> reserving a memzone as IOVA-contiguous, and if that fails, then >> try reserving with page-aligned size/alignment. >> >> Signed-off-by: Anatoly Burakov >> Tested-by: Santosh Shukla >> Tested-by: Hemant Agrawal >> Tested-by: Gowrishankar Muthukrishnan >> --- >> lib/librte_mempool/rte_mempool.c | 148 +++++++++++++++++++++++++++++++++------ >> 1 file changed, 127 insertions(+), 21 deletions(-) OK. Thomas, please change text to the following on apply: If a user has specified that the zone should have contiguous memory, add a memzone flag to request contiguous memory. Otherwise, account for the fact that unless we're in IOVA_AS_VA mode, we cannot guarantee that the pages would be physically contiguous, so we calculate the memzone size and alignments as if we were getting the smallest page size available. However, for the non-IOVA contiguous case, existing mempool size calculation function doesn't give us expected results, because it will return memzone sizes aligned to page size (e.g. a 1MB mempool may use an entire 1GB page), therefore in cases where we weren't specifically asked to reserve non-contiguous memory, first try reserving a memzone as IOVA-contiguous, and if that fails, then try reserving with page-aligned size/alignment. -- Thanks, Anatoly