All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [SPDK] PCIe hotplug support using VFIO for NVMf
@ 2018-05-11  5:05 Jitendra Bhivare
  0 siblings, 0 replies; 6+ messages in thread
From: Jitendra Bhivare @ 2018-05-11  5:05 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3841 bytes --]

Using RPC to delete first, controlled hotunplug too works fine.

Thanks,

JB

> -----Original Message-----
> From: Jitendra Bhivare [mailto:jitendra.bhivare(a)broadcom.com]
> Sent: Wednesday, May 9, 2018 5:03 PM
> To: 'Storage Performance Development Kit' <spdk(a)lists.01.org>
> Subject: RE: [SPDK] PCIe hotplug support using VFIO for NVMf
>
> Thanks a lot Jim.
>
> Missed that. In our platform CSTS read value is 0 after surprise
> hotunplug.
> Adding !csts.bits.rdy check makes hotplug working fine.
> I think we would still need KOBJ event for controlled hotunplug done by
> echo'ing in remove sysfs entry.
> For that we will have to send something like KOBJ_CHANGE/KOBJ_UNBIND
> to SPDK and parse it.
>
> Regards,
>
> JB
>
> > -----Original Message-----
> > From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Harris,
> > James R
> > Sent: Tuesday, May 8, 2018 7:06 PM
> > To: Storage Performance Development Kit <spdk(a)lists.01.org>
> > Subject: Re: [SPDK] PCIe hotplug support using VFIO for NVMf
> >
> > Hi Jitendra,
> >
> > There’s a loop at the end of _nvme_pcie_hotplug_monitor that is
> > supposed to work around this circular dependency.  It periodically
> > reads a register on the device to check if it’s been removed.  This
> > loop was adding prior to the
> > v18.01 release.  Can you instrument that loop to see if it is
> > triggering?
> >
> > Thanks,
> >
> > -Jim
> >
> >
> > On 5/8/18, 3:42 AM, "SPDK on behalf of Jitendra Bhivare" <spdk-
> > bounces(a)lists.01.org on behalf of jitendra.bhivare(a)broadcom.com>
> wrote:
> >
> >     > For this to work I think we need an eventfd mechanism to notify
> > SPDK
> of
> >     device removal from VFIO.
> >     Or a better approach, to generate KOBJ_CHANGE for vfio-pci driver
> > kobject.
> >
> >     From: Jitendra Bhivare [mailto:jitendra.bhivare(a)broadcom.com]
> >     Sent: Tuesday, May 8, 2018 12:11 PM
> >     To: 'spdk(a)lists.01.org' <spdk(a)lists.01.org>
> >     Subject: PCIe hotplug support using VFIO for NVMf
> >
> >     Hi All,
> >
> >     I am trying to use PCIe hotplug feature in SPDK v18.01 (with DPDK
> v17.11)
> >     for NVMf by setting in conf file HotplugEnable to Yes. It is not
> > working.
> >     All the IOs get stuck on initiator side and nvmf_tgt does not even
> > respond
> >     to nvme discovery query after that.
> >
> >     nvmf_tgt opens a netlink socket to listen on KOBJ events. Using VFIO
> >     claimed NVMe PCIe devices, when a PCIe device is removed
> > vfio_pci_remove
> >     waits for all references to the device added in IOMMU group to be
> > dropped
> >     in vfio_del_group_dev.
> >
> >     This reference will only be dropped after SPDK unloads the NVME PCIe
> >     driver. For that to happen it is waiting for the KOBJ events. KOBJ
> > events
> >     won't happen till vfio_pci_remove releases the device.
> >
> >     So we kinda reached a deadlock with circular dependency on release
> > of
> the
> >     device.
> >
> >     Can someone please explain how this feature is working?
> >
> >     For this to work I think we need an eventfd mechanism to notify SPDK
> > of
> >     device removal from VFIO.
> >     I am trying to integrate such a thing bit of a redundant approach
> > made
> >     specifically for VFIO devices.
> >
> >     Please do let me know if we have better option or working on better
> >     approach to make this work.
> >
> >     Thanks,
> >
> >     JB
> >     _______________________________________________
> >     SPDK mailing list
> >     SPDK(a)lists.01.org
> >     https://lists.01.org/mailman/listinfo/spdk
> >
> >
> > _______________________________________________
> > SPDK mailing list
> > SPDK(a)lists.01.org
> > https://lists.01.org/mailman/listinfo/spdk

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

* Re: [SPDK] PCIe hotplug support using VFIO for NVMf
@ 2018-05-09 11:32 Jitendra Bhivare
  0 siblings, 0 replies; 6+ messages in thread
From: Jitendra Bhivare @ 2018-05-09 11:32 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3276 bytes --]

Thanks a lot Jim.

Missed that. In our platform CSTS read value is 0 after surprise hotunplug.
Adding !csts.bits.rdy check makes hotplug working fine.
I think we would still need KOBJ event for controlled hotunplug done by
echo'ing in remove sysfs entry.
For that we will have to send something like KOBJ_CHANGE/KOBJ_UNBIND to SPDK
and parse it.

Regards,

JB

> -----Original Message-----
> From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Harris, James R
> Sent: Tuesday, May 8, 2018 7:06 PM
> To: Storage Performance Development Kit <spdk(a)lists.01.org>
> Subject: Re: [SPDK] PCIe hotplug support using VFIO for NVMf
>
> Hi Jitendra,
>
> There’s a loop at the end of _nvme_pcie_hotplug_monitor that is supposed
> to work around this circular dependency.  It periodically reads a register
> on
> the device to check if it’s been removed.  This loop was adding prior to
> the
> v18.01 release.  Can you instrument that loop to see if it is triggering?
>
> Thanks,
>
> -Jim
>
>
> On 5/8/18, 3:42 AM, "SPDK on behalf of Jitendra Bhivare" <spdk-
> bounces(a)lists.01.org on behalf of jitendra.bhivare(a)broadcom.com> wrote:
>
>     > For this to work I think we need an eventfd mechanism to notify SPDK
> of
>     device removal from VFIO.
>     Or a better approach, to generate KOBJ_CHANGE for vfio-pci driver
> kobject.
>
>     From: Jitendra Bhivare [mailto:jitendra.bhivare(a)broadcom.com]
>     Sent: Tuesday, May 8, 2018 12:11 PM
>     To: 'spdk(a)lists.01.org' <spdk(a)lists.01.org>
>     Subject: PCIe hotplug support using VFIO for NVMf
>
>     Hi All,
>
>     I am trying to use PCIe hotplug feature in SPDK v18.01 (with DPDK
> v17.11)
>     for NVMf by setting in conf file HotplugEnable to Yes. It is not
> working.
>     All the IOs get stuck on initiator side and nvmf_tgt does not even
> respond
>     to nvme discovery query after that.
>
>     nvmf_tgt opens a netlink socket to listen on KOBJ events. Using VFIO
>     claimed NVMe PCIe devices, when a PCIe device is removed
> vfio_pci_remove
>     waits for all references to the device added in IOMMU group to be
> dropped
>     in vfio_del_group_dev.
>
>     This reference will only be dropped after SPDK unloads the NVME PCIe
>     driver. For that to happen it is waiting for the KOBJ events. KOBJ
> events
>     won't happen till vfio_pci_remove releases the device.
>
>     So we kinda reached a deadlock with circular dependency on release of
> the
>     device.
>
>     Can someone please explain how this feature is working?
>
>     For this to work I think we need an eventfd mechanism to notify SPDK
> of
>     device removal from VFIO.
>     I am trying to integrate such a thing bit of a redundant approach made
>     specifically for VFIO devices.
>
>     Please do let me know if we have better option or working on better
>     approach to make this work.
>
>     Thanks,
>
>     JB
>     _______________________________________________
>     SPDK mailing list
>     SPDK(a)lists.01.org
>     https://lists.01.org/mailman/listinfo/spdk
>
>
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk

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

* Re: [SPDK] PCIe hotplug support using VFIO for NVMf
@ 2018-05-08 13:36 Harris, James R
  0 siblings, 0 replies; 6+ messages in thread
From: Harris, James R @ 2018-05-08 13:36 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]

Hi Jitendra,

There’s a loop at the end of _nvme_pcie_hotplug_monitor that is supposed to work around this circular dependency.  It periodically reads a register on the device to check if it’s been removed.  This loop was adding prior to the v18.01 release.  Can you instrument that loop to see if it is triggering?

Thanks,

-Jim


On 5/8/18, 3:42 AM, "SPDK on behalf of Jitendra Bhivare" <spdk-bounces(a)lists.01.org on behalf of jitendra.bhivare(a)broadcom.com> wrote:

    > For this to work I think we need an eventfd mechanism to notify SPDK of
    device removal from VFIO.
    Or a better approach, to generate KOBJ_CHANGE for vfio-pci driver kobject.
    
    From: Jitendra Bhivare [mailto:jitendra.bhivare(a)broadcom.com]
    Sent: Tuesday, May 8, 2018 12:11 PM
    To: 'spdk(a)lists.01.org' <spdk(a)lists.01.org>
    Subject: PCIe hotplug support using VFIO for NVMf
    
    Hi All,
    
    I am trying to use PCIe hotplug feature in SPDK v18.01 (with DPDK v17.11)
    for NVMf by setting in conf file HotplugEnable to Yes. It is not working.
    All the IOs get stuck on initiator side and nvmf_tgt does not even respond
    to nvme discovery query after that.
    
    nvmf_tgt opens a netlink socket to listen on KOBJ events. Using VFIO
    claimed NVMe PCIe devices, when a PCIe device is removed vfio_pci_remove
    waits for all references to the device added in IOMMU group to be dropped
    in vfio_del_group_dev.
    
    This reference will only be dropped after SPDK unloads the NVME PCIe
    driver. For that to happen it is waiting for the KOBJ events. KOBJ events
    won't happen till vfio_pci_remove releases the device.
    
    So we kinda reached a deadlock with circular dependency on release of the
    device.
    
    Can someone please explain how this feature is working?
    
    For this to work I think we need an eventfd mechanism to notify SPDK of
    device removal from VFIO.
    I am trying to integrate such a thing bit of a redundant approach made
    specifically for VFIO devices.
    
    Please do let me know if we have better option or working on better
    approach to make this work.
    
    Thanks,
    
    JB
    _______________________________________________
    SPDK mailing list
    SPDK(a)lists.01.org
    https://lists.01.org/mailman/listinfo/spdk
    


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

* Re: [SPDK] PCIe hotplug support using VFIO for NVMf
@ 2018-05-08 10:42 Jitendra Bhivare
  0 siblings, 0 replies; 6+ messages in thread
From: Jitendra Bhivare @ 2018-05-08 10:42 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]

> For this to work I think we need an eventfd mechanism to notify SPDK of
device removal from VFIO.
Or a better approach, to generate KOBJ_CHANGE for vfio-pci driver kobject.

From: Jitendra Bhivare [mailto:jitendra.bhivare(a)broadcom.com]
Sent: Tuesday, May 8, 2018 12:11 PM
To: 'spdk(a)lists.01.org' <spdk(a)lists.01.org>
Subject: PCIe hotplug support using VFIO for NVMf

Hi All,

I am trying to use PCIe hotplug feature in SPDK v18.01 (with DPDK v17.11)
for NVMf by setting in conf file HotplugEnable to Yes. It is not working.
All the IOs get stuck on initiator side and nvmf_tgt does not even respond
to nvme discovery query after that.

nvmf_tgt opens a netlink socket to listen on KOBJ events. Using VFIO
claimed NVMe PCIe devices, when a PCIe device is removed vfio_pci_remove
waits for all references to the device added in IOMMU group to be dropped
in vfio_del_group_dev.

This reference will only be dropped after SPDK unloads the NVME PCIe
driver. For that to happen it is waiting for the KOBJ events. KOBJ events
won't happen till vfio_pci_remove releases the device.

So we kinda reached a deadlock with circular dependency on release of the
device.

Can someone please explain how this feature is working?

For this to work I think we need an eventfd mechanism to notify SPDK of
device removal from VFIO.
I am trying to integrate such a thing bit of a redundant approach made
specifically for VFIO devices.

Please do let me know if we have better option or working on better
approach to make this work.

Thanks,

JB

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

* [SPDK] PCIe hotplug support using VFIO for NVMf
@ 2018-05-08  6:41 Jitendra Bhivare
  0 siblings, 0 replies; 6+ messages in thread
From: Jitendra Bhivare @ 2018-05-08  6:41 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]

Hi All,



I am trying to use PCIe hotplug feature in SPDK v18.01 (with DPDK v17.11)
for NVMf by setting in conf file HotplugEnable to Yes. It is not working.
All the IOs get stuck on initiator side and nvmf_tgt does not even respond
to nvme discovery query after that.

nvmf_tgt opens a netlink socket to listen on KOBJ events. Using VFIO
claimed NVMe PCIe devices, when a PCIe device is removed vfio_pci_remove
waits for all references to the device added in IOMMU group to be dropped
in vfio_del_group_dev.



This reference will only be dropped after SPDK unloads the NVME PCIe
driver. For that to happen it is waiting for the KOBJ events. KOBJ events
won't happen till vfio_pci_remove releases the device.



So we kinda reached a deadlock with circular dependency on release of the
device.



Can someone please explain how this feature is working?



For this to work I think we need an eventfd mechanism to notify SPDK of
device removal from VFIO.

I am trying to integrate such a thing bit of a redundant approach made
specifically for VFIO devices.



Please do let me know if we have better option or working on better
approach to make this work.



Thanks,



JB

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3170 bytes --]

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

* [SPDK] PCIe hotplug support using VFIO for NVMf
@ 2018-05-08  6:18 Jitendra Bhivare
  0 siblings, 0 replies; 6+ messages in thread
From: Jitendra Bhivare @ 2018-05-08  6:18 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

Hi All,

I am trying to use PCIe hotplug feature in SPDK v18.01 (with DPDK v17.11)
for NVMf by setting in conf file
HotplugEnable to Yes. It is not working. All the IOs get stuck on
initiator side and nvmf_tgt does not even
respond to nvme discovery query after that.

nvmf_tgt opens a netlink socket to listen on KOBJ events. Using VFIO
claimed NVMe PCIe devices, when a
PCIe device is removed vfio_pci_remove waits for all references to the
device added in IOMMU group to
be dropped in vfio_del_group_dev.

This reference will only be dropped after SPDK unloads the NVME PCIe
driver. For that to happen it is
waiting for the KOBJ events. KOBJ events won't happen till vfio_pci_remove
releases the device.

So we kinda reached a deadlock with circular dependency on release of the
device.

Can someone please explain how this feature is working?

For this to work I think we need an eventfd mechanism to notify SPDK of
device removal from VFIO.
I am trying to integrate such a thing bit of a redundant approach made
specifically for VFIO devices.

Please do let me know if we have better option or working on better
approach to make this work.

Thanks,

JB

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

end of thread, other threads:[~2018-05-11  5:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11  5:05 [SPDK] PCIe hotplug support using VFIO for NVMf Jitendra Bhivare
  -- strict thread matches above, loose matches on Subject: below --
2018-05-09 11:32 Jitendra Bhivare
2018-05-08 13:36 Harris, James R
2018-05-08 10:42 Jitendra Bhivare
2018-05-08  6:41 Jitendra Bhivare
2018-05-08  6:18 Jitendra Bhivare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.