From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 85A235F29 for ; Thu, 1 Nov 2018 11:40:49 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 03:40:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,451,1534834800"; d="scan'208";a="246158831" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.72]) ([10.237.220.72]) by orsmga004.jf.intel.com with ESMTP; 01 Nov 2018 03:40:47 -0700 To: Alejandro Lucero , dev@dpdk.org References: <20181031172931.11894-1-alejandro.lucero@netronome.com> <20181031172931.11894-8-alejandro.lucero@netronome.com> From: "Burakov, Anatoly" Message-ID: <545549d1-ba39-96e3-6bf9-219f9f5cba54@intel.com> Date: Thu, 1 Nov 2018 10:40:47 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181031172931.11894-8-alejandro.lucero@netronome.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 7/7] eal/mem: use DMA mask check for legacy memory 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: Thu, 01 Nov 2018 10:40:50 -0000 On 31-Oct-18 5:29 PM, Alejandro Lucero wrote: > If a device reports addressing limitations through a dma mask, > the IOVAs for mapped memory needs to be checked out for ensuring > correct functionality. > > Previous patches introduced this DMA check for main memory code > currently being used but other options like legacy memory and the > no hugepages one need to be also considered. > > This patch adds the DMA check for those cases. > > Signed-off-by: Alejandro Lucero > --- IMO this needs to be integrated with patch 5. > lib/librte_eal/linuxapp/eal/eal_memory.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c > index fce86fda6..2a3a8c7a3 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_memory.c > +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c > @@ -1393,6 +1393,14 @@ eal_legacy_hugepage_init(void) > > addr = RTE_PTR_ADD(addr, (size_t)page_sz); > } > + if (mcfg->dma_maskbits) { > + if (rte_mem_check_dma_mask_unsafe(mcfg->dma_maskbits)) { > + RTE_LOG(ERR, EAL, > + "%s(): couldn't allocate memory due to DMA mask\n", I would use suggested rewording from patch 5 :) > + __func__); > + goto fail; > + } > + } > return 0; > } > > @@ -1628,6 +1636,15 @@ eal_legacy_hugepage_init(void) > rte_fbarray_destroy(&msl->memseg_arr); > } > > + if (mcfg->dma_maskbits) { > + if (rte_mem_check_dma_mask_unsafe(mcfg->dma_maskbits)) { > + RTE_LOG(ERR, EAL, > + "%s(): couldn't allocate memory due to DMA mask\n", Same as above. > + __func__); > + goto fail; > + } > + } > + > return 0; > > fail: > -- Thanks, Anatoly