Bug 986181 - guest cannot dhcp an IP while booting with a passthru macvtap backend
guest cannot dhcp an IP while booting with a passthru macvtap backend
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.5
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Vlad Yasevich
Virtualization Bugs
:
Depends On: 923051
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-19 03:20 EDT by langfang
Modified: 2013-12-04 12:26 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 923051
Environment:
Last Closed: 2013-12-04 12:26:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 2 mazhang 2013-07-19 04:20:21 EDT
hit this problem with 82599 nic on rhel6u5 guest.
Comment 3 Vlad Yasevich 2013-08-26 14:57:54 EDT
Can you try the following:
 -  Do not change the mac address of the passthru macvtap device and try bringing
    up the VM and passing the right hw address to it.  If this works, this would
    point to a bug in the driver for the VF device.  You may need to remove IP
    address from the VF device.

 - Try not using bridged or vepa modes and see if that makes it work.

The reason I ask is that I just tried setting up a passthru macvtap on top of a
Emulex 10G nic non-SRIOV (be2net driver) and it worked just fine.
Comment 4 langfang 2013-08-27 03:49:56 EDT
Test on latest version:
Host:
# uname -r
2.6.32-414.el6.x86_64
[root@amd-6168-256-1 home]# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.397.el6.x86_64

Guest:
rhel6.5

Steps:
1. create macvtap in passthru mode on a VF
# ip address show p5p2_5
24: p5p2_5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b2:96:79:9f:3f:db brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b096:79ff:fe9f:3fdb/64 scope link 
       valid_lft forever preferred_lft forever
# ip link add link p5p2_5 dev macvtap0 type macvtap mode passthru
# ip link set macvtap0 up
#  ip -d link show macvtap0
35: macvtap0@p5p2_5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether b2:96:79:9f:3f:30 brd ff:ff:ff:ff:ff:ff
    macvtap  mode passthru 


2.Boot guest with only one NIC
/usr/libexec/qemu-kvm -M rhel6.5.0 -cpu Opteron_G3 -m 4G -smp 16,sockets=2,cores=8,threads=1 -enable-kvm -usb -device usb-tablet,id=input0 -name win2008r2-64 -uuid `uuidgen` -rtc base=localtime,clock=host,driftfix=slew  -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0  -boot menu=on -drive file=/home/RHEL-Server-6.4-64-virtio.qcow2,if=none,id=drive-scsi0-0-0,media=disk,cache=none,format=qcow2,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=flang  -vnc :11 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0  -qmp tcp:0:4445,server,nowait -monitor stdio   -netdev tap,id=hostnet2,vhost=on,fd=35  -device virtio-net-pci,netdev=hostnet2,id=net0,mac=b2:96:79:9f:3f:db 35<>/dev/tap35


Results:

Guest can get IP,and work well


Addtional info :If change the Mac, also hit the problem on the latest version.
Comment 5 langfang 2013-08-27 03:52:10 EDT
Correction for comment 4:

Test on latest version:
Host:
# uname -r
2.6.32-414.el6.x86_64
[root@amd-6168-256-1 home]# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.397.el6.x86_64

Guest:
rhel6.5

Steps:
1. create macvtap in passthru mode on a VF
# ip address show p5p2_5
24: p5p2_5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b2:96:79:9f:3f:db brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b096:79ff:fe9f:3fdb/64 scope link 
       valid_lft forever preferred_lft forever
# ip link add link p5p2_5 dev macvtap0 type macvtap mode passthru
# ip link set macvtap0 up
#  ip -d link show macvtap0
35: macvtap0@p5p2_5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether b2:96:79:9f:3f:db brd ff:ff:ff:ff:ff:ff
    macvtap  mode passthru 


2.Boot guest with only one NIC
/usr/libexec/qemu-kvm -M rhel6.5.0 -cpu Opteron_G3 -m 4G -smp 16,sockets=2,cores=8,threads=1 -enable-kvm -usb -device usb-tablet,id=input0 -name win2008r2-64 -uuid `uuidgen` -rtc base=localtime,clock=host,driftfix=slew  -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0  -boot menu=on -drive file=/home/RHEL-Server-6.4-64-virtio.qcow2,if=none,id=drive-scsi0-0-0,media=disk,cache=none,format=qcow2,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=flang  -vnc :11 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0  -qmp tcp:0:4445,server,nowait -monitor stdio   -netdev tap,id=hostnet2,vhost=on,fd=35  -device virtio-net-pci,netdev=hostnet2,id=net0,mac=b2:96:79:9f:3f:db 35<>/dev/tap35


Results:

Guest can get IP,and work well


Addtional info :If change the Mac, also hit the problem on the latest version.
Comment 6 Vlad Yasevich 2013-09-19 15:38:05 EDT
I ran some additional tests on the intel VF capable device and this is what
I've found:

1) If the user sets VF mac address using command
   # ip link set dev <dev> vf <num> mac <mac>
   then subsequent this command, the nic driver reports an error when attempting
   to configure macvlan or macvtap devices on the device corresponding to the
   VF.  This seems to be a limitation of the driver/hw/fw.  Passthru mode
   macvlan/vtap device will however work as it inherits the mac address of
   physical device (in this case VF).  This is why it worked correctly when
   the mac address on the macvtap was not changed, and did not work when the
   mac address of the macvtap was changed.


2) If the user does not set the VF mac, leaving set 00:00:00:00:00:00, then
   the randomly generated mac address, assigned to the net device which
   corresponds to the VF, does not get get added to the nic forwarding
   table.  This can be verified using command /sbin/bridge fdb show
   In this case, vepa and bridge mode macvlan/vtap devices work correctly
   as they add their own mac addresses to the nic forwarding table.  However,
   the passthru mode is different as it inherits the mac address of the physical
   device.  In this case, the mac address is still not added and thus
   passthru mode does not work correctly.  Changing the mac address of the
   passthru mode macvlan/vtap would make it work.

There are 2 possible solutions:
 1) Change the ixgbevf driver to add the randomly generated mac address to the
    hw forwarding table.
of
 2) Change the macvlan driver to add the mac address to always add the address to hw forwarding table and treat EEXIST correctly.

My preference is for (1) since the VF net device itself does not work if the VF mac has not been set and the net device mac address is randomly generated.
Comment 7 Vlad Yasevich 2013-12-04 12:26:18 EST
After further investigation into this issue, this is an invalid use of a passthru mode.  See Bug 923051 for details.  Closing this bug.

Note You need to log in before you can comment on or make changes to this bug.