From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v3 20/35] mempool: allocate in several memory chunks by default Date: Wed, 1 Jun 2016 04:37:54 +0100 Message-ID: <574E5892.1090204@intel.com> References: <1460629199-32489-1-git-send-email-olivier.matz@6wind.com> <1463569496-31086-1-git-send-email-olivier.matz@6wind.com> <1463569496-31086-21-git-send-email-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: bruce.richardson@intel.com, stephen@networkplumber.org, keith.wiles@intel.com To: Olivier Matz , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id EC0BC47CE for ; Wed, 1 Jun 2016 05:37:57 +0200 (CEST) In-Reply-To: <1463569496-31086-21-git-send-email-olivier.matz@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/18/2016 12:04 PM, Olivier Matz wrote: > Introduce rte_mempool_populate_default() which allocates > mempool objects in several memzones. > > The mempool header is now always allocated in a specific memzone > (not with its objects). Thanks to this modification, we can remove > many specific behavior that was required when hugepages are not > enabled in case we are using rte_mempool_xmem_create(). > > This change requires to update how kni and mellanox drivers lookup for > mbuf memory. For now, this will only work if there is only one memory > chunk (like today), but we could make use of rte_mempool_mem_iter() to > support more memory chunks. > > We can also remove RTE_MEMPOOL_OBJ_NAME that is not required anymore for > the lookup, as memory chunks are referenced by the mempool. > > Note that rte_mempool_create() is still broken (it was the case before) > when there is no hugepages support (rte_mempool_create_xmem() has to be > used). This is fixed in next commit. > > Signed-off-by: Olivier Matz > --- > - if (vaddr == NULL) { > - /* calculate address of the first elt for continuous mempool. */ > - obj = (char *)mp + MEMPOOL_HEADER_SIZE(mp, cache_size) + > - private_data_size; > - obj = RTE_PTR_ALIGN_CEIL(obj, RTE_MEMPOOL_ALIGN); > - > - ret = rte_mempool_populate_phys(mp, obj, > - mp->phys_addr + ((char *)obj - (char *)mp), > - objsz.total_size * n, NULL, NULL); > - if (ret != (int)mp->size) > - goto exit_unlock; > - } else { > + if (vaddr == NULL) > + ret = rte_mempool_populate_default(mp); This breaks current ivshmem code, since now mp has multiple mz. I will send a patch for ivshmem.