Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1155441 - forbid NIC offloads change on the fly using update-device
forbid NIC offloads change on the fly using update-device
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.1
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Ján Tomko
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-22 03:12 EDT by Hu Jianwei
Modified: 2015-03-05 02:46 EST (History)
5 users (show)

See Also:
Fixed In Version: libvirt-1.2.8-6.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:46:28 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Hu Jianwei 2014-10-22 03:12:25 EDT
Description of problem:
Allow NIC offloads change on the fly using update-device

Version-Release number of selected component (if applicable):
libvirt-1.2.8-5.el7.x86_64
qemu-kvm-rhev-2.1.2-3.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Define a guest, and print the offloads info
[root@localhost ~]# virsh dumpxml r7| grep "/interface" -B15
    <interface type='network'>
      <mac address='52:54:00:66:70:90'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
[root@localhost ~]# virsh start r7
Domain r7 started

In host:
[root@localhost ~]# ethtool -k vnet0| head -18
Features for vnet0:
rx-checksumming: off [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on
        tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: on
        tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on

In guest:
[root@oolong ~]# ethtool -k eth0| head -18
Features for eth0:
rx-checksumming: on [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on
        tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: on
        tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on

2. Using update-device to update offloads for a NIC
[root@localhost ~]# cat nic.xml
<interface type='network'>
  <mac address='52:54:00:66:70:90'/>
  <source network='default'/>
  <model type='virtio'/>
  <driver>
    <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
    <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
  </driver>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r7 nic.xml
Device updated successfully                                        

3. Check the results
[root@localhost ~]# virsh dumpxml r7| grep "/interface" -B15
    <interface type='network'>
      <mac address='52:54:00:66:70:90'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

In host:
[root@localhost ~]# ethtool -k vnet0| head -18
Features for vnet0:
rx-checksumming: off [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on
        tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: on
        tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on

In guest:
[root@oolong ~]# ethtool -k eth0| head -18
Features for eth0:
rx-checksumming: on [fixed]
tx-checksumming: on
        tx-checksum-ipv4: off [fixed]
        tx-checksum-ip-generic: on
        tx-checksum-ipv6: off [fixed]
        tx-checksum-fcoe-crc: off [fixed]
        tx-checksum-sctp: off [fixed]
scatter-gather: on
        tx-scatter-gather: on
        tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp-ecn-segmentation: on
        tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on

Actual results:
As shown above steps, report update successfully, but do nothing.

Expected results:
1. If libvirt does not support offloads on the fly, please reject such action, like
[root@localhost ~]# cat nic.xml
<interface type='network'>
  <mac address='52:54:00:66:70:90'/>
  <source network='default'/>
  <model type='virtio'/>
  <driver queues='5'/>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
[root@localhost ~]# virsh update-device r7 nic.xml
error: Failed to update device from nic.xml
error: Operation not supported: cannot modify virtio network device driver attributes

2. If libvirt supports it, please do it exactly.

libvirt should either update it or report an error rather than just ignoring it.

Additional info:
Comment 2 Ján Tomko 2014-10-30 09:03:53 EDT
Upstream patch:
https://www.redhat.com/archives/libvir-list/2014-October/msg01048.html
Comment 3 Ján Tomko 2014-10-30 12:19:43 EDT
Now pushed upstream:
commit 4abcf04e7c01ddc1b0a92a4a25d829c51ceadac9
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2014-10-30 13:32:00 +0100

    Reject live update of offloading options
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1155441

git describe: v1.2.10-rc1-20-g4abcf04
Comment 6 lcheng 2014-11-05 22:29:56 EST
I can reproduce this bug with libvirt-1.2.8-5.el7.

Steps:
1. Define a guest, and print the offloads info
In host:
[root@localhost ~]# virsh start rhel7.0
Domain rhel7.0 started

[root@localhost ~]# virsh dumpxml rhel7.0 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:db:0c:00'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

[root@localhost ~]# ethtool -k vnet0 | head -18
Features for vnet0:
rx-checksumming: off [fixed]
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on


In guest:
[root@localhost ~]# ethtool -k eth0 | head -18
Features for eth0:
rx-checksumming: on [fixed]
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on


2. Using update-device to update offloads for a NIC
In host:
[root@localhost ~]# cat nic.xml
<interface type='network'>
  <mac address='52:54:00:db:0c:00'/>
  <source network='default'/>
  <model type='virtio'/>
  <driver>
    <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
    <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
  </driver>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

[root@localhost ~]# virsh update-device rhel7.0 nic.xml
Device updated successfully


3. Check the results
In host:
[root@localhost ~]# virsh dumpxml rhel7.0 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:db:0c:00'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

[root@localhost ~]# ethtool -k vnet0 | head -18
Features for vnet0:
rx-checksumming: off [fixed]
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on


In guest:
[root@localhost ~]# ethtool -k eth0 | head -18
Features for eth0:
rx-checksumming: on [fixed]
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on



--------------------------------------------

And verify this bug with libvirt-1.2.8-6.el7. Libvirt does not support offloads on the fly. Move this bug status to VERIFIED.


Steps:
1. Define a guest, and print the offloads info
In host:
[root@localhost ~]# virsh start rhel7.0
Domain rhel7.0 started

[root@localhost ~]# virsh dumpxml rhel7.0 | grep interface -A10
    <interface type='network'>
      <mac address='52:54:00:db:0c:00'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

[root@localhost ~]# ethtool -k vnet0 | head -18
Features for vnet0:
rx-checksumming: off [fixed]
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on


In guest:
[root@localhost ~]# ethtool -k eth0 | head -18
Features for eth0:
rx-checksumming: on [fixed]
tx-checksumming: on
	tx-checksum-ipv4: off [fixed]
	tx-checksum-ip-generic: on
	tx-checksum-ipv6: off [fixed]
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off [fixed]
scatter-gather: on
	tx-scatter-gather: on
	tx-scatter-gather-fraglist: on
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
udp-fragmentation-offload: on
generic-segmentation-offload: on
generic-receive-offload: on


2. Using update-device to update offloads for a NIC
In host:
[root@localhost ~]# cat nic.xml 
<interface type='network'>
  <mac address='52:54:00:db:0c:00'/>
  <source network='default'/>
  <model type='virtio'/>
  <driver>
    <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
    <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
  </driver>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>

[root@localhost ~]# virsh update-device rhel7.0 nic.xml
error: Failed to update device from nic.xml
error: Operation not supported: cannot modify virtio network device driver attributes
Comment 8 errata-xmlrpc 2015-03-05 02:46:28 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html

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