From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 31 May 2016 20:37:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,399,1459839600"; d="scan'208";a="818929061" Received: from unknown (HELO [10.252.27.117]) ([10.252.27.117]) by orsmga003.jf.intel.com with ESMTP; 31 May 2016 20:37:55 -0700 To: Olivier Matz , dev@dpdk.org 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> Cc: bruce.richardson@intel.com, stephen@networkplumber.org, keith.wiles@intel.com From: Ferruh Yigit Message-ID: <574E5892.1090204@intel.com> Date: Wed, 1 Jun 2016 04:37:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1463569496-31086-21-git-send-email-olivier.matz@6wind.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 20/35] mempool: allocate in several memory chunks by default X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 03:37:58 -0000 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.