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 1155441 - forbid NIC offloads change on the fly using update-device
Summary: forbid NIC offloads change on the fly using update-device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-22 07:12 UTC by Hu Jianwei
Modified: 2015-03-05 07:46 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.8-6.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:46:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Hu Jianwei 2014-10-22 07:12:25 UTC
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 13:03:53 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2014-October/msg01048.html

Comment 3 Ján Tomko 2014-10-30 16:19:43 UTC
Now pushed upstream:
commit 4abcf04e7c01ddc1b0a92a4a25d829c51ceadac9
Author:     Ján Tomko <jtomko>
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-06 03:29:56 UTC
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 07:46:28 UTC
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.