DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alejandro Lucero <alejandro.lucero@netronome.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, anatoly.burakov@intel.com, echaudro@redhat.com
Subject: [dpdk-dev] [PATCH 17.11] mem: fix max DMA maskbit size
Date: Fri, 31 Aug 2018 15:53:52 +0100	[thread overview]
Message-ID: <1535727232-44836-1-git-send-email-alejandro.lucero@netronome.com> (raw)

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 <alejandro.lucero@netronome.com>
---
 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

             reply	other threads:[~2018-08-31 14:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 14:53 Alejandro Lucero [this message]
2018-09-02 17:17 ` [dpdk-dev] [dpdk-stable] " Yongseok Koh

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=1535727232-44836-1-git-send-email-alejandro.lucero@netronome.com \
    --to=alejandro.lucero@netronome.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=echaudro@redhat.com \
    --cc=stable@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).