From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by dpdk.org (Postfix) with ESMTP id A63E81B3A0 for ; Thu, 1 Nov 2018 14:39:24 +0100 (CET) Received: by mail-ed1-f68.google.com with SMTP id z12-v6so10804969edp.7 for ; Thu, 01 Nov 2018 06:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jFfOup3jLjgRK2erwPyLnSU9gHuZwDaA3j2VP/gl30A=; b=k99TDtJ3DAxWPWwxhCQegSHdFJ9g4HVvBplQY/21JWx9D7lSEC0MqolJCDqoNM9vU5 mQTARSTPOwNsseFaxHTtkUazeol/yI1fslCWM8Hs7T9DJQxaZAJTwYLADoixxW9GixxE KXceAMuF4kfeBQnTIeeOdA75wmbVeDRVEt7VvlTfNqWBPVFQyw2CKXMLf4IPtv1T8Thp VfiEDz5ji4GaUBHTcajonRQFvgMaeJugY2a5HXeMksjyrSs5cKPdN7zfYtL7TgDm+l04 6BdEe0XdpZTnGabjrXQPOfNRdzJeJFX/rE644zGQLWiMYmGWYD/+brJjcTnLieupz8Mb Wkaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jFfOup3jLjgRK2erwPyLnSU9gHuZwDaA3j2VP/gl30A=; b=KRDOvDcBLYqjnO/tQ5OV6VDLMF6Dat0ijdf9i4O8plDpkYCiqRqCiB470zdSGU8SOc V6+YbC0vWxA7yDjz9MnMvPPxIBzYWOFVF3TvK/DaMmHtQZMb00oP7BDKtvFX/Z8N1iVq NO5Hc5wTtgpUfktu6LdB65l3keZUuNMneoKpcfGs6jIUa4FmfmcjQvTfPipQ+Gfkxw8S yidPrNTqZoZsbkan5d3Q+jdQcIIORYvRHMvgYEMgDY1dwdfS9m2GwgUoHc0yFR8vmRCN JudaRVSQlr4a+zCABZzDZfWdZS0BW3DOlcdvK2rpPxpMDQYWX7dWDdsiKCdlANS0dyRI QmWg== X-Gm-Message-State: AGRZ1gLyzuCaUXSAHHVoTbzDGDUtv8mVjdl4dS4CxN4/nidhymU/PZ02 qmKfs2T6Uyb7q9lQUzdT+oxhJaed7F4N/mxRm39yew== X-Google-Smtp-Source: AJdET5eBso2JWiY0NxcGlfg1TyWnoQvyh1/c0hTrh/i6wC66GN35dm4RM5rtLj6Xc7qJKX1q9m+aEQsiAZi7OrPTcAo= X-Received: by 2002:a50:f5f9:: with SMTP id x54-v6mr5165582edm.166.1541079564334; Thu, 01 Nov 2018 06:39:24 -0700 (PDT) MIME-Version: 1.0 References: <20181031172931.11894-1-alejandro.lucero@netronome.com> <20181031172931.11894-8-alejandro.lucero@netronome.com> <545549d1-ba39-96e3-6bf9-219f9f5cba54@intel.com> In-Reply-To: <545549d1-ba39-96e3-6bf9-219f9f5cba54@intel.com> From: Alejandro Lucero Date: Thu, 1 Nov 2018 13:39:13 +0000 Message-ID: To: "Burakov, Anatoly" Cc: dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 13:39:24 -0000 On Thu, Nov 1, 2018 at 10:40 AM Burakov, Anatoly wrote: > 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. > > Not sure about this. patch 5 is a follow-up of patch 4, and this is to add support for other EAL supported memory options. > > 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 :) > Ok > > > + __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 >