Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1276501 > unrolled thread
| Started by | Lan Tianyu <tianyu.lan@intel.com> |
|---|---|
| First post | 2015-11-24 15:00 +0100 |
| Last post | 2015-11-30 08:00 +0100 |
| Articles | 9 — 4 participants |
Back to article view | Back to linux.kernel
[RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Lan Tianyu <tianyu.lan@intel.com> - 2015-11-24 15:00 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Alexander Duyck <alexander.duyck@gmail.com> - 2015-11-24 15:30 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Lan Tianyu <tianyu.lan@intel.com> - 2015-11-25 04:40 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Alexander Duyck <alexander.duyck@gmail.com> - 2015-11-25 06:40 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Lan Tianyu <tianyu.lan@intel.com> - 2015-11-25 09:40 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Alexander Duyck <alexander.duyck@gmail.com> - 2015-11-25 16:40 +0100
RE: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC "Dong, Eddie" <eddie.dong@intel.com> - 2015-11-26 04:20 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC Alexander Duyck <alexander.duyck@gmail.com> - 2015-11-26 05:00 +0100
Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC "Lan, Tianyu" <tianyu.lan@intel.com> - 2015-11-30 08:00 +0100
| From | Lan Tianyu <tianyu.lan@intel.com> |
|---|---|
| Date | 2015-11-24 15:00 +0100 |
| Subject | [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qymit-n6-3@gated-at.bofh.it> |
This patchset is to propose a solution of adding live migration support for SRIOV NIC. During migration, Qemu needs to let VF driver in the VM to know migration start and end. Qemu adds faked PCI migration capability to help to sync status between two sides during migration. Qemu triggers VF's mailbox irq via sending MSIX msg when migration status is changed. VF driver tells Qemu its mailbox vector index via the new PCI capability. In some cases(NIC is suspended or closed), VF mailbox irq is freed and VF driver can disable irq injecting via new capability. VF driver will put down nic before migration and put up again on the target machine. Lan Tianyu (3): VFIO: Add new ioctl cmd VFIO_GET_PCI_CAP_INFO PCI: Add macros for faked PCI migration capability Ixgbevf: Add migration support for ixgbevf driver drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 ++ drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 102 ++++++++++++++++++++++ drivers/vfio/pci/vfio_pci.c | 21 +++++ drivers/vfio/pci/vfio_pci_config.c | 38 ++++++-- drivers/vfio/pci/vfio_pci_private.h | 5 ++ include/uapi/linux/pci_regs.h | 18 +++- include/uapi/linux/vfio.h | 12 +++ 7 files changed, 194 insertions(+), 7 deletions(-) -- 1.8.4.rc0.1.g8f6a3e5.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Alexander Duyck <alexander.duyck@gmail.com> |
|---|---|
| Date | 2015-11-24 15:30 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qymLw-NR-11@gated-at.bofh.it> |
| In reply to | #1276501 |
On 11/24/2015 05:38 AM, Lan Tianyu wrote: > This patchset is to propose a solution of adding live migration > support for SRIOV NIC. > > During migration, Qemu needs to let VF driver in the VM to know > migration start and end. Qemu adds faked PCI migration capability > to help to sync status between two sides during migration. > > Qemu triggers VF's mailbox irq via sending MSIX msg when migration > status is changed. VF driver tells Qemu its mailbox vector index > via the new PCI capability. In some cases(NIC is suspended or closed), > VF mailbox irq is freed and VF driver can disable irq injecting via > new capability. > > VF driver will put down nic before migration and put up again on > the target machine. > > Lan Tianyu (3): > VFIO: Add new ioctl cmd VFIO_GET_PCI_CAP_INFO > PCI: Add macros for faked PCI migration capability > Ixgbevf: Add migration support for ixgbevf driver > > drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 ++ > drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 102 ++++++++++++++++++++++ > drivers/vfio/pci/vfio_pci.c | 21 +++++ > drivers/vfio/pci/vfio_pci_config.c | 38 ++++++-- > drivers/vfio/pci/vfio_pci_private.h | 5 ++ > include/uapi/linux/pci_regs.h | 18 +++- > include/uapi/linux/vfio.h | 12 +++ > 7 files changed, 194 insertions(+), 7 deletions(-) I'm still not a fan of this approach. I really feel like this is something that should be resolved by extending the existing PCI hot-plug rather than trying to instrument this per driver. Then you will get the goodness for multiple drivers and multiple OSes instead of just one. An added advantage to dealing with this in the PCI hot-plug environment would be that you could then still do a hot-plug even if the guest didn't load a driver for the VF since you would be working with the PCI slot instead of the device itself. - Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Lan Tianyu <tianyu.lan@intel.com> |
|---|---|
| Date | 2015-11-25 04:40 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qyz61-yf-3@gated-at.bofh.it> |
| In reply to | #1276513 |
On 2015年11月24日 22:20, Alexander Duyck wrote: > I'm still not a fan of this approach. I really feel like this is > something that should be resolved by extending the existing PCI hot-plug > rather than trying to instrument this per driver. Then you will get the > goodness for multiple drivers and multiple OSes instead of just one. An > added advantage to dealing with this in the PCI hot-plug environment > would be that you could then still do a hot-plug even if the guest > didn't load a driver for the VF since you would be working with the PCI > slot instead of the device itself. > > - Alex Hi Alex: What's you mentioned seems the bonding driver solution. Paper "Live Migration with Pass-through Device for Linux VM" describes it. It does VF hotplug during migration. In order to maintain Network connection when VF is out, it takes advantage of Linux bonding driver to switch between VF NIC and emulated NIC. But the side affects, that requires VM to do additional configure and the performance during switching two NIC is not good. -- Best regards Tianyu Lan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Alexander Duyck <alexander.duyck@gmail.com> |
|---|---|
| Date | 2015-11-25 06:40 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qyAY9-1PN-5@gated-at.bofh.it> |
| In reply to | #1276997 |
On Tue, Nov 24, 2015 at 7:18 PM, Lan Tianyu <tianyu.lan@intel.com> wrote: > On 2015年11月24日 22:20, Alexander Duyck wrote: >> I'm still not a fan of this approach. I really feel like this is >> something that should be resolved by extending the existing PCI hot-plug >> rather than trying to instrument this per driver. Then you will get the >> goodness for multiple drivers and multiple OSes instead of just one. An >> added advantage to dealing with this in the PCI hot-plug environment >> would be that you could then still do a hot-plug even if the guest >> didn't load a driver for the VF since you would be working with the PCI >> slot instead of the device itself. >> >> - Alex > > Hi Alex: > What's you mentioned seems the bonding driver solution. > Paper "Live Migration with Pass-through Device for Linux VM" describes > it. It does VF hotplug during migration. In order to maintain Network > connection when VF is out, it takes advantage of Linux bonding driver to > switch between VF NIC and emulated NIC. But the side affects, that > requires VM to do additional configure and the performance during > switching two NIC is not good. No, what I am getting at is that you can't go around and modify the configuration space for every possible device out there. This solution won't scale. If you instead moved the logic for notifying the device into a separate mechanism such as making it a part of the hot-plug logic then you only have to write the code once per OS in order to get the hot-plug capability to pause/resume the device. What I am talking about is not full hot-plug, but rather to extend the existing hot-plug in Qemu and the Linux kernel to support a "pause/resume" functionality. The PCI hot-plug specification calls out the option of implementing something like this, but we don't currently have support for it. I just feel doing it through PCI hot-plug messages will scale much better as you could likely make use of the power management suspend/resume calls to take care of most of the needed implementation details. - Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Lan Tianyu <tianyu.lan@intel.com> |
|---|---|
| Date | 2015-11-25 09:40 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qyDMm-3FO-19@gated-at.bofh.it> |
| In reply to | #1277025 |
On 2015年11月25日 13:30, Alexander Duyck wrote: > No, what I am getting at is that you can't go around and modify the > configuration space for every possible device out there. This > solution won't scale. PCI config space regs are emulation by Qemu and so We can find the free PCI config space regs for the faked PCI capability. Its position can be not permanent. > If you instead moved the logic for notifying > the device into a separate mechanism such as making it a part of the > hot-plug logic then you only have to write the code once per OS in > order to get the hot-plug capability to pause/resume the device. What > I am talking about is not full hot-plug, but rather to extend the > existing hot-plug in Qemu and the Linux kernel to support a > "pause/resume" functionality. The PCI hot-plug specification calls > out the option of implementing something like this, but we don't > currently have support for it. > Could you elaborate the part of PCI hot-plug specification you mentioned? My concern is whether it needs to change PCI spec or not. > I just feel doing it through PCI hot-plug messages will scale much > better as you could likely make use of the power management > suspend/resume calls to take care of most of the needed implementation > details. > > - Alex -- Best regards Tianyu Lan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Alexander Duyck <alexander.duyck@gmail.com> |
|---|---|
| Date | 2015-11-25 16:40 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qyKkO-87J-41@gated-at.bofh.it> |
| In reply to | #1277097 |
On Wed, Nov 25, 2015 at 12:21 AM, Lan Tianyu <tianyu.lan@intel.com> wrote: > On 2015年11月25日 13:30, Alexander Duyck wrote: >> No, what I am getting at is that you can't go around and modify the >> configuration space for every possible device out there. This >> solution won't scale. > > > PCI config space regs are emulation by Qemu and so We can find the free > PCI config space regs for the faked PCI capability. Its position can be > not permanent. Yes, but do you really want to edit every driver on every OS that you plan to support this on. What about things like direct assignment of regular Ethernet ports? What you really need is a solution that will work generically on any existing piece of hardware out there. >> If you instead moved the logic for notifying >> the device into a separate mechanism such as making it a part of the >> hot-plug logic then you only have to write the code once per OS in >> order to get the hot-plug capability to pause/resume the device. What >> I am talking about is not full hot-plug, but rather to extend the >> existing hot-plug in Qemu and the Linux kernel to support a >> "pause/resume" functionality. The PCI hot-plug specification calls >> out the option of implementing something like this, but we don't >> currently have support for it. >> > > Could you elaborate the part of PCI hot-plug specification you mentioned? > > My concern is whether it needs to change PCI spec or not. In the PCI Hot-Plug Specification 1.1, in section 4.1.2 it states: In addition to quiescing add-in card activity, an operating-system vendor may optionally implement a less drastic “pause” capability, in anticipation of the same or a similar add-in card being reinserted. The idea I had was basically if we were to implement something like that in Linux then we could pause/resume the device instead of outright removing it. The pause functionality could make use of the suspend/resume functionality most drivers already have for PCI power management. - Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Dong, Eddie" <eddie.dong@intel.com> |
|---|---|
| Date | 2015-11-26 04:20 +0100 |
| Subject | RE: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qyVgd-782-5@gated-at.bofh.it> |
| In reply to | #1277492 |
PiBPbiBXZWQsIE5vdiAyNSwgMjAxNSBhdCAxMjoyMSBBT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cyBpcyB0byBtb2RpZnkgdGhlIGRyaXZlciBpbiBn dWVzdCB0byBzZWxmLWVtdWxhdGUgb3IgdHJhY2sgdGhlIGRldmljZSBzdGF0ZSwgc28gdGhhdCB0 aGUgbWlncmF0aW9uIG1heSBiZSBwb3NzaWJsZS4NCkkgZG9uJ3QgdGhpbmsgd2UgY2FuIG1vZGlm eSBPUywgd2l0aG91dCBtb2RpZnlpbmcgdGhlIGRyaXZlcnMsIGV2ZW4gdXNpbmcgdGhlIFBDSWUg aG90cGx1ZyBtZWNoYW5pc20uICANCkluIHRoZSBtZWFudGltZSwgbW9kaWZ5aW5nIFdpbmRvd3Mg T1MgaXMgYSBiaWcgY2hhbGxlbmdlIGdpdmVuIHRoYXQgb25seSBNaWNyb3NvZnQgY2FuIGRvLiBX aGlsZSwgbW9kaWZ5aW5nIGRyaXZlciBpcyByZWxhdGl2ZWx5IHNpbXBsZSBhbmQgbWFuYWdlYWJs ZSB0byBkZXZpY2UgdmVuZG9ycywgaWYgdGhlIGRldmljZSB2ZW5kb3Igd2FudCB0byBzdXBwb3J0 IHN0YXRlLWNsb25lIGJhc2VkIG1pZ3JhdGlvbi4NCg0KVGh4IEVkZGllDQo= -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Alexander Duyck <alexander.duyck@gmail.com> |
|---|---|
| Date | 2015-11-26 05:00 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qyVSV-7sc-7@gated-at.bofh.it> |
| In reply to | #1277956 |
On Wed, Nov 25, 2015 at 7:15 PM, Dong, Eddie <eddie.dong@intel.com> wrote: >> On Wed, Nov 25, 2015 at 12:21 AM, Lan Tianyu <tianyu.lan@intel.com> wrote: >> > On 2015年11月25日 13:30, Alexander Duyck wrote: >> >> No, what I am getting at is that you can't go around and modify the >> >> configuration space for every possible device out there. This >> >> solution won't scale. >> > >> > >> > PCI config space regs are emulation by Qemu and so We can find the >> > free PCI config space regs for the faked PCI capability. Its position >> > can be not permanent. >> >> Yes, but do you really want to edit every driver on every OS that you plan to >> support this on. What about things like direct assignment of regular Ethernet >> ports? What you really need is a solution that will work generically on any >> existing piece of hardware out there. > > The fundamental assumption of this patch series is to modify the driver in guest to self-emulate or track the device state, so that the migration may be possible. > I don't think we can modify OS, without modifying the drivers, even using the PCIe hotplug mechanism. > In the meantime, modifying Windows OS is a big challenge given that only Microsoft can do. While, modifying driver is relatively simple and manageable to device vendors, if the device vendor want to support state-clone based migration. The problem is the code you are presenting, even as a proof of concept is seriously flawed. It does a poor job of exposing how any of this can be duplicated for any other VF other than the one you are working on. I am not saying you cannot modify the drivers, however what you are doing is far too invasive. Do you seriously plan on modifying all of the PCI device drivers out there in order to allow any device that might be direct assigned to a port to support migration? I certainly hope not. That is why I have said that this solution will not scale. What I am counter proposing seems like a very simple proposition. It can be implemented in two steps. 1. Look at modifying dma_mark_clean(). It is a function called in the sync and unmap paths of the lib/swiotlb.c. If you could somehow modify it to take care of marking the pages you unmap for Rx as being dirty it will get you a good way towards your goal as it will allow you to continue to do DMA while you are migrating the VM. 2. Look at making use of the existing PCI suspend/resume calls that are there to support PCI power management. They have everything needed to allow you to pause and resume DMA for the device before and after the migration while retaining the driver state. If you can implement something that allows you to trigger these calls from the PCI subsystem such as hot-plug then you would have a generic solution that can be easily reproduced for multiple drivers beyond those supported by ixgbevf. Thanks. - Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Lan, Tianyu" <tianyu.lan@intel.com> |
|---|---|
| Date | 2015-11-30 08:00 +0100 |
| Subject | Re: [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC |
| Message-ID | <qAqBk-7t-15@gated-at.bofh.it> |
| In reply to | #1277964 |
On 11/26/2015 11:56 AM, Alexander Duyck wrote: > > I am not saying you cannot modify the drivers, however what you are > doing is far too invasive. Do you seriously plan on modifying all of > the PCI device drivers out there in order to allow any device that > might be direct assigned to a port to support migration? I certainly > hope not. That is why I have said that this solution will not scale. Current drivers are not migration friendly. If the driver wants to support migration, it's necessary to be changed. RFC PATCH V1 presented our ideas about how to deal with MMIO, ring and DMA tracking during migration. These are common for most drivers and they maybe problematic in the previous version but can be corrected later. Doing suspend and resume() may help to do migration easily but some devices requires low service down time. Especially network and I got that some cloud company promised less than 500ms network service downtime. So I think performance effect also should be taken into account when we design the framework. > > What I am counter proposing seems like a very simple proposition. It > can be implemented in two steps. > > 1. Look at modifying dma_mark_clean(). It is a function called in > the sync and unmap paths of the lib/swiotlb.c. If you could somehow > modify it to take care of marking the pages you unmap for Rx as being > dirty it will get you a good way towards your goal as it will allow > you to continue to do DMA while you are migrating the VM. > > 2. Look at making use of the existing PCI suspend/resume calls that > are there to support PCI power management. They have everything > needed to allow you to pause and resume DMA for the device before and > after the migration while retaining the driver state. If you can > implement something that allows you to trigger these calls from the > PCI subsystem such as hot-plug then you would have a generic solution > that can be easily reproduced for multiple drivers beyond those > supported by ixgbevf. Glanced at PCI hotplug code. The hotplug events are triggered by PCI hotplug controller and these event are defined in the controller spec. It's hard to extend more events. Otherwise, we also need to add some specific codes in the PCI hotplug core since it's only add and remove PCI device when it gets events. It's also a challenge to modify Windows hotplug codes. So we may need to find another way. > > Thanks. > > - Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web