to inform the lower
level implementations that P2PDMA pages are allowed and to warn if a
caller introduces them into the regular dma_map_sg() interface.
Signed-off-by: Logan Gunthorpe
---
include/linux/dma-mapping.h | 15 +++
kernel/dma/mapping.c| 52
-off-by: Logan Gunthorpe
---
drivers/pci/Kconfig | 2 +-
include/linux/scatterlist.h | 49 ++---
2 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 0c473d75e625..90b4bddb3300 100644
--- a/drivers
pci_p2pdma_map_type() will be needed by the dma-iommu map_sg
implementation because it will need to determine the mapping type
ahead of actually doing the mapping to create the actual iommu mapping.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 34
ice list. It should be impossible for the host bridge's device to
go away while references are held on child devices, so the first element
should not be able to change and, thus, this should be safe.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 14 --
1 file changed,
is useful for IOMMU
dma_map_sg() implementations where the sg segment containing the page
differs from the sg segment containing the DMA address.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 65 ++
include/linux/pci-p2pdma.h | 21
-by: Logan Gunthorpe
---
drivers/nvme/host/pci.c | 28
1 file changed, 8 insertions(+), 20 deletions(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 14f092973792..a1ed07ff38b7 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -577,17
() and are ignored when unmapped.
Signed-off-by: Logan Gunthorpe
---
kernel/dma/direct.c | 25 ++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 002268262c9a..108dfb4ecbd5 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma
-by: Logan Gunthorpe
---
drivers/iommu/dma-iommu.c | 66 ++-
1 file changed, 58 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index af765c813cc8..ef49635f9819 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers
Ensure the dma operations support p2pdma before using the RDMA
device for P2PDMA. This allows switching the RDMA driver from
pci_p2pdma_map_sg() to dma_map_sg_p2pdma().
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/target/rdma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff
Introduce a supports_pci_p2pdma() operation in nvme_ctrl_ops to
replace the fixed NVME_F_PCI_P2PDMA flag such that the dma_map_ops
flags can be checked for PCI P2PDMA support.
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/host/core.c | 3 ++-
drivers/nvme/host/nvme.h | 2 +-
drivers/nvme
Add a flags member to the dma_map_ops structure with one flag to
indicate support for PCI P2PDMA.
Also, add a helper to check if a device supports PCI P2PDMA.
Signed-off-by: Logan Gunthorpe
---
include/linux/dma-map-ops.h | 3 +++
include/linux/dma-mapping.h | 5 +
kernel/dma/mapping.c
This interface is superseded by the new dma_map_sg_p2pdma() interface
which supports heterogeneous scatterlists. There are no longer
any users, so remove it.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 67 --
include/linux/pci-p2pdma.h
)
* Finished off using the new dma_map_sg_p2pdma() call in rdma_rw
and removed the old pci_p2pdma_[un]map_sg(). (per Jason)
--
Logan Gunthorpe (16):
PCI/P2PDMA: Pass gfp_mask flags to upstream_bridge_distance_warn()
PCI/P2PDMA: Avoid pci_get_slot() which sleeps
PCI/P2PDMA: Attempt to set
Drop the use of pci_p2pdma_map_sg() in favour of dma_map_sg_p2pdma().
The new interface allows mapping scatterlists that mix both regular
and P2PDMA pages and will verify that the dma device can communicate
with the device the pages are on.
Signed-off-by: Logan Gunthorpe
---
drivers/infiniband
to be allocated.
Signed-off-by: Logan Gunthorpe
Acked-by: Bjorn Helgaas
---
drivers/pci/p2pdma.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 196382630363..bd89437faf06 100644
--- a/drivers/pci
.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 473a08940fbc..2574a062a255 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -825,11 +825,18
All callers of pci_p2pdma_map_type() have a struct dev_pgmap and a
struct device (of the client doing the DMA transfer). Thus move the
conversion to struct pci_devs for the provider and client into this
function.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 29
penter
Good catch. Thanks Dan!
Reviewed-by: Logan Gunthorpe
Logan
On 2021-03-16 2:00 a.m., Christoph Hellwig wrote:
> On Thu, Mar 11, 2021 at 04:31:39PM -0700, Logan Gunthorpe wrote:
>> Create a specific error code for when P2PDMA pages are passed to a block
>> devices that cannot map them (due to no IOMMU support or ACS protections).
>>
On 2021-03-16 1:58 a.m., Christoph Hellwig wrote:
> On Fri, Mar 12, 2021 at 11:27:46AM -0700, Logan Gunthorpe wrote:
>> So then we reject the patches that make that change. Seems like an odd
>> argument to say that we can't do something that won't cause problems
>> beca
On 2021-03-12 7:36 p.m., Ira Weiny wrote:
> On Thu, Mar 11, 2021 at 04:31:37PM -0700, Logan Gunthorpe wrote:
>
>> +int dma_pci_p2pdma_supported(struct device *dev)
>^^^
> bool?
Sure.
>
>> +{
>> +const struct dma_map_ops *ops = get_dma_ops(dev)
On 2021-03-12 7:32 p.m., Ira Weiny wrote:
> On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote:
>> Introduce pci_p2pdma_should_map_bus() which is meant to be called by
> ^
> pci_p2pdma_dma_map_type() ???
>
>
On 2021-03-12 6:38 p.m., Ira Weiny wrote:
> On Thu, Mar 11, 2021 at 04:31:34PM -0700, Logan Gunthorpe wrote:
>> Introduce pci_p2pdma_should_map_bus() which is meant to be called by
>> DMA map functions to determine how to map a given p2pdma page.
>>
>> pci_p2pdma
On 2021-03-12 1:57 p.m., Bjorn Helgaas wrote:
> On Thu, Mar 11, 2021 at 04:31:32PM -0700, Logan Gunthorpe wrote:
>> In order to use upstream_bridge_distance_warn() from a dma_map function,
>> it must not sleep. However, pci_get_slot() takes the pci_bus_sem so it
>> might
On 2021-03-12 1:39 p.m., Bjorn Helgaas wrote:
On Thu, Mar 11, 2021 at 04:31:31PM -0700, Logan Gunthorpe wrote:
In order to call this function from a dma_map function, it must not sleep.
The only reason it does sleep so to allocate the seqbuf to print
which devices are within the ACS path
On 2021-03-12 12:47 p.m., Robin Murphy wrote:
{
struct scatterlist *s, *cur = sg;
unsigned long seg_mask = dma_get_seg_boundary(dev);
@@ -864,6 +865,20 @@ static int __finalise_sg(struct device *dev,
struct scatterlist *sg, int nents,
sg_dma_address(s) =
On 2021-03-12 11:11 a.m., Robin Murphy wrote:
> On 2021-03-12 16:24, Logan Gunthorpe wrote:
>>
>>
>> On 2021-03-12 8:52 a.m., Robin Murphy wrote:
>>>> +
>>>> sg->dma_address = dma_direct_map_page(dev, sg_page(sg),
>>&g
On 2021-03-12 10:46 a.m., Robin Murphy wrote:
> On 2021-03-12 16:18, Logan Gunthorpe wrote:
>>
>>
>> On 2021-03-12 8:51 a.m., Robin Murphy wrote:
>>> On 2021-03-11 23:31, Logan Gunthorpe wrote:
>>>> Hi,
>>>>
>>>> This is a rew
On 2021-03-12 8:52 a.m., Robin Murphy wrote:
> On 2021-03-11 23:31, Logan Gunthorpe wrote:
>> When a PCI P2PDMA page is seen, set the IOVA length of the segment
>> to zero so that it is not mapped into the IOVA. Then, in finalise_sg(),
>> apply the appropriate bus a
On 2021-03-12 8:52 a.m., Robin Murphy wrote:
>> +
>> sg->dma_address = dma_direct_map_page(dev, sg_page(sg),
>> sg->offset, sg->length, dir, attrs);
>> if (sg->dma_address == DMA_MAPPING_ERROR)
>> @@ -411,7 +440,7 @@ int dma_direct_map_sg(struct device
On 2021-03-12 8:51 a.m., Robin Murphy wrote:
> On 2021-03-11 23:31, Logan Gunthorpe wrote:
>> Hi,
>>
>> This is a rework of the first half of my RFC for doing P2PDMA in
>> userspace
>> with O_DIRECT[1].
>>
>> The largest issue with that serie
On 2021-03-11 4:59 p.m., Jason Gunthorpe wrote:
> On Thu, Mar 11, 2021 at 04:31:41PM -0700, Logan Gunthorpe wrote:
>> Convert to using dma_[un]map_sg() for PCI p2pdma pages.
>>
>> This should be equivalent, though support will be somewhat less
>> (only dma-direct
.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 2135fe69bb07..7f6836732bce 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -819,11 +819,18
Convert to using dma_[un]map_sg() for PCI p2pdma pages.
This should be equivalent, though support will be somewhat less
(only dma-direct and dma-iommu are currently supported).
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/host/pci.c | 27 +++
1 file changed, 7
.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 196382630363..bd89437faf06 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -267,7
() and are ignored when unmapped.
Signed-off-by: Logan Gunthorpe
---
kernel/dma/direct.c | 35 ---
kernel/dma/mapping.c | 13 ++---
2 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 002268262c9a..f326d32062dd
ee.com/
[2]
https://lore.kernel.org/linux-block/capcyv4ifgcrdotut8qr7pmfhmecghqgvre9g0rorgczcgve...@mail.gmail.com/
--
Logan Gunthorpe (11):
PCI/P2PDMA: Pass gfp_mask flags to upstream_bridge_distance_warn()
PCI/P2PDMA: Avoid pci_get_slot() which sleeps
PCI/P2PDMA: Attempt to set map_type
Create a specific error code for when P2PDMA pages are passed to a block
devices that cannot map them (due to no IOMMU support or ACS protections).
This makes request errors in these cases more informative of as to what
caused the error.
Signed-off-by: Logan Gunthorpe
---
block/blk-core.c
requires adding an additional dependency on CONFIG_64BIT to
CONFIG_PCI_P2PDMA. This should be acceptable as the majority of P2PDMA
use cases are restricted to newer root complexes and roughly require the
extra address space for memory BARs used in the transactions.
Signed-off-by: Logan Gunthorpe
Introduce pci_p2pdma_should_map_bus() which is meant to be called by
DMA map functions to determine how to map a given p2pdma page.
pci_p2pdma_bus_offset() is also added to allow callers to get the bus
offset if they need to map the bus address.
Signed-off-by: Logan Gunthorpe
---
drivers/pci
ist. It should be impossible for the host bridges device to go away
while references are held on child devices, so the first element
should not change and this should be safe.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --
Add a flags member to the dma_map_ops structure with one flag to
indicate support for PCI P2PDMA.
Also, add a helper to check if a device supports PCI P2PDMA.
Signed-off-by: Logan Gunthorpe
---
include/linux/dma-map-ops.h | 3 +++
include/linux/dma-mapping.h | 5 +
kernel/dma/mapping.c
Introduce a supports_pci_p2pdma() operation in nvme_ctrl_ops to
replace the fixed NVME_F_PCI_P2PDMA flag such that the dma_map_ops
flags can be checked for PCI P2PDMA support.
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/host/core.c | 3 ++-
drivers/nvme/host/nvme.h | 2 +-
drivers/nvme
-by: Logan Gunthorpe
---
drivers/iommu/dma-iommu.c | 63 ---
1 file changed, 53 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index af765c813cc8..c0821e9051a9 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers
On 2021-01-20 12:38 p.m., Dan Williams wrote:
> ...common reference count handling scenarios were addressed, but the
> shutdown-synchronization problem was only mentioned as something driver
> developers need to be aware in the following note:
>
> NOTE: This guarantees that associated
On 2020-12-10 12:25 p.m., Thomas Gleixner wrote:
> Use the proper core function.
>
> Signed-off-by: Thomas Gleixner
> Cc: Jon Mason
> Cc: Dave Jiang
> Cc: Allen Hubbe
> Cc: linux-...@googlegroups.com
Looks good to me.
Reviewed-by: Logan Gunthorpe
> ---
>
On 2020-12-09 9:04 p.m., Dan Williams wrote:
> On Wed, Dec 9, 2020 at 6:07 PM Logan Gunthorpe wrote:
>>
>>
>>
>> On 2020-12-09 6:22 p.m., Dan Williams wrote:
>>> On Mon, Nov 9, 2020 at 8:47 AM Logan Gunthorpe wrote:
>>>>
>>>>
On 2020-12-09 6:22 p.m., Dan Williams wrote:
> On Mon, Nov 9, 2020 at 8:47 AM Logan Gunthorpe wrote:
>>
>>
>>
>> On 2020-11-09 2:12 a.m., Christoph Hellwig wrote:
>>> On Fri, Nov 06, 2020 at 10:00:25AM -0700, Logan Gunthorpe wrote:
>>>> We make
On 2020-12-02 3:14 a.m., Christoph Hellwig wrote:>>
MEMORY_DEVICE_PCI_P2PDMA:
>> Struct pages are created in pci_p2pdma_add_resource() and represent device
>> memory accessible by PCIe bar address space. Memory is allocated with
>> pci_alloc_p2pmem() based on a byte length but the
ly need to make different patches for the other two vintages.
> Signed-off-by: Colin Ian King
Besides that, the change makes sense to me.
Reviewed-by: Logan Gunthorpe
Thanks,
Logan
On 2020-11-10 4:25 p.m., Bjorn Helgaas wrote:
> On Fri, Nov 06, 2020 at 10:00:24AM -0700, Logan Gunthorpe wrote:
>> Introduce pci_p2pdma_should_map_bus() which is meant to be called by
>> dma map functions to determine how to map a given p2pdma page.
>
> s/dma/DMA/ for co
On 2020-11-09 8:03 a.m., Keith Busch wrote:
> On Fri, Nov 06, 2020 at 10:00:36AM -0700, Logan Gunthorpe wrote:
>> Allow userspace to obtain CMB memory by mmaping the controller's
>> char device. The mmap call allocates and returns a hunk of CMB memory,
>> (the offset is
On 2020-11-09 2:12 a.m., Christoph Hellwig wrote:
> On Fri, Nov 06, 2020 at 10:00:25AM -0700, Logan Gunthorpe wrote:
>> We make use of the top bit of the dma_length to indicate a P2PDMA
>> segment.
>
> I don't think "we" can. There is nothing limiting the s
On 2020-11-06 5:14 p.m., Jason Gunthorpe wrote:
> On Fri, Nov 06, 2020 at 01:03:26PM -0700, Logan Gunthorpe wrote:
>> I don't think a function like that will work for the p2pmem use case. In
>> order to implement proper page freeing I expect I'll need a loop around
&
On 2020-11-06 12:53 p.m., Jason Gunthorpe wrote:
> On Fri, Nov 06, 2020 at 12:44:59PM -0700, Logan Gunthorpe wrote:
>>
>>
>> On 2020-11-06 12:30 p.m., Jason Gunthorpe wrote:
>>>> I certainly can't make decisions for code that isn't currently
>>>&g
On 2020-11-06 12:30 p.m., Jason Gunthorpe wrote:
>> I certainly can't make decisions for code that isn't currently
>> upstream.
>
> The rdma drivers are all upstream, what are you thinking about?
Really? I feel like you should know what I mean here...
I mean upstream code that actually uses
On 2020-11-06 11:09 a.m., Jason Gunthorpe wrote:
>> Ah, hmm, yes. I guess the pages have to be hooked and returned to the
>> genalloc through free_devmap_managed_page().
>
> That sounds about right, but in this case it doesn't need the VMA
> operations.
>
>> Seems like it might be doable...
On 2020-11-06 10:42 a.m., Jason Gunthorpe wrote:
> On Fri, Nov 06, 2020 at 10:28:00AM -0700, Logan Gunthorpe wrote:
>>
>>
>> On 2020-11-06 10:22 a.m., Jason Gunthorpe wrote:
>>> On Fri, Nov 06, 2020 at 10:00:35AM -0700, Logan Gunthorpe wrote:
>>>> Int
On 2020-11-06 10:39 a.m., Jason Gunthorpe wrote:
> On Fri, Nov 06, 2020 at 10:00:36AM -0700, Logan Gunthorpe wrote:
>> Allow userspace to obtain CMB memory by mmaping the controller's
>> char device. The mmap call allocates and returns a hunk of CMB memory,
>> (the
On 2020-11-06 10:22 a.m., Jason Gunthorpe wrote:
> On Fri, Nov 06, 2020 at 10:00:35AM -0700, Logan Gunthorpe wrote:
>> Introduce pci_mmap_p2pmem() which is a helper to allocate and mmap
>> a hunk of p2pmem into userspace.
>>
>> Signed-off-by: Logan Gunthorp
-by: Logan Gunthorpe
---
include/linux/dma-mapping.h | 11 +++
kernel/dma/direct.c | 33 +++--
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 956151052d45..8d028e15b531 100644
Add a flags member to the dma_map_ops structure with one flag to
indicate support for PCI P2PDMA.
Also, add a helper to check if a device supports PCI P2PDMA.
Signed-off-by: Logan Gunthorpe
---
include/linux/dma-map-ops.h | 3 +++
include/linux/dma-mapping.h | 5 +
kernel/dma/mapping.c
.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index 94583779c36e..ea8472278b11 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -824,11 +824,17
When a bio's queue supports PCI P2PDMA, set FOLL_PCI_P2PDMA for
iov_iter_get_pages_flags(). This allows PCI P2PDMA pages to be
passed from userspace and enables the NVMe passthru requests to
use P2PDMA pages.
Signed-off-by: Logan Gunthorpe
---
block/blk-map.c | 7 ++-
1 file changed, 6
When a bio's queue supports PCI P2PDMA, set FOLL_PCI_P2PDMA for
iov_iter_get_pages_flags(). This allows PCI P2PDMA pages to be passed
from userspace and enables the O_DIRECT path in iomap based filesystems
and direct to block devices.
Signed-off-by: Logan Gunthorpe
---
block/bio.c | 7
).
Using DMA_ATTR_P2PDMA is safe because the block layer restricts
requests to be much less than 2GB, thus there's no way for a
segment to be greater than 2GB.
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/host/pci.c | 30 --
1 file changed, 12 insertions(+), 18
Add iov_iter_get_pages_flags() and iov_iter_get_pages_alloc_flags()
which take a flags argument that is passed to get_user_pages_fast().
This is so that FOLL_PCI_P2PDMA can be passed when appropriate.
Signed-off-by: Logan Gunthorpe
---
include/linux/uio.h | 21 +
lib
Introduce pci_mmap_p2pmem() which is a helper to allocate and mmap
a hunk of p2pmem into userspace.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 104 +
include/linux/pci-p2pdma.h | 6 +++
2 files changed, 110 insertions(+)
diff --git
Introduce a supports_pci_p2pdma() operation in nvme_ctrl_ops to
replace the fixed NVME_F_PCI_P2PDMA flag such that the dma_map_ops
flags can be checked for PCI P2PDMA support.
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/host/core.c | 3 ++-
drivers/nvme/host/nvme.h | 2 +-
drivers/nvme
to DMA_F_PCI_P2PDMA_SUPPORTED to indicate support for
P2PDMA pages.
Signed-off-by: Logan Gunthorpe
---
drivers/iommu/dma-iommu.c | 63 ---
1 file changed, 53 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 5591d6593583
for converting the Intel IOMMU to dma-iommu[1]. A git
branch is available here:
https://github.com/sbates130272/linux-p2pmem/ p2pdma_user_cmb_rfc
Thanks,
Logan
[1]
https://lkml.kernel.org/lkml/20200927063437.13988-1-baolu...@linux.intel.com/T/#u.
Logan Gunthorpe (15):
PCI/P2PDMA: Don't
.
Signed-off-by: Logan Gunthorpe
---
drivers/pci/p2pdma.c | 17 +
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
index de1c331dbed4..94583779c36e 100644
--- a/drivers/pci/p2pdma.c
+++ b/drivers/pci/p2pdma.c
@@ -267,7 +267,7
Callers that expect PCI P2PDMA pages can now set FOLL_PCI_P2PDMA to
allow obtaining P2PDMA pages. If a caller does not set this flag
and tries to map P2PDMA pages it will fail.
This is implemented by adding a flag and a check to get_dev_pagemap().
Signed-off-by: Logan Gunthorpe
---
drivers/dax
Introduce pci_p2pdma_should_map_bus() which is meant to be called by
dma map functions to determine how to map a given p2pdma page.
pci_p2pdma_bus_offset() is also added to allow callers to get the bus
offset if they need to map the bus address.
Signed-off-by: Logan Gunthorpe
---
drivers/pci
FOLL_PCI_P2PDMA when calling GUP. And inter-device support will be
checked the first time the pages are mapped for DMA.
Currently this is only supported by O_DIRECT to an PCI NVMe device
or through the NVMe passthrough IOCTL.
Signed-off-by: Logan Gunthorpe
---
drivers/nvme/host/core.c | 11
We make use of the top bit of the dma_length to indicate a P2PDMA
segment. Code that uses this will need to use sg_dma_p2pdma_len() to
get the length and ensure no lengths exceed 2GB.
An sg_dma_is_p2pdma() helper is included to check if a particular
segment is p2pdma().
Signed-off-by: Logan
On 2020-10-22 4:04 p.m., Omar Sandoval wrote:
> On Thu, Oct 22, 2020 at 12:45:25PM -0600, Logan Gunthorpe wrote:
>>
>> On 2020-10-08 10:40 a.m., Logan Gunthorpe wrote:
>>> Hi,
>>>
>>> This series adds blktests for the nvmet passthru feature that wa
On 2020-10-08 10:40 a.m., Logan Gunthorpe wrote:
> Hi,
>
> This series adds blktests for the nvmet passthru feature that was merged
> for 5.9. It's been reconciled with Sagi's blktest series that Omar
> recently merged.
Bump. This has been around for a while now. Omar, can you
- Collected Chaitanya's reviewed-by tag
--
Logan Gunthorpe (11):
common/fio: Remove state file in common helper
common/xfs: Create common helper to check for XFS support
common/xfs: Create common helper to verify block device with xfs
nvme: Search for specific subsysnqn
Instead of each individual test removing this file, just do it
in the common helper.
Signed-off-by: Logan Gunthorpe
Reviewed-by: Chaitanya Kulkarni
---
common/fio | 1 +
tests/nvme/010 | 1 -
tests/nvme/011 | 1 -
tests/nvme/012 | 1 -
tests/nvme/013 | 1 -
5 files changed, 1 insertion
This tests creates and connects to a passthru controller backed
by a test NVMe namespace. It then verifies that some common fields
in id-ctrl and id-ns are the same in the target and the orginial
device.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/033 | 67
Make a common helper from the code in tests nvme/012 and nvme/013
to run an fio verify on a XFS file system backed by the
specified block device.
While we are at it, all the output is redirected to $FULL instead of
/dev/null.
Signed-off-by: Logan Gunthorpe
---
common/xfs | 22
Two nvme tests create and mount XFS filesystems and check for mkfs.xfs.
They should also check for XFS support in the kernel so create a common
helper for this.
Signed-off-by: Logan Gunthorpe
---
common/rc | 8
common/xfs | 11 +++
tests/nvme/012 | 6 --
tests
Test that we can remove a subsystem that has not been enabled by
passthru or any ns. Do the same for ports while we are at it.
This was an issue in the original passthru patches and is
not commonly tested. So this test will ensure we don't regress this.
Signed-off-by: Logan Gunthorpe
---
tests
Add some simple helpers to setup a passthru target that passes through
to a nvme test device.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/rc | 75 +++
1 file changed, 75 insertions(+)
diff --git a/tests/nvme/rc b/tests/nvme/rc
index
Similar to test nvme/031 except for passthru controllers.
Note: it's normal to get I/O errors in this test as when the controller
disconnects it races with the partition table read.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/037 | 35 +++
tests/nvme/037
This ensures we find the correct nvme loop device if others exist on a
given system (which is generally not expected on test systems).
Additionally, this will be required in the upcomming test nvme/037 which
will have controllers racing with ones being destroyed.
Signed-off-by: Logan Gunthorpe
This is a similar test as nvme/012 and nvme/013, except with a
passthru controller.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/035 | 37 +
tests/nvme/035.out | 3 +++
2 files changed, 40 insertions(+)
create mode 100755 tests/nvme/035
create mode
Similar to test 022 but for passthru controllers.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/036 | 37 +
tests/nvme/036.out | 3 +++
2 files changed, 40 insertions(+)
create mode 100755 tests/nvme/036
create mode 100644 tests/nvme/036.out
diff
Similar to test nvme/010 and nvme/011 but for a passthru controller
Signed-off-by: Logan Gunthorpe
---
tests/nvme/034 | 35 +++
tests/nvme/034.out | 3 +++
2 files changed, 38 insertions(+)
create mode 100755 tests/nvme/034
create mode 100644 tests/nvme
On 2020-10-06 6:24 p.m., Chaitanya Kulkarni wrote:
> On 10/6/20 17:10, Logan Gunthorpe wrote:
>>> With this patch or this series will I be able to write the testcase ?
>> This patch helps with that but other helpers introduced in this series
>> would require minor change
On 2020-10-06 6:20 p.m., Chaitanya Kulkarni wrote:
> On 10/6/20 16:59, Logan Gunthorpe wrote:
>>> The mount dir should be a parameter and not the hardcode value
>>> to make it reusable.
>> I also disagree here. It is already reusable and is used in a number of
>
On 2020-10-06 6:02 p.m., Chaitanya Kulkarni wrote:
> On 9/30/20 12:01, Logan Gunthorpe wrote:
>> Add some simple helpers to setup a passthru target that passes through
>> to a nvme test device.
>>
>> Signed-off-by: Logan Gunthorpe
&g
On 2020-10-06 5:55 p.m., Chaitanya Kulkarni wrote:
> On 9/30/20 11:54, Logan Gunthorpe wrote:
>> This ensures we find the correct nvme loop device if others exist on a
>> given system (which is generally not expected on test systems).
>>
>> Additionally, this will b
On 2020-10-06 5:50 p.m., Chaitanya Kulkarni wrote:
> On 9/30/20 11:54, Logan Gunthorpe wrote:
>> Make a common helper from the code in tests nvme/012 and nvme/013
>> to run an fio verify on a XFS file system backed by the
>> specified block device.
>>
>> W
On 2020-10-06 5:44 p.m., Chaitanya Kulkarni wrote:
> On 9/30/20 11:54, Logan Gunthorpe wrote:
>>
>> requires() {
>> _nvme_requires
>> -_have_program mkfs.xfs && _have_fio
>> +_have_xfs
>> +_have_fio
> Can you ma
I've sent to that maintainer).
Tested-By: Logan Gunthorpe
Thanks,
Logan
Similar to test 022 but for passthru controllers.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/036 | 37 +
tests/nvme/036.out | 3 +++
2 files changed, 40 insertions(+)
create mode 100755 tests/nvme/036
create mode 100644 tests/nvme/036.out
diff
Two nvme tests create and mount XFS filesystems and check for mkfs.xfs.
They should also check for XFS support in the kernel so create a common
helper for this.
Signed-off-by: Logan Gunthorpe
---
common/rc | 8
common/xfs | 11 +++
tests/nvme/012 | 6 --
tests
This is a similar test as nvme/012 and nvme/013, except with a
passthru controller.
Signed-off-by: Logan Gunthorpe
---
tests/nvme/035 | 37 +
tests/nvme/035.out | 3 +++
2 files changed, 40 insertions(+)
create mode 100755 tests/nvme/035
create mode
1 - 100 of 2689 matches
Mail list logo