From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30B76A00BE; Thu, 28 May 2020 14:19:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F7791DA7B; Thu, 28 May 2020 14:19:06 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C16D31DA0C for ; Thu, 28 May 2020 14:19:05 +0200 (CEST) IronPort-SDR: vwKDwRbbcJbvyDbmDdv+rkCaqXCL/eRMVzSA+cS459u7ZeSj0fkj0MHUKF7AU9ha7mBElc0EJT sbzCVd9gK3eQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 05:19:04 -0700 IronPort-SDR: llGKaKk/usDYoEtgw7HX493uLrzbd1uUDJ9nh8RHSbTI8hJfP6xIj1+re+DbQr66wu8aN+Dl9X hwfNBUjk2ujQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,444,1583222400"; d="scan'208";a="376352194" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.45.206]) ([10.252.45.206]) by fmsmga001.fm.intel.com with ESMTP; 28 May 2020 05:19:02 -0700 To: Dmitry Kozlyuk , dev@dpdk.org Cc: Dmitry Malloy , Narcisa Ana Maria Vasile , Fady Bader , Tal Shnaiderman , Bruce Richardson References: <20200428235015.2820677-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-1-dmitry.kozliuk@gmail.com> <20200525003720.6410-5-dmitry.kozliuk@gmail.com> From: "Burakov, Anatoly" Message-ID: Date: Thu, 28 May 2020 13:19:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200525003720.6410-5-dmitry.kozliuk@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 04/11] eal/mem: extract common code for memseg list initialization 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 25-May-20 1:37 AM, Dmitry Kozlyuk wrote: > All supported OS create memory segment lists (MSL) and reserve VA space > for them in a nearly identical way. Move common code into EAL private > functions to reduce duplication. > > Signed-off-by: Dmitry Kozlyuk > --- > +void > +eal_memseg_list_populate(struct rte_memseg_list *msl, void *addr, int n_segs) > +{ > + uint64_t page_sz = msl->page_sz; > + int i; > + > + for (i = 0; i < n_segs; i++) { > + struct rte_fbarray *arr = &msl->memseg_arr; > + struct rte_memseg *ms = rte_fbarray_get(arr, i); > + > + if (rte_eal_iova_mode() == RTE_IOVA_VA) > + ms->iova = (uintptr_t)addr; > + else > + ms->iova = RTE_BAD_IOVA; > + ms->addr = addr; > + ms->hugepage_sz = page_sz; > + ms->socket_id = 0; > + ms->len = page_sz; > + > + rte_fbarray_set_used(arr, i); > + > + addr = RTE_PTR_ADD(addr, page_sz); This breaks 32-bit build. I believe page_sz should be size_t, not uint64_t. -- Thanks, Anatoly