RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1164224 - Fail to change Virtual Function's MAC address in guest
Summary: Fail to change Virtual Function's MAC address in guest
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Lubomir Rintel
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-14 11:38 UTC by Xu Han
Modified: 2015-02-24 15:58 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-24 15:58:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
NetworkManager.log (30.54 KB, text/plain)
2014-12-11 07:34 UTC, Xu Han
no flags Details

Description Xu Han 2014-11-14 11:38:02 UTC
Description of problem:
While NetworkManager is running and manually assigned a MAC for VF via 'ip' in host, it is fail to change the VF's MAC in guest:
  SIOCSIFHWADDR: Cannot assign requested address

Have tested following scenarios:
+----------------------+---------------------------+-------------------------+
| NetworkManager(host) | Have assigned a MAC(host) | Could change MAC(guest) |
+----------------------+---------------------------+-------------------------+
| Running              | Yes                       | No                      |
| Stopped              | Yes                       | Yes                     |
| Running              | No                        | Yes                     |
+----------------------+---------------------------+-------------------------+

NIC's info:
# lspci -s "0000:05:00.0"
05:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
Driver: igb

Version-Release number of selected component (if applicable):
NetworkManager-0.9.9.1-47.git20140326.4dba720.el7.x86_64
iproute-3.10.0-21.el7.x86_64
libgudev1-208-15.el7.x86_64
kernel-3.10.0-193.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Generate VF and bind it to vfio-pci
-------------------------------------------------------------------------------
# modprobe -r igb; modprobe igb max_vfs=1

# echo "0000:05:10.0" > /sys/bus/pci/drivers/igbvf/unbind

# lspci -n -s "05:10.0"
05:10.0 0200: 8086:10ca (rev 01)

# echo "8086 10ca" > /sys/bus/pci/drivers/vfio-pci/new_id

# ls /sys/bus/pci/drivers/vfio-pci/
0000:05:10.0  bind  module  new_id  remove_id  uevent  unbind

2. Assign MAC address for this VF in host
-------------------------------------------------------------------------------
# ip link show eth1
39: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether 90:e2:ba:05:63:5e brd ff:ff:ff:ff:ff:ff
    vf 0 MAC 32:af:1b:aa:73:2a, spoof checking on, link-state auto

# ip link set dev eth1 vf 0 mac 9a:64:65:66:67:68

# ip link show eth1
39: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether 90:e2:ba:05:63:5e brd ff:ff:ff:ff:ff:ff
    vf 0 MAC 9a:64:65:66:67:68, spoof checking on, link-state auto

3. Launch a VM with the VF
-------------------------------------------------------------------------------
/bin/qemu-kvm \
    -name 'virt-tests-vm1'  \
    -sandbox off  \
    -M pc  \
    -nodefaults  \
    -vga cirrus  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20141104-131355-MVdfeGw9,path=/tmp/seabios,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20141104-131355-MVdfeGw9,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=03 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/dev/sdd \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=04 \
    -device vfio-pci,host=05:10.0,id=id_05.10.0,bus=pci.0,addr=05 \
    -m 2048  \
    -smp 8,cores=4,threads=1,sockets=2  \
    -cpu 'Nehalem',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -no-kvm-pit-reinjection \
    -enable-kvm \
    -monitor stdio

4. Change the VF's MAC in guest
-------------------------------------------------------------------------------
# ip link show ens5
ip link show ens5
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 9a:64:65:66:67:68 brd ff:ff:ff:ff:ff:ff

# ifconfig ens5 hw ether 9a:64:65:66:67:72
SIOCSIFHWADDR: Cannot assign requested address

Dmesg log:
guest:
[  279.555115] igbvf 0000:00:05.0: Link is Up 1000 Mbps Full Duplex

host:
[109334.897002] igb 0000:05:00.0: VF 0 attempted to override administratively set MAC address
Reload the VF driver to resume operations

Actual results:
Fail to change VF's MAC in guest

Expected results:
Could change VF's MAC successfully

Additional info:
Test result of scenario 2:
-------------------------------------------------------------------------------
(host)# service NetworkManager stop

(guest)# ifconfig ens5 hw ether 9a:64:65:66:67:72

(guest)# ip link show ens5
ip link show ens5
2: ens5: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
    link/ether 9a:64:65:66:67:72 brd ff:ff:ff:ff:ff:ff

Dmesg log:
host:
[109478.663070] igbvf 0000:05:10.1: Link is Up 1000 Mbps Full Duplex

Comment 2 Dan Williams 2014-12-08 15:41:32 UTC
Could you provide the output of:

journalctl -b -u NetworkManager

when the problem occurs?

Comment 4 Jirka Klimes 2014-12-09 12:01:57 UTC
[109334.897002] igb 0000:05:00.0: VF 0 attempted to override administratively set MAC address
Reload the VF driver to resume operations

is an error from the igb driver denying the MAC change if it was set on physical function
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/igb/igb_main.c#L6095
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c#L721

And according to this thread, it is expected that the MAC address can't be changed in VM if it has been set (administratively) before in the host.
https://communities.intel.com/thread/37430

Maybe you didn't set the MAC with 'ip link set dev eth1 vf 0 mac 9a:64:65:66:67:68' in the test scenario 2.

Comment 5 Xu Han 2014-12-11 07:34:52 UTC
Created attachment 967109 [details]
NetworkManager.log

# ip link show
...
9: ens2f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether 90:e2:ba:05:63:5e brd ff:ff:ff:ff:ff:ff
    vf 0 MAC 9a:64:65:66:67:68, spoof checking on, link-state auto
...
11: ens2f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
    link/ether 90:e2:ba:05:63:5f brd ff:ff:ff:ff:ff:ff
    vf 0 MAC e2:24:f5:eb:d6:a8, spoof checking on, link-state auto

(In reply to Dan Williams from comment #2)
> Could you provide the output of:
> 
> journalctl -b -u NetworkManager
> 
> when the problem occurs?

Log shows nothing about the PF(ens2f0) when the problem occurs, I attached the whole service log here. And this time, the VF's MAC could not be changed even if NetworkManager service is stopped. So, this issue may just relate to the driver(igb), where has been mentioned in comment 4.


(In reply to Jirka Klimes from comment #4)
> Maybe you didn't set the MAC with 'ip link set dev eth1 vf 0 mac
> 9a:64:65:66:67:68' in the test scenario 2.

I set VF's MAC on host at that time, but I have no ideas about why it did not work in recent test.


Thanks.

Comment 6 Lubomir Rintel 2015-01-28 20:22:45 UTC
(In reply to Xu Han from comment #0)
> Description of problem:
> While NetworkManager is running and manually assigned a MAC for VF via 'ip'
> in host, it is fail to change the VF's MAC in guest:
>   SIOCSIFHWADDR: Cannot assign requested address

So yes, as Jiri pointed out; that is the correct and expected behavior.

> Have tested following scenarios:
> +----------------------+---------------------------+-------------------------
> +
> | NetworkManager(host) | Have assigned a MAC(host) | Could change MAC(guest)
> |
> +----------------------+---------------------------+-------------------------
> +
> | Running              | Yes                       | No                     
> |
> | Stopped              | Yes                       | Yes                    
> |
> | Running              | No                        | Yes                    
> |
> +----------------------+---------------------------+-------------------------

(In reply to Xu Han from comment #5)
> And this time, the VF's MAC could not be changed
> even if NetworkManager service is stopped. So, this issue may just relate to
> the driver(igb), where has been mentioned in comment 4.

Same for my tests. For me it looks like following (NetworkManager makes no difference):

+----------------------+---------------------------+-------------------------
+
| NetworkManager(host) | Have assigned a MAC(host) | Could change MAC(guest)
|
+----------------------+---------------------------+-------------------------
+
| Running              | Yes                       | No                     
|
| Stopped              | Yes                       | No                     
|
| Running              | No                        | Yes                    
|
+----------------------+---------------------------+-------------------------

I'm wondering if you can reproduce the faulty behaviour (being able to change VF address despite an address was set in PF? Or can we just close this?

Comment 7 Lubomir Rintel 2015-02-24 15:58:56 UTC
Closing. Please reopen if there's anything more to be done here.

Thank you.


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