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 1387477 - virtual interface offload for virtio - disable host ufo only will not work
Summary: virtual interface offload for virtio - disable host ufo only will not work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Wei
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-21 02:12 UTC by yalzhang@redhat.com
Modified: 2016-12-19 12:08 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-08 12:07:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yalzhang@redhat.com 2016-10-21 02:12:38 UTC
Description of problem:
when set offloads for virtual interface, if only disable UDP related offloads, after set ufo='off' both for host and guest, the "udp-fragmentation-offload" is still on in the guest.

Version-Release number of selected component (if applicable):
libvirt-2.0.0-10.el7.x86_64
qemu-kvm-rhev-2.6.0-28.el7.x86_64
kernel-3.10.0-510.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. set ufo=off both on guest and host, the <host ufo='off'/> will not work(check on guest).

# virsh dumpxml r7 | grep /interface -B6
      <driver>
        <host ufo='off'/>
        <guest ufo='off'/>
      </driver>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# ps -aux | grep qemu-kvm
...
-netdev tap,fd=27,id=hostnet0,vhost=on,vhostfd=29 -device virtio-net-pci,host_ufo=off,guest_ufo=off,netdev=hostnet0,id=net0,mac=52:54:00:36:c6:d0,bus=pci.0,addr=0x3 
...

2. On the guest:
# 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: off [fixed]
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

# ethtool -K eth0 ufo off
# ethtool -k eth0 | grep udp-fragmentation
udp-fragmentation-offload: off

3. set gso=on and ufo=off, it works.
# virsh dumpxml r7.3 | grep /interface -B11
    <interface type='network'>
      <mac address='52:54:00:12:fc:9e'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <driver>
        <host gso='off' ufo='off'/>
        <guest ufo='off'/>
      </driver>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

on guest:
# ethtool -k eth0
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: off [fixed]
tcp-segmentation-offload: on
	tx-tcp-segmentation: on
	tx-tcp-ecn-segmentation: on
	tx-tcp6-segmentation: on
** udp-fragmentation-offload: off [fixed] **
......


Actual results:
In step 2, the udp-fragmentation-offload if on,but in the xml we set <host ufo='off'/>

Expected results:
In step 2, the udp-fragmentation-offload should be off

Additional info:
Have asked this question on this bug, and mst have provided some valuable information https://bugzilla.redhat.com/show_bug.cgi?id=1139364#c18

Comment 2 Wei 2016-11-01 16:17:00 UTC
Yal,
I have tried it with upstream, it doesn't work even with your step 3, can you share your test machine with me?

My cases:
-device virtio-net-pci,host_ufo=off,gso=off,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 

-device virtio-net-pci,host_ufo=off,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 

-device virtio-net-pci,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 \

BTW, can you add me to the cc list of bug 1139364 as well? Seems I don't have permission to access the bz.

Comment 3 Wei 2016-11-01 16:21:04 UTC
Just noticed you were using 'gso=on', also tried that, not working for upstream.

-device virtio-net-pci,host_ufo=off,gso=on,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 \
-device virtio-net-pci,host_ufo=off,gso=off,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 \
-device virtio-net-pci,host_ufo=off,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 \
-device virtio-net-pci,guest_ufo=on,netdev=hn1,mac=52:54:00:11:22:10 \
-device virtio-net-pci,guest_ufo=off,netdev=hn1,mac=52:54:00:11:22:10 \

Comment 4 Wei 2016-11-02 06:44:09 UTC
A bit correction, ufo can only be turned  off via  'host_ufo=off,gso=off,guest_ufo=off'.

From guest's point of view, 'ufo' depends on gso, ufo will turned on if gso has been enabled.

For host side, ufo depends on host ufo as well.

Looks this is by design when probing virtio net device in guest, thus it is not a bug.


if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) {
    dev->hw_features |= NETIF_F_TSO | NETIF_F_UFO
        | NETIF_F_TSO_ECN | NETIF_F_TSO6;
}
/* Individual feature bits: what can host handle? */
if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO4))
    dev->hw_features |= NETIF_F_TSO;
if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO6))
    dev->hw_features |= NETIF_F_TSO6;
if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN))
    dev->hw_features |= NETIF_F_TSO_ECN;
if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_UFO))
    dev->hw_features |= NETIF_F_UFO;

Comment 5 jason wang 2016-11-02 07:23:47 UTC
Yes, this looks not like a bug. If you're checking guest ufo (TX) through ethtool, it has nothing to do with guest_ufo (RX).

Comment 6 yalzhang@redhat.com 2016-12-02 07:57:19 UTC
Many thanks to jason and Wei, I think I got the meaning. It is not a bug but a wrong usage, it is something about the principle of GSO/TSO/UFO. 
If I want to disable ufo for the guest(both transmit and receive), I should set gso=off together, the xml should like this:

  <driver>
        <host gso='off' ufo='off'/>  ===> for receive
        <guest ufo='off'/>   ====> for transmit
      </driver>

If I want to disable tcp related segments for guest, the xml should be like:

  <driver>
        <host gso='off' tso4='off' tso6='off' ecn='off'/>  ===> for receive
        <guest tso4='off' tso6='off' ecn='off'/> ====> for transmit
      </driver>

Both of them should include the "gso='off'" because tso and gso all depends on gso. Please help to check if I get the point, thank you very much!

Comment 7 Wei 2016-12-08 03:33:30 UTC
that is it.


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