From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cbtest1.netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 849EB6CA6 for ; Thu, 12 May 2016 16:34:04 +0200 (CEST) Received: from cbtest1.netronome.com (localhost [127.0.0.1]) by cbtest1.netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id u4CEY3Rg030787 for ; Thu, 12 May 2016 15:34:03 +0100 Received: (from alucero@localhost) by cbtest1.netronome.com (8.14.4/8.14.4/Submit) id u4CEY3ps030786 for dev@dpdk.org; Thu, 12 May 2016 15:34:03 +0100 From: Alejandro Lucero To: dev@dpdk.org Date: Thu, 12 May 2016 15:33:59 +0100 Message-Id: <1463063640-30715-3-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463063640-30715-1-git-send-email-alejandro.lucero@netronome.com> References: <1463063640-30715-1-git-send-email-alejandro.lucero@netronome.com> Subject: [dpdk-dev] [PATCH 2/3] eth_dev: add support for 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 14:34:04 -0000 - 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 --- 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