DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jan Viktorin <viktorin@rehivetech.com>
To: "Alejandro.Lucero" <alejandro.lucero@netronome.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [dpdk-dev,3/3] nfp: set device dma mask
Date: Thu, 12 May 2016 17:03:36 +0200	[thread overview]
Message-ID: <20160512170336.6b4e372e@pcviktorin.fit.vutbr.cz> (raw)
In-Reply-To: <1463063640-30715-4-git-send-email-alejandro.lucero@netronome.com>

On Thu, 12 May 2016 15:34:00 +0100
"Alejandro.Lucero" <alejandro.lucero@netronome.com> 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?

I'd expect something like "NFP supports DMA address in range ...".

> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
> 
> ---
> 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.

> +
>  /*
>   * 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.

Regards
Jan

> +
>  	return 0;
>  }
>  




-- 
   Jan Viktorin                  E-mail: Viktorin@RehiveTech.com
   System Architect              Web:    www.RehiveTech.com
   RehiveTech
   Brno, Czech Republic

  reply	other threads:[~2016-05-12 15:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12 14:33 [dpdk-dev] [PATCH 0/3] add support for devices with addressing limitations Alejandro Lucero
2016-05-12 14:33 ` [dpdk-dev] [PATCH 1/3] eal/linux: add function for checking hugepages within device supported address range Alejandro Lucero
2016-05-12 15:11   ` [dpdk-dev] [dpdk-dev, " Jan Viktorin
2016-05-12 14:33 ` [dpdk-dev] [PATCH 2/3] eth_dev: add support for device dma mask Alejandro Lucero
2016-05-12 14:52   ` [dpdk-dev] [dpdk-dev, " Jan Viktorin
2016-05-12 15:03     ` Alejandro Lucero
2016-05-12 15:41       ` Jan Viktorin
2016-05-13  8:38         ` Alejandro Lucero
2016-05-13 13:49           ` Thomas Monjalon
2016-05-12 14:34 ` [dpdk-dev] [PATCH 3/3] nfp: set " Alejandro Lucero
2016-05-12 15:03   ` Jan Viktorin [this message]
2016-05-12 15:13     ` [dpdk-dev] [dpdk-dev,3/3] " Alejandro Lucero
2016-05-12 15:19       ` Jan Viktorin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160512170336.6b4e372e@pcviktorin.fit.vutbr.cz \
    --to=viktorin@rehivetech.com \
    --cc=alejandro.lucero@netronome.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).