From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: pci passthrough - VF reset at boot is dropping assigned MAC Date: Mon, 25 Apr 2011 10:28:43 -0600 Message-ID: <4DB5A13B.4050804@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: alex.williamson@redhat.com, KVM mailing list Return-path: Received: from mail-pv0-f174.google.com ([74.125.83.174]:58621 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758628Ab1DYQ27 (ORCPT ); Mon, 25 Apr 2011 12:28:59 -0400 Received: by pvg12 with SMTP id 12so1264090pvg.19 for ; Mon, 25 Apr 2011 09:28:58 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: Running qemu-kvm.git as of today (ffce28f, April 18, 2011) the virtual function passed to the VM is losing its assigned mac address. That is, prior to launching qemu-kvm, the following command is run to set the MAC address: ip link set dev eth2 vf 0 mac 02:12:34:56:79:20 Yet, when the VM boots the MAC address is random which is what happens when the VF is reset. Looking through the commit logs between 0.13.0 -- the version in Fedora 14 -- and latest git I found the following: commit d9488459ff2ab113293586c1c36b1679bb15deee Author: Alex Williamson Date: Thu Mar 17 15:24:31 2011 -0600 device-assignment: Reset device on system reset On system reset, we currently try to quiesce DMA by clearing the command register. This assumes that nothing re-enables bus master support without first de-programming the device. Use a bigger hammer to help the guest not shoot itself by issuing a function reset via sysfs on each system reset. Signed-off-by: Alex Williamson Acked-by: Chris Wright Signed-off-by: Marcelo Tosatti Is this the cause of the MAC address reset and is this behavior intended? David