From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux-foundation.org, Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: linuxppc-dev@lists.ozlabs.org,
"Lu Baolu" <baolu.lu@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Joerg Roedel" <joro@8bytes.org>,
"Robin Murphy" <robin.murphy@arm.com>,
"Jesper Dangaard Brouer" <brouer@redhat.com>,
"Björn Töpel" <bjorn.topel@gmail.com>,
"Daniel Borkmann" <daniel@iogearbox.net>,
linux-kernel@vger.kernel.org
Subject: generic DMA bypass flag v4
Date: Wed, 8 Jul 2020 17:24:44 +0200 [thread overview]
Message-ID: <20200708152449.316476-1-hch@lst.de> (raw)
Hi all,
I've recently beeing chatting with Lu about using dma-iommu and
per-device DMA ops in the intel IOMMU driver, and one missing feature
in dma-iommu is a bypass mode where the direct mapping is used even
when an iommu is attached to improve performance. The powerpc
code already has a similar mode, so I'd like to move it to the core
DMA mapping code. As part of that I noticed that the current
powerpc code has a little bug in that it used the wrong check in the
dma_sync_* routines to see if the direct mapping code is used.
These two patches just add the generic code and move powerpc over,
the intel IOMMU bits will require a separate discussion.
The x86 AMD Gart code also has a bypass mode, but it is a lot
strange, so I'm not going to touch it for now.
Note that as-is this breaks the XSK buffer pool, which unfortunately
poked directly into DMA internals. A fix for that is already queued
up in the netdev tree.
Jesper and XDP gang: this should not regress any performance as
the dma-direct calls are now inlined into the out of line DMA mapping
calls. But if you can verify the performance numbers that would be
greatly appreciated.
A git tree is available here:
git://git.infradead.org/users/hch/misc.git dma-bypass.4
Gitweb:
git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-bypass.4
Changes since v3:
- add config options for the dma ops bypass and dma ops themselves
to not increase the size of tinyconfig builds
Changes since v2:
- move the dma mapping helpers out of line
- check for possible direct mappings using the dma mask
Changes since v1:
- rebased to the current dma-mapping-for-next tree
Diffstat:
arch/alpha/Kconfig | 1
arch/arm/Kconfig | 1
arch/ia64/Kconfig | 1
arch/mips/Kconfig | 1
arch/parisc/Kconfig | 1
arch/powerpc/Kconfig | 2
arch/powerpc/include/asm/device.h | 5
arch/powerpc/kernel/dma-iommu.c | 90 +------------
arch/s390/Kconfig | 1
arch/sparc/Kconfig | 1
arch/x86/Kconfig | 1
drivers/iommu/Kconfig | 2
drivers/misc/mic/Kconfig | 1
drivers/vdpa/Kconfig | 1
drivers/xen/Kconfig | 1
include/linux/device.h | 11 +
include/linux/dma-direct.h | 104 +++++++++++++++
include/linux/dma-mapping.h | 251 ++++----------------------------------
kernel/dma/Kconfig | 12 +
kernel/dma/Makefile | 3
kernel/dma/direct.c | 74 -----------
kernel/dma/mapping.c | 214 ++++++++++++++++++++++++++++++--
22 files changed, 385 insertions(+), 394 deletions(-)
next reply other threads:[~2020-07-08 15:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 15:24 Christoph Hellwig [this message]
2020-07-08 15:24 ` [PATCH 1/5] dma-mapping: move the remaining DMA API calls out of line Christoph Hellwig
2020-07-08 15:24 ` [PATCH 2/5] dma-mapping: inline the fast path dma-direct calls Christoph Hellwig
2020-07-08 15:24 ` [PATCH 3/5] dma-mapping: make support for dma ops optional Christoph Hellwig
2020-07-18 17:17 ` Guenter Roeck
2020-07-20 6:20 ` Christoph Hellwig
2020-07-08 15:24 ` [PATCH 4/5] dma-mapping: add a dma_ops_bypass flag to struct device Christoph Hellwig
2020-07-13 4:59 ` Alexey Kardashevskiy
2020-07-14 7:07 ` Christoph Hellwig
2020-07-14 7:12 ` Alexey Kardashevskiy
2020-07-08 15:24 ` [PATCH 5/5] powerpc: use the generic dma_ops_bypass mode Christoph Hellwig
2020-08-30 9:04 ` Cédric Le Goater
2020-08-31 6:40 ` Christoph Hellwig
2020-08-31 7:19 ` Cédric Le Goater
2020-09-05 15:45 ` Alexey Kardashevskiy
2020-07-10 13:26 ` generic DMA bypass flag v4 Jesper Dangaard Brouer
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=20200708152449.316476-1-hch@lst.de \
--to=hch@lst.de \
--cc=aik@ozlabs.ru \
--cc=baolu.lu@linux.intel.com \
--cc=bjorn.topel@gmail.com \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=gregkh@linuxfoundation.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=robin.murphy@arm.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).