[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acaa91df-f932-7449-3623-4209c41634d9@deltatee.com>
Date: Thu, 30 Sep 2021 10:51:22 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Chaitanya Kulkarni <chaitanyak@...dia.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>
Cc: Stephen Bates <sbates@...thlin.com>,
Christoph Hellwig <hch@....de>,
Dan Williams <dan.j.williams@...el.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Christian König <christian.koenig@....com>,
John Hubbard <jhubbard@...dia.com>,
Don Dutile <ddutile@...hat.com>,
Matthew Wilcox <willy@...radead.org>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Jakowski Andrzej <andrzej.jakowski@...el.com>,
Minturn Dave B <dave.b.minturn@...el.com>,
Jason Ekstrand <jason@...kstrand.net>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Xiong Jianxin <jianxin.xiong@...el.com>,
Bjorn Helgaas <helgaas@...nel.org>,
Ira Weiny <ira.weiny@...el.com>,
Robin Murphy <robin.murphy@....com>,
Martin Oliveira <martin.oliveira@...eticom.com>,
Chaitanya Kulkarni <ckulkarnilinux@...il.com>
Subject: Re: [PATCH v3 09/20] nvme-pci: check DMA ops when indicating support
for PCI P2PDMA
On 2021-09-29 11:06 p.m., Chaitanya Kulkarni wrote:
> Logan,
>
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 7efb31b87f37..916750a54f60 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -3771,7 +3771,8 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid,
>> blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, ns->queue);
>>
>> blk_queue_flag_set(QUEUE_FLAG_NONROT, ns->queue);
>> - if (ctrl->ops->flags & NVME_F_PCI_P2PDMA)
>> + if (ctrl->ops->supports_pci_p2pdma &&
>> + ctrl->ops->supports_pci_p2pdma(ctrl))
>> blk_queue_flag_set(QUEUE_FLAG_PCI_P2PDMA, ns->queue);
>>
>> ns->ctrl = ctrl;
>> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
>> index 9871c0c9374c..fb9bfc52a6d7 100644
>> --- a/drivers/nvme/host/nvme.h
>> +++ b/drivers/nvme/host/nvme.h
>> @@ -477,7 +477,6 @@ struct nvme_ctrl_ops {
>> unsigned int flags;
>> #define NVME_F_FABRICS (1 << 0)
>> #define NVME_F_METADATA_SUPPORTED (1 << 1)
>> -#define NVME_F_PCI_P2PDMA (1 << 2)
>> int (*reg_read32)(struct nvme_ctrl *ctrl, u32 off, u32 *val);
>> int (*reg_write32)(struct nvme_ctrl *ctrl, u32 off, u32 val);
>> int (*reg_read64)(struct nvme_ctrl *ctrl, u32 off, u64 *val);
>> @@ -485,6 +484,7 @@ struct nvme_ctrl_ops {
>> void (*submit_async_event)(struct nvme_ctrl *ctrl);
>> void (*delete_ctrl)(struct nvme_ctrl *ctrl);
>> int (*get_address)(struct nvme_ctrl *ctrl, char *buf, int size);
>> + bool (*supports_pci_p2pdma)(struct nvme_ctrl *ctrl);
>> };
>>
>
> Is this new ops only needed for the PCIe transport ? or do you have
> following patches to use this op for the other transports ?
No, I don't think this will make sense for transports that are not based
on PCI devices.
> If it is only needed for the PCIe then we need to find a way to
> not add this somehow...
I don't see how we can do that. The core code needs to know whether the
transport supports this and must have an operation to query it.
Logan
Powered by blists - more mailing lists