DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alejandro Lucero <alejandro.lucero@netronome.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/3] nfp: set device dma mask
Date: Thu, 12 May 2016 15:34:00 +0100	[thread overview]
Message-ID: <1463063640-30715-4-git-send-email-alejandro.lucero@netronome.com> (raw)
In-Reply-To: <1463063640-30715-1-git-send-email-alejandro.lucero@netronome.com>

 - Just hugepages within the supported range will be available.

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
+
 /*
  * 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);
+
 	return 0;
 }
 
-- 
1.9.1

  parent reply	other threads:[~2016-05-12 14:34 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 ` Alejandro Lucero [this message]
2016-05-12 15:03   ` [dpdk-dev] [dpdk-dev,3/3] nfp: set " Jan Viktorin
2016-05-12 15:13     ` 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=1463063640-30715-4-git-send-email-alejandro.lucero@netronome.com \
    --to=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).