From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id D613B1BE3F; Tue, 26 Jun 2018 19:38:04 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w5QHbbMF028358; Tue, 26 Jun 2018 18:37:37 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w5QHbbuM028357; Tue, 26 Jun 2018 18:37:37 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org, anatoly.burakov@intel.com Date: Tue, 26 Jun 2018 18:37:30 +0100 Message-Id: <1530034653-28299-4-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530034653-28299-1-git-send-email-alejandro.lucero@netronome.com> References: <1530034653-28299-1-git-send-email-alejandro.lucero@netronome.com> Subject: [dpdk-stable] [PATCH 3/6] eal: check hugepages within dma mask range X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2018 17:38:05 -0000 Hugepages get an iova address which could be out of range for devices with addressing limitations. This patch checks hugepages are withint the range if dma mask is set by a device. Signed-off-by: Alejandro Lucero --- lib/librte_eal/common/eal_private.h | 3 +++ lib/librte_eal/linuxapp/eal/eal.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h index 462226f..05db535 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -224,4 +224,7 @@ */ struct rte_bus *rte_bus_find_by_device_name(const char *str); +/* if dma mask set by a device, check hugepages are not out of range */ +int rte_eal_memory_dma_mask_check(void); + #endif /* _EAL_PRIVATE_H_ */ diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index 229eec9..eaa9325 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -960,6 +960,10 @@ static void rte_eal_init_alert(const char *msg) return -1; } + /* If dma mask set, check hugepages iovas are within the range */ + if (rte_eal_memory_dma_mask_check() < 0) + rte_panic("iovas out of range\n"); + /* initialize default service/lcore mappings and start running. Ignore * -ENOTSUP, as it indicates no service coremask passed to EAL. */ -- 1.9.1