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 C34376CA6 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 u4CEY3cp030791 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 u4CEY3ed030790 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:34:00 +0100 Message-Id: <1463063640-30715-4-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 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 14:34:05 -0000 - Just hugepages within the supported range will be available. 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 + /* * 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