iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* generic DMA bypass flag v4
@ 2020-07-08 15:24 Christoph Hellwig
  2020-07-08 15:24 ` [PATCH 1/5] dma-mapping: move the remaining DMA API calls out of line Christoph Hellwig
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Christoph Hellwig @ 2020-07-08 15:24 UTC (permalink / raw)
  To: iommu, Alexey Kardashevskiy
  Cc: Daniel Borkmann, Greg Kroah-Hartman, Robin Murphy, linux-kernel,
	Jesper Dangaard Brouer, linuxppc-dev

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(-)
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-09-05 15:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 15:24 generic DMA bypass flag v4 Christoph Hellwig
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

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).