Skip to content

SWIOTLB: Preserve swiotlb map offset when needed.

Jianxiong Gao linux-iommu linux-nvme lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 12 repliesIn review
  2. v13 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3Adding page_offset_mask to device_dma_parametersinclude/linux/device.h include/linux/dma-mapping.h+18 -00 replies
2/3Add swiotlb offset preserving mapping when dma_dma_parameters->page_offset_mask is non zero.kernel/dma/swiotlb.c+24 -30 replies
3/3Adding device_dma_parameters->offset_preserve_mask to NVMe driver.drivers/nvme/host/pci.c+17 -211 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/3] SWIOTLB: Preserve swiotlb map offset when needed.

NVMe driver and other applications may depend on the data offset to operate correctly. Currently when unaligned data is mapped via SWIOTLB, the data is mapped as slab aligned with the SWIOTLB. This patch adds an option to make sure the mapped data preserves its offset of the orginal addrss.

Without the patch when creating xfs formatted disk on NVMe backends, with swiotlb=force in kernel boot option, creates the following error:

meta-data=/dev/nvme2n1   isize=512    agcount=4, agsize=131072 blks
         =               sectsz=512   attr=2, projid32bit=1
         =               crc=1        finobt=1, sparse=0, rmapbt=0, refl
ink=0
data     =               bsize=4096   blocks=524288, imaxpct=25
         =               sunit=0      swidth=0 blks
naming   =version 2      bsize=4096   ascii-ci=0 ftype=1
log      =internal log   bsize=4096   blocks=2560, version=2
         =               sectsz=512   sunit=0 blks, lazy-count=1
realtime =none           extsz=4096   blocks=0, rtextents=0

mkfs.xfs: pwrite failed: Input/output error

Jianxiong Gao (3):
Adding page_offset_mask to device_dma_parameters Add swiotlb offset preserving mapping when

    dma_dma_parameters->page_offset_mask is non zero.

Adding device_dma_parameters->offset_preserve_mask to NVMe driver.

 drivers/nvme/host/pci.c     |  4 ++++
 include/linux/device.h      |  1 +
 include/linux/dma-mapping.h | 17 +++++++++++++++++
 kernel/dma/swiotlb.c        | 16 +++++++++++++++-
 4 files changed, 37 insertions(+), 1 deletion(-)
Signature · 7 lines
2.27.0


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme