From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk0-f42.google.com (mail-vk0-f42.google.com [209.85.213.42]) by dpdk.org (Postfix) with ESMTP id CEF436CC1 for ; Thu, 12 May 2016 17:13:55 +0200 (CEST) Received: by mail-vk0-f42.google.com with SMTP id s184so101296585vkb.3 for ; Thu, 12 May 2016 08:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=FNQwXzi4EtvW6zQM15JsSr0ooDJJg2jBvPexXUON9KQ=; b=UXMmK5S7owRU1n4DWbSDrYltPZn8QWUflFQuvGBwokXHUHRM7Zf8/pkNs5DZc3fCY3 fut2KWTv0MHUITnB9WbzgtFiPJShROjoC4RMwpN8aXYBjkyXF8l65BxZXatB6ijXPKy5 LhkHpjykYTYLEXvkzPQUO6kAfP4CVjn+G+a8DnAMs+SYg9RRr/KBiWU3eB332oa2LRuq PVp3MgC2ntBhi0OoYrNKJj0pYzkrxL54kGU7JgK2VmAFEbunRmMqbKirBK9VbqpVpaYe kMUkajOnZUhX9wBdPOCDYJ4ooFnhi7cu7RzgWuNWV7Sy9Rzw8wdVnMCfaRoIOjX/qf9j 3dFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=FNQwXzi4EtvW6zQM15JsSr0ooDJJg2jBvPexXUON9KQ=; b=lYEMTNRhXJ/PxlSiUimnA9KP4sXUACnBNSiKsDffzRJ3bQq70csXfUIKMjk5hpsUPp ZmNCddfkdIz+PhM1kYEYmg/8BE/Fbt5KiDZ7fP4x5gIGaWPhGuKGGKel+OgS6//cBvlf Li8fezHT7ZieCclIbqQsC0+93i1X1ikFS+YMNH7FC66LnYvLso0/3tzbs+qJPgpjMxCe s0L8cNHosymlNMlWgrY1keMCtzqDbdo189xiRdgfaOQ2oIg/z20d1GpD4UJKo5yv1f+z GGZo83Nx+dG8pjxSWkgPmmiAog0Ov6vmEcuus+bPFHb5JqAQyNAzCm3eljtCgoGvIUz5 cJDw== X-Gm-Message-State: AOPr4FV2JnbwGxYcCXCFBg95WVX7nMttp2jL3uyMItUiKFYZP3XtDRZGjQDbynH6h2eYQYyWFJAaVnsVANEL3XNt MIME-Version: 1.0 X-Received: by 10.31.95.70 with SMTP id t67mr5105176vkb.42.1463066035392; Thu, 12 May 2016 08:13:55 -0700 (PDT) Received: by 10.103.112.129 with HTTP; Thu, 12 May 2016 08:13:55 -0700 (PDT) In-Reply-To: <20160512170336.6b4e372e@pcviktorin.fit.vutbr.cz> References: <1463063640-30715-4-git-send-email-alejandro.lucero@netronome.com> <20160512170336.6b4e372e@pcviktorin.fit.vutbr.cz> Date: Thu, 12 May 2016 16:13:55 +0100 Message-ID: From: Alejandro Lucero To: Jan Viktorin Cc: dev Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [dpdk-dev,3/3] nfp: set device dma mask 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: Thu, 12 May 2016 15:13:56 -0000 On Thu, May 12, 2016 at 4:03 PM, Jan Viktorin wrote: > On Thu, 12 May 2016 15:34:00 +0100 > "Alejandro.Lucero" wrote: > > > - Just hugepages within the supported range will be available. > > Again the hyphen is redundant here. > > By the way, this text does not describe the change well. If I understood > the whole patch set (I am not quite sure now), the initialization would > fail if there are hugepages out of the given DMA mask. Am I wrong? > > You are right. > I'd expect something like "NFP supports DMA address in range ...". > > That is a good idea. I was thinking on adding a memseg dump info as well which would help to understand this issue and other related to memory allocation. > > > > Signed-off-by: Alejandro Lucero > > > > --- > > drivers/net/nfp/nfp_net.c | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > > index ea5a2a3..e0e444a 100644 > > --- a/drivers/net/nfp/nfp_net.c > > +++ b/drivers/net/nfp/nfp_net.c > > @@ -115,6 +115,14 @@ enum nfp_qcp_ptr { > > NFP_QCP_WRITE_PTR > > }; > > > > +#ifndef DMA_64BIT_MASK > > +#define DMA_64BIT_MASK 0xffffffffffffffffULL > > +#endif > > + > > +#ifndef DMA_BIT_MASK > > +#define DMA_BIT_MASK(n) (((n) == 64) ? DMA_64BIT_MASK : ((1ULL<<(n))-1)) > > +#endif > > This is quite a generic code, I'd put it into the EAL. Probably, it should > be renamed to something like RTE_DMA_BIT_MASK. OK. > > > + > > /* > > * nfp_qcp_ptr_add - Add the value to the selected pointer of a queue > > * @q: Base address for queue structure > > @@ -2441,6 +2449,9 @@ nfp_net_init(struct rte_eth_dev *eth_dev) > > /* Recording current stats counters values */ > > nfp_net_stats_reset(eth_dev); > > > > + /* Setting dma_mask */ > > + eth_dev->data->dma_mask = DMA_BIT_MASK(40); > > Can we read this from /sys/bus/pci/devices/*/dma_mask_bits? I am not sure > whether is this generic enough but I can see dma_mask_bits for the PCI > devices on my PC. > > The kernel adds a default dma mask when device scanning (at least for PCI devices). It is a device driver who knows about specific DMA addressing limitations. For example, this is done with UIO (igb_uio) and the using sysfs would be fine (but then you should add support for specifying a dma mask in igb_uio as a module param) but this is not true for VFIO. > Regards > Jan > > > + > > return 0; > > } > > > > > > > -- > Jan Viktorin E-mail: Viktorin@RehiveTech.com > System Architect Web: www.RehiveTech.com > RehiveTech > Brno, Czech Republic >