On 06/14/2017 04:29 AM, ZhiPeng Lu wrote:
> Before libvirt that calls virNetDevMacVLanCreateWithVPortProfile sets mac address
> or vlan of a Virtual Function(VF) linked to a macvtap passthrough device of migration
> destination host in migration start step. If we ping the migrating vm,
> we get the network does not pass. Because VFs of migration source and destination
> have the same MAC address. The patch later calling qemuMigrationVPAssociatePortProfiles
> sets mac address of VF in migration finish step instead of start step.
> The patch aims to reduce packet loss rate.
>I missed this patch when you initially sent it, and see that nobody else
>What you're doing here shouldn't be needed. During migration, a macvtap
>device should be created with ~IFF_UP, and not brought online until
>qemuInterfaceStartDevice() is called just prior to starting the guest
>CPUs on the destination; by this time the guest CPUs on the source have
>already been stopped (and the guest's macvtap interfaces on the source
>have been set offline). Until a device is IFF_UP, it shouldn't send out
>any traffic with its MAC address.
----Probably not understanding what I mean when the network packet loss happens.
This patch describes the time before the guest CPU on the source has been stopped and the macvtap device was IFF_UP.
if we send network data from the destination, the network packet loss.
>If you look at the macvtap device on the destination and it has IFF_UP
>set prior to the completion of migration, then there is a bug in libvirt
>that we need to fix. Otherwise, I think any packet loss you're seeing is
>coming from something else.
> Signed-off-by: ZhiPeng Lu <lu zhipeng zte com cn>
> src/qemu/qemu_migration.c | 18 ++++++++++++++++--
> src/util/virnetdevmacvlan.c | 17 +++++++++++------
> 2 files changed, 27 insertions(+), 8 deletions(-)
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 09adb04..795ed71 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -5004,7 +5004,7 @@ qemuMigrationPerform(virQEMUDriverPtr driver,
> static int
> -qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def)
> +qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def, const char *stateDir)
IT开发工程师 IT Development
操作系统产品部/中心研究院/系统产品 OS Product Dept./Central R＆D Institute/System Product
33/F, R&D Building, ZTE Corporation Hi-tech Road South,
Hi-tech Industrial Park Nanshan District, Shenzhen, P.R.China, 518057
T: +86 755 xxxxxxxx F:+86 755 xxxxxxxx
M: +86 xxxxxxxxxxx
E: lu zhipeng zte com cn