linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Pilmore <epilmore@gigaio.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	linux-pci@vger.kernel.org, David Woodhouse <dwmw2@infradead.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	iommu@lists.linux-foundation.org
Subject: Re: IOAT DMA w/IOMMU
Date: Thu, 9 Aug 2018 14:31:33 -0700	[thread overview]
Message-ID: <CAOQPn8tSNN+3igN-kMcQH46w_a9p6T+S7=c8CLREMLxr1kaTXQ@mail.gmail.com> (raw)
In-Reply-To: <b54899a8-a144-e8e0-9880-1800c4657b95@deltatee.com>

On Thu, Aug 9, 2018 at 12:35 PM, Logan Gunthorpe <logang@deltatee.com> wrote:
> Hey,
>
> On 09/08/18 12:51 PM, Eric Pilmore wrote:
>>>> Was wondering if anybody here has used IOAT DMA engines with an
>>>> IOMMU turned on (Xeon based system)? My specific question is really
>>>> whether it is possible to DMA (w/IOAT) to a PCI BAR address as the
>>>> destination without having to map that address to the IOVA space of
>>>> the DMA engine first (assuming the IOMMU is on)?
>
> I haven't tested this scenario but my guess would be that IOAT would
> indeed go through the IOMMU and the PCI BAR address would need to be
> properly mapped into the IOAT's IOVA. The fact that you see DMAR errors
> is probably a good indication that this is the case. I really don't know
> why you'd want to DMA something without mapping it.

The thought was to avoid paying the price of having to go through yet another
translation and also because it was not believed to be necessary anyway since
the DMA device could go straight to a PCI BAR address without the need for a
mapping.  We have been playing with two DMA engines, IOAT and PLX. The
PLX does not have any issues going straight to the PCI BAR address, but unlike
IOAT, PLX is sitting "in the PCI tree".

>
>>> So is this a peer-to-peer DMA scenario?  You mention DMA, which would
>>> be a transaction initiated by a PCI device, to a PCI BAR address, so
>>> it doesn't sound like system memory is involved.
>>
>> No, not peer-to-peer.  This is from system memory (e.g. SKB buffer which
>> has had an IOMMU mapping created) to a PCI BAR address.
>
> It's definitely peer-to-peer in the case where you are using a DMA
> engine in the PCI tree. You have the DMA PCI device sending TLPs
> directly to the PCI BAR device. So, if everything is done right, the
> TLPs will avoid the root complex completely. (Though, ACS settings could
> also prevent this from working and you'd either get similar DMAR errors
> or they'd disappear into a black hole).
>
> When using the IOAT, it is part of the CPU so I wouldn't say it's really
> peer-to-peer. But an argument could be made that it is. Though, this is
> exactly what the existing ntb_transport is doing: DMAing from system
> memory to a PCI BAR and vice versa using IOAT.
>
> Logan
>



-- 
Eric Pilmore
epilmore@gigaio.com
http://gigaio.com
Phone: (858) 775 2514

This e-mail message is intended only for the individual(s) to whom it
is addressed and
may contain information that is privileged, confidential, proprietary,
or otherwise exempt
from disclosure under applicable law. If you believe you have received
this message in
error, please advise the sender by return e-mail and delete it from
your mailbox.
Thank you.

  parent reply	other threads:[~2018-08-09 21:31 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09 18:14 IOAT DMA w/IOMMU Eric Pilmore
2018-08-09 18:43 ` Bjorn Helgaas
2018-08-09 18:51   ` Eric Pilmore
2018-08-09 19:35     ` Logan Gunthorpe
2018-08-09 19:47       ` Kit Chow
2018-08-09 20:11         ` Logan Gunthorpe
2018-08-09 20:57           ` Kit Chow
2018-08-09 21:11             ` Logan Gunthorpe
2018-08-09 21:47               ` Kit Chow
2018-08-09 22:40                 ` Jiang, Dave
2018-08-09 22:48                   ` Kit Chow
2018-08-09 22:50                     ` Logan Gunthorpe
2018-08-09 23:00                       ` Kit Chow
2018-08-10 16:02                         ` Kit Chow
2018-08-10 16:23                           ` Kit Chow
2018-08-10 16:24                             ` Logan Gunthorpe
2018-08-10 16:24                           ` Logan Gunthorpe
2018-08-10 16:31                             ` Dave Jiang
2018-08-10 16:33                               ` Logan Gunthorpe
2018-08-10 17:01                                 ` Dave Jiang
2018-08-10 17:15                                   ` Logan Gunthorpe
2018-08-10 17:46                                     ` Dave Jiang
2018-08-11  0:53                                       ` Kit Chow
2018-08-11  2:10                                         ` Logan Gunthorpe
2018-08-13 14:23                                           ` Kit Chow
2018-08-13 14:59                                             ` Robin Murphy
2018-08-13 15:21                                               ` Kit Chow
2018-08-13 23:30                                                 ` Kit Chow
2018-08-13 23:39                                                   ` Logan Gunthorpe
2018-08-13 23:48                                                     ` Kit Chow
2018-08-13 23:50                                                       ` Logan Gunthorpe
2018-08-14 13:47                                                         ` Kit Chow
2018-08-14 14:03                                                         ` Robin Murphy
2018-08-13 23:36                                                 ` Kit Chow
2018-08-09 21:31       ` Eric Pilmore [this message]
2018-08-09 21:36         ` Logan Gunthorpe
2018-08-16 17:16           ` Kit Chow
2018-08-16 17:21             ` Logan Gunthorpe
2018-08-16 18:53               ` Kit Chow
2018-08-16 18:56                 ` Logan Gunthorpe
2018-08-21 23:18                   ` Eric Pilmore
2018-08-21 23:20                     ` Logan Gunthorpe
2018-08-21 23:28                       ` Eric Pilmore
2018-08-21 23:35                         ` Logan Gunthorpe
2018-08-21 23:45                           ` Eric Pilmore
2018-08-21 23:53                             ` Logan Gunthorpe
2018-08-21 23:59                               ` Eric Pilmore
2018-08-21 23:30                       ` Eric Pilmore

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='CAOQPn8tSNN+3igN-kMcQH46w_a9p6T+S7=c8CLREMLxr1kaTXQ@mail.gmail.com' \
    --to=epilmore@gigaio.com \
    --cc=alex.williamson@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=helgaas@kernel.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=logang@deltatee.com \
    /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).