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

 - New dma_mask field in rte_eth_dev_data.
 - If PMD sets device dma_mask, call to check hugepages within
   supported range.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 lib/librte_ether/rte_ethdev.c | 7 +++++++
 lib/librte_ether/rte_ethdev.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index a31018e..c0de88a 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -280,9 +280,16 @@ rte_eth_dev_init(struct rte_pci_driver *pci_drv,
 
 	/* Invoke PMD device initialization function */
 	diag = (*eth_drv->eth_dev_init)(eth_dev);
+	if (diag)
+		goto err;
+
+	if (eth_dev->data->dma_mask)
+		diag = rte_eal_hugepage_check_address_mask(eth_dev->data->dma_mask);
+
 	if (diag == 0)
 		return 0;
 
+err:
 	RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%u device_id=0x%x) failed\n",
 			pci_drv->name,
 			(unsigned) pci_dev->id.vendor_id,
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 2757510..34daa92 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1675,6 +1675,7 @@ struct rte_eth_dev_data {
 	enum rte_kernel_driver kdrv;    /**< Kernel driver passthrough */
 	int numa_node;  /**< NUMA node connection */
 	const char *drv_name;   /**< Driver name */
+	uint64_t dma_mask; /** device supported address space range */
 };
 
 /** Device supports hotplug detach */
-- 
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 ` Alejandro Lucero [this message]
2016-05-12 14:52   ` [dpdk-dev] [dpdk-dev, 2/3] eth_dev: add support for device dma mask 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   ` [dpdk-dev] [dpdk-dev,3/3] " 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-3-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).