DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: stable@dpdk.org, dev@dpdk.org, jianfeng.tan@intel.com,
	qi.z.zhang@intel.com, stephen@networkplumber.org,
	santosh.shukla@caviumnetworks.com, anatoly.burakov@intel.com,
	peterx@redhat.com
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3] bus/pci: forbid VA as IOVA mode if IOMMU address width too small
Date: Sat, 20 Jan 2018 16:30:05 +0100	[thread overview]
Message-ID: <7562300.6VOHPpqvym@xps> (raw)
In-Reply-To: <20180112102220.20061-1-maxime.coquelin@redhat.com>

12/01/2018 11:22, Maxime Coquelin:
> Intel VT-d supports different address widths for the IOVAs, from
> 39 bits to 56 bits.
> 
> While recent processors support at least 48 bits, VT-d emulation
> currently only supports 39 bits. It makes DMA mapping to fail in this
> case when using VA as IOVA mode, as user-space virtual addresses uses
> up to 47 bits (see kernel's Documentation/x86/x86_64/mm.txt).
> 
> This patch parses VT-d CAP register value available in sysfs, and
> forbid VA as IOVA mode if the GAW is 39 bits or unknown.
> 
> Fixes: f37dfab21c98 ("drivers/net: enable IOVA mode for Intel PMDs")
> 
> Cc: stable@dpdk.org
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
[...]
> +	if (fscanf(fp, "%lx", &vtd_cap_reg) != 1) {

Compilation error on 32-bit. Fix:

-       if (fscanf(fp, "%lx", &vtd_cap_reg) != 1) {
+       if (fscanf(fp, "%" PRIx64, &vtd_cap_reg) != 1) {

[...]
> +#elif defined(RTE_ARCH_PPC_64)
> +static bool
> +pci_one_device_iommu_support_va(struct rte_pci_device *dev)
> +{
> +       return false;
> +}
> +#else
> +static bool
> +pci_one_device_iommu_support_va(struct rte_pci_device *dev)
> +{
> +	return true;
> +}
> +#endif

Compilation error on non-x86. Fix:

 #elif defined(RTE_ARCH_PPC_64)
 static bool
-pci_one_device_iommu_support_va(struct rte_pci_device *dev)
+pci_one_device_iommu_support_va(__rte_unused struct rte_pci_device *dev)
 {
        return false;
 }
 #else
 static bool
-pci_one_device_iommu_support_va(struct rte_pci_device *dev)
+pci_one_device_iommu_support_va(__rte_unused struct rte_pci_device *dev)
 {
        return true;
 }

Applied with above fixes, thanks.

      parent reply	other threads:[~2018-01-20 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 10:22 [dpdk-dev] " Maxime Coquelin
2018-01-12 11:10 ` Burakov, Anatoly
2018-01-12 13:18   ` Maxime Coquelin
2018-01-12 22:46     ` Chas Williams
2018-01-20 15:30 ` Thomas Monjalon [this message]

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=7562300.6VOHPpqvym@xps \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qi.z.zhang@intel.com \
    --cc=santosh.shukla@caviumnetworks.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.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).