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 782968E58; Fri, 31 Aug 2018 16:54:46 +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 w7VErrZw044874; Fri, 31 Aug 2018 15:53:53 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w7VErqCP044873; Fri, 31 Aug 2018 15:53:53 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org, anatoly.burakov@intel.com, echaudro@redhat.com Date: Fri, 31 Aug 2018 15:53:52 +0100 Message-Id: <1535727232-44836-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 17.11] mem: fix max DMA maskbit size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2018 14:54:46 -0000 The sanity check inside rte_eal_check_dma_mask is using 47 bits as the maximum size. It turns out there are some IOMMU hardware reporting 48 bits precluding the IOVA VA mode to be enabled. It is harmless to raise the maximum mask size to 63 bits. This patch also removes any reference to unused X86_VA_WIDTH. Fixes: 3a80bc50c949 ("mem: add function for checking memsegs IOVAs addresses") Signed-off-by: Alejandro Lucero --- drivers/bus/pci/linux/pci.c | 1 - lib/librte_eal/common/eal_common_memory.c | 5 ----- 2 files changed, 6 deletions(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index c81ed50..44440f2 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -583,7 +583,6 @@ { #define VTD_CAP_MGAW_SHIFT 16 #define VTD_CAP_MGAW_MASK (0x3fULL << VTD_CAP_MGAW_SHIFT) -#define X86_VA_WIDTH 47 /* From Documentation/x86/x86_64/mm.txt */ struct rte_pci_addr *addr = &dev->addr; char filename[PATH_MAX]; FILE *fp; diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c index 00ab393..a0922f1 100644 --- a/lib/librte_eal/common/eal_common_memory.c +++ b/lib/librte_eal/common/eal_common_memory.c @@ -109,13 +109,8 @@ } } -#if defined(RTE_ARCH_X86) -#define X86_VA_WIDTH 47 /* From Documentation/x86/x86_64/mm.txt */ -#define MAX_DMA_MASK_BITS X86_VA_WIDTH -#else /* 63 bits is good enough for a sanity check */ #define MAX_DMA_MASK_BITS 63 -#endif /* check memseg iovas are within the required range based on dma mask */ int -- 1.9.1