From: Wei Yang <richard.weiyang@huawei.com>
To: Lan Tianyu <tianyu.lan@intel.com>
Cc: qemu-devel@nongnu.org, emil.s.tantilov@intel.com,
kvm@vger.kernel.org, ard.biesheuvel@linaro.org, aik@ozlabs.ru,
donald.c.skidmore@intel.com, mst@redhat.com,
eddie.dong@intel.com, nrupal.jani@intel.com, quintela@redhat.com,
agraf@suse.de, blauwirbel@gmail.com, cornelia.huck@de.ibm.com,
alex.williamson@redhat.com, kraxel@redhat.com,
anthony@codemonkey.ws, amit.shah@redhat.com, pbonzini@redhat.com,
mark.d.rustad@intel.com, lcapitulino@redhat.com,
gerlitz.or@gmail.com
Subject: Re: [Qemu-devel] [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC
Date: Thu, 17 Mar 2016 17:15:22 +0800 [thread overview]
Message-ID: <20160317091522.GA6653@linux-gk3p> (raw)
In-Reply-To: <1448372127-28115-1-git-send-email-tianyu.lan@intel.com>
Hi, Tianyu,
I am testing your V2 patch set in our environment, while facing two issues
now. Have a workaround for the first one and hope you could share some light
on the second one :-)
1. Mismatch for ram_block (Have a workaround)
-------------------------------------------------------------------------------
Below is the error message on the destination:
qemu-system-x86_64: Length mismatch: : 0x3000 in != 0x4000: Invalid argument
qemu-system-x86_64: error while loading state for instance 0x0 of device 'ram'
qemu-system-x86_64: load of migration failed: Invalid argument
With the following command line on source and destination respectively:
git/qemu/x86_64-softmmu/qemu-system-x86_64 --enable-kvm -m 4096 -smp 4 --nographic -drive file=/root/nfs/rhel.img,format=raw,cache=none -device vfio-sriov,host=0000:03:10.0
git/qemu/x86_64-softmmu/qemu-system-x86_64 --enable-kvm -m 4096 -smp 4 --nographic -drive file=/root/nfs/rhel.img,format=raw,cache=none -device vfio-sriov,host=0000:03:10.0 --incoming tcp:0:4444
By some debugging, the reason for this error is the ram_block->idstr of
pass-through MMIO region is not set.
My workaround is to add vmstate_register_ram() in vfio_mmap_region() after
memory_region_init_ram_ptr() returns.
I think this is not a good solution, since the ram_block->idstr is coded
with the VF's BDF. So I guess this will not work when the VF has different BDF
from source to destination respectively.
Maybe my test step is not correct?
2. Failed to migrate the MAC address
-------------------------------------------------------------------------------
By adding some code in VF's driver in destination guest, I found the MAC
information has been migrated to destination in adapter->hw.mac. While this is
"reset" by VF's driver, when ixgbevf_migration_task is invoked at the end of
the migration process.
Below is what I have printed:
The ifconfig output from destination:
eth8 Link encap:Ethernet HWaddr 52:54:00:81:39:F2
inet addr:9.31.210.106 Bcast:9.31.255.255 Mask:255.255.0.0
inet6 addr: fe80::5054:ff:fe81:39f2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:66 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21840 (21.3 KiB) TX bytes:920 (920.0 b)
The log message I printed in destination's VF driver:
ixgbevf: migration end --
ixgbevf: original mac:52:54:00:81:39:f2
ixgbevf: after reset mac:52:54:00:92:04:a3
ixgbevf: migration end ==
I didn't take a close look in the "reset" function, while seems it retrieves
the mac from VF hardware. Hmm... is there some possible way to have the same
mac on both source and destination?
At last, I appreciated all your work and help, learned much from your side.
On Tue, Nov 24, 2015 at 09:35:17PM +0800, 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 (10):
> Qemu/VFIO: Create head file pci.h to share data struct.
> Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition
> Qemu/VFIO: Rework vfio_std_cap_max_size() function
> Qemu/VFIO: Add vfio_find_free_cfg_reg() to find free PCI config space
> regs
> Qemu/VFIO: Expose PCI config space read/write and msix functions
> Qemu/PCI: Add macros for faked PCI migration capability
> Qemu: Add post_load_state() to run after restoring CPU state
> Qemu: Add save_before_stop callback to run just before stopping VCPU
> during migration
> Qemu/VFIO: Add SRIOV VF migration support
> Qemu/VFIO: Misc change for enable migration with VFIO
>
> hw/vfio/Makefile.objs | 2 +-
> hw/vfio/pci.c | 196 +++++++++-----------------------------------
> hw/vfio/pci.h | 168 +++++++++++++++++++++++++++++++++++++
> hw/vfio/sriov.c | 178 ++++++++++++++++++++++++++++++++++++++++
> include/hw/pci/pci_regs.h | 19 +++++
> include/migration/vmstate.h | 5 ++
> include/sysemu/sysemu.h | 1 +
> linux-headers/linux/vfio.h | 16 ++++
> migration/migration.c | 3 +-
> migration/savevm.c | 28 +++++++
> 10 files changed, 459 insertions(+), 157 deletions(-)
> create mode 100644 hw/vfio/pci.h
> create mode 100644 hw/vfio/sriov.c
>
>--
>1.9.3
>
>
--
Richard Yang\nHelp you, Help me
prev parent reply other threads:[~2016-03-17 9:36 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 13:35 [Qemu-devel] [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 01/10] Qemu/VFIO: Create head file pci.h to share data struct Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 02/10] Qemu/VFIO: Add new VFIO_GET_PCI_CAP_INFO ioctl cmd definition Lan Tianyu
2015-12-02 22:25 ` Alex Williamson
2015-12-03 8:40 ` Lan, Tianyu
2015-12-03 15:26 ` Alex Williamson
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 03/10] Qemu/VFIO: Rework vfio_std_cap_max_size() function Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 04/10] Qemu/VFIO: Add vfio_find_free_cfg_reg() to find free PCI config space regs Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 05/10] Qemu/VFIO: Expose PCI config space read/write and msix functions Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 06/10] Qemu/PCI: Add macros for faked PCI migration capability Lan Tianyu
2015-12-02 22:25 ` Alex Williamson
2015-12-03 8:57 ` Lan, Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 07/10] Qemu: Add post_load_state() to run after restoring CPU state Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 08/10] Qemu: Add save_before_stop callback to run just before stopping VCPU during migration Lan Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 09/10] Qemu/VFIO: Add SRIOV VF migration support Lan Tianyu
2015-11-24 21:03 ` Michael S. Tsirkin
2015-11-25 15:32 ` Lan, Tianyu
2015-11-25 15:44 ` Michael S. Tsirkin
2015-12-02 22:25 ` Alex Williamson
2015-12-03 8:56 ` Lan, Tianyu
2015-11-24 13:35 ` [Qemu-devel] [RFC PATCH V2 10/10] Qemu/VFIO: Misc change for enable migration with VFIO Lan Tianyu
2015-11-30 8:01 ` [Qemu-devel] [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC Michael S. Tsirkin
2015-12-01 6:26 ` Lan, Tianyu
2015-12-01 15:02 ` Michael S. Tsirkin
2015-12-02 14:08 ` Lan, Tianyu
2015-12-02 14:31 ` Michael S. Tsirkin
2015-12-03 14:53 ` Lan, Tianyu
2015-12-04 6:42 ` Lan, Tianyu
2015-12-04 8:05 ` Michael S. Tsirkin
2015-12-04 12:11 ` Lan, Tianyu
2015-12-03 18:32 ` Alexander Duyck
2015-12-07 16:50 ` [Qemu-devel] live migration vs device assignment (was Re: [RFC PATCH V2 00/10] Qemu: Add live migration support for SRIOV NIC) Michael S. Tsirkin
2015-12-09 16:26 ` [Qemu-devel] live migration vs device assignment (motivation) Lan, Tianyu
2015-12-09 17:14 ` Alexander Duyck
2015-12-10 3:15 ` Lan, Tianyu
2015-12-09 20:07 ` Michael S. Tsirkin
2015-12-10 3:04 ` Lan, Tianyu
2015-12-10 8:38 ` Michael S. Tsirkin
2015-12-10 14:23 ` Lan, Tianyu
2015-12-10 10:18 ` Dr. David Alan Gilbert
2015-12-10 11:28 ` Yang Zhang
2015-12-10 11:41 ` Dr. David Alan Gilbert
2015-12-10 13:07 ` Yang Zhang
2015-12-10 14:38 ` Lan, Tianyu
2015-12-10 16:11 ` Michael S. Tsirkin
2015-12-10 19:17 ` Alexander Duyck
2015-12-11 7:32 ` Lan, Tianyu
2015-12-14 9:12 ` Michael S. Tsirkin
2015-12-10 16:23 ` Dr. David Alan Gilbert
2015-12-10 17:16 ` Alexander Duyck
2015-12-13 15:47 ` Lan, Tianyu
2015-12-13 19:30 ` Alexander Duyck
2015-12-25 7:03 ` Lan Tianyu
2015-12-25 12:11 ` Michael S. Tsirkin
2015-12-28 17:42 ` Lan, Tianyu
2015-12-29 16:46 ` Michael S. Tsirkin
2015-12-29 17:04 ` Alexander Duyck
2015-12-29 17:15 ` Michael S. Tsirkin
2015-12-29 18:04 ` Alexander Duyck
2016-01-04 2:15 ` Lan Tianyu
2015-12-25 22:31 ` Alexander Duyck
2015-12-27 9:21 ` Michael S. Tsirkin
2015-12-27 21:45 ` Alexander Duyck
2015-12-28 8:51 ` Michael S. Tsirkin
2015-12-28 3:20 ` Dong, Eddie
2015-12-28 4:26 ` Alexander Duyck
2015-12-28 11:50 ` Michael S. Tsirkin
2015-12-14 9:26 ` Michael S. Tsirkin
2015-12-28 8:52 ` Pavel Fedin
2015-12-28 11:51 ` Michael S. Tsirkin
2016-03-17 9:15 ` Wei Yang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160317091522.GA6653@linux-gk3p \
--to=richard.weiyang@huawei.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=amit.shah@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=ard.biesheuvel@linaro.org \
--cc=blauwirbel@gmail.com \
--cc=cornelia.huck@de.ibm.com \
--cc=donald.c.skidmore@intel.com \
--cc=eddie.dong@intel.com \
--cc=emil.s.tantilov@intel.com \
--cc=gerlitz.or@gmail.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lcapitulino@redhat.com \
--cc=mark.d.rustad@intel.com \
--cc=mst@redhat.com \
--cc=nrupal.jani@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=tianyu.lan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).