Bug 1750219 - direct type interface should not accept "floor" setting in Qos inbound
Summary: direct type interface should not accept "floor" setting in Qos inbound
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Pavel Mores
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-09 05:19 UTC by yalzhang@redhat.com
Modified: 2020-11-17 17:46 UTC (History)
5 users (show)

Fixed In Version: libvirt-6.2.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-17 17:45:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
rhel8.1 inactive xml (9.08 KB, text/plain)
2020-01-14 07:30 UTC, Jing Qi
no flags Details
rhel8.1 active xml (11.21 KB, text/plain)
2020-01-14 07:31 UTC, Jing Qi
no flags Details

Description yalzhang@redhat.com 2019-09-09 05:19:35 UTC
Description of problem:
Direct type interface should not accept "floor" setting in Qos inbound

Version-Release number of selected component (if applicable):
libvirt-5.6.0-4.module+el8.1.0+4160+b50057dc.x86_64

How reproducible:
100%

Steps to Reproduce:
Scenario 1: start vm with floor setting (interface type='network' which point to a direct type interface pool will accept the floor setting)
1.
# virsh net-dumpxml direct-bridge
<network trustGuestRxFilters='yes'>
  <name>direct-bridge</name>
  <uuid>b9f35f3d-fbb9-45a4-b7c2-0abb6121138a</uuid>
  <forward dev='ens1f0' mode='bridge'>
    <interface dev='ens1f0'/>
  </forward>
</network>
# virsh dumpxml rhel | grep /interface -B9
<interface type='network'>
      <mac address='52:54:00:54:bf:65'/>
      <source network='direct-bridge'/>
      <bandwidth>
        <inbound average='200' peak='300' floor='100' burst='256'/>
        <outbound average='300' peak='200' burst='256'/>
      </bandwidth>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </interface>
2.
# virsh start rhel
Domain rhel started

# virsh dumpxml rhel | grep /interface -B12
<interface type='direct'>
      <mac address='52:54:00:54:bf:65'/>
      <source network='direct-bridge' portid='eef43b9e-f64f-4dfb-b71f-7505f28d8429' dev='ens1f0' mode='bridge'/>
      <bandwidth>
        <inbound average='200' peak='300' floor='100' burst='256'/>
        <outbound average='300' peak='200' burst='256'/>
      </bandwidth>
      <target dev='macvtap1'/>
      <model type='virtio'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </interface>
# tc -d filter show dev macvtap1 parent ffff:
filter protocol all pref 49152 u32 chain 0 
filter protocol all pref 49152 u32 chain 0 fh 800: ht divisor 1 
filter protocol all pref 49152 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid :1 not_in_hw 
  match 00000000/00000000 at 0
 police 0x3 rate 1600Kbit burst 256Kb mtu 64Kb action drop overhead 0b linklayer ethernet 
ref 1 bind 1

Scenario 2: use domiftune to configure "floor", for <interface type='direct'>, the "floor" can be set by domiftune
1. start vm with direct type interfaces
# virsh domiflist rhel
 Interface   Type     Source          Model    MAC
------------------------------------------------------------------
 macvtap0    direct   ens1f0          virtio   52:54:00:c5:da:e0
 macvtap1    direct   direct-bridge   virtio   52:54:00:54:bf:65

# virsh domiftune rhel macvtap0  200,300,128,100 100,200,200
# virsh domiftune rhel macvtap0
inbound.average: 200
inbound.peak   : 300
inbound.burst  : 128
inbound.floor  : 100
outbound.average: 100
outbound.peak  : 200
outbound.burst : 200

For direct interface from a interface pool, the result is as expected:
#  virsh domiftune rhel macvtap1  200,300,128,100 100,200,200
error: Unable to set interface parameters
error: Operation not supported: Invalid use of 'floor' on interface with MAC address 52:54:00:54:bf:65 - network 'direct-bridge' has no inbound QoS set

Actual results:
When start vm, the interface type='network' which point to a direct type interface pool will accept the floor setting;
When set Qos by domiftune, the interface type='direct' which do not connect to a interface poll will accept the floor setting.

Expected results:
The direct type interface should not accept the floor setting whether it is connected to an interface pool

Additional info:

Comment 1 Pavel Mores 2020-01-13 13:45:46 UTC
Hi, I'm looking into fixing this bug, however I'm not clear on some configuration details of the domain (especially how the macvtap0 interface is configured).  Could you please attach the full domain XML, ideally both active and inactive?  Thanks in advance!

Comment 3 Jing Qi 2020-01-14 07:30:27 UTC
Created attachment 1652124 [details]
rhel8.1 inactive xml

Comment 4 Jing Qi 2020-01-14 07:31:17 UTC
Created attachment 1652125 [details]
rhel8.1 active xml

Comment 5 Jing Qi 2020-01-14 07:41:25 UTC
Pavel, 
 Since Yalan didn't give the details about macvtap0, I guess the configuration from below part of her comment - 

 #virsh domiflist rhel
 Interface   Type     Source          Model    MAC
------------------------------------------------------------------
 macvtap0    direct   ens1f0          virtio   52:54:00:c5:da:e0
 macvtap1    direct   direct-bridge   virtio   52:54:00:54:bf:65
 
The configuration of macvtap0 should be as below - 
   <interface type='direct'>
      <mac address='52:54:00:d9:00:6b'/>
      <source dev='eno1' mode='bridge'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
 
The configuration of macvtap1 is as below - 
   <interface type='network'>
      <mac address='52:54:00:d9:00:6a'/>
      <source network='direct-bridge'/>
      <bandwidth>
        <inbound average='200' peak='300' floor='100' burst='256'/>
        <outbound average='300' peak='200' burst='256'/>
      </bandwidth>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </interface>

The 'direct-bridge' network configuration is as below -
<network trustGuestRxFilters='yes'>
  <name>direct-bridge</name>
  <uuid>b9f35f3d-fbb9-45a4-b7c2-0abb6121138a</uuid>
  <forward dev='eno1' mode='bridge'>
    <interface dev='eno1'/>
  </forward>
</network><network trustGuestRxFilters='yes'>
  <name>direct-bridge</name>
  <uuid>b9f35f3d-fbb9-45a4-b7c2-0abb6121138a</uuid>
  <forward dev='eno1' mode='bridge'>
    <interface dev='eno1'/>
  </forward>
</network>

 Please contact me if there is any concern. Thanks!

 Jing Qi

Comment 6 Jing Qi 2020-01-14 07:44:08 UTC
Correct last comment - 
The 'direct-bridge' network configuration is as below -
<network trustGuestRxFilters='yes'>
  <name>direct-bridge</name>
  <uuid>b9f35f3d-fbb9-45a4-b7c2-0abb6121138a</uuid>
  <forward dev='eno1' mode='bridge'>
    <interface dev='eno1'/>
  </forward>
</network>

Comment 7 Pavel Mores 2020-02-10 16:22:44 UTC
Posted a proposed fix: https://www.redhat.com/archives/libvir-list/2020-February/msg00403.html

Comment 8 Michal Privoznik 2020-02-17 16:34:40 UTC
I've pushed patches upstream:

ccf7567329 docs: QoS parameter 'floor' is supported for 'open' networks too
e32934062d qemu: call networkPlugBandwidth() for all types of network
aa985af212 qemu: check if 'floor' is supported for given interface and network
92a71456ac qemu: fail on attempt to set 'floor' if interface type is not 'network'
17f430eb5c qemu: test if bandwidth has 'floor' factored out to separate function

v6.0.0-406-gccf7567329

Comment 11 Jing Qi 2020-06-18 03:36:50 UTC
Verified with libvirt-6.4.0-1.module+el8.3.0+6881+88468c00.x86_64 & qemu-kvm-5.0.0-0.module+el8.3.0+6620+5d5e1420.x86_64

1.virsh net-dumpxml direct-bridge
<network connections='1' trustGuestRxFilters='yes'>
  <name>direct-bridge</name>
  <uuid>b9f35f3d-fbb9-45a4-b7c2-0abb6121138a</uuid>
  <forward dev='eth0' mode='bridge'>
    <interface dev='eth0' connections='1'/>
  </forward>
</network>

2. <interface type='direct'>
      <mac address='52:54:00:d9:00:6a'/>
      <source network='direct-bridge' portid='32d5c732-81aa-43f2-901e-27b7756b3420' dev='eth0' mode='bridge'/>
      <bandwidth>
       <inbound average='200' peak='300' floor='100' burst='256'/>
        <outbound average='300' peak='200' burst='256'/>
      </bandwidth>
      <target dev='macvtap1'/>
      <model type='virtio'/>
      <alias name='net2'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </interface>
3.#virsh start avocado-vt-vm1
error: Failed to start domain avocado-vt-vm1
error: Operation not supported: Invalid use of 'floor' on interface with MAC address 52:54:00:d9:00:6a - 'floor' is only supported for interface type 'network' with forward type 'nat', 'route', 'open' or none

4.Change the domain xml to -
 
 <interface type='direct'>
      <mac address='52:54:00:d9:00:6b'/>
      <source dev='eth0' mode='bridge'/>
      <target dev='macvtap0'/>
      <model type='virtio'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </interface>
    <interface type='direct'>
      <mac address='52:54:00:d9:00:6a'/>
      <source network='direct-bridge' portid='32d5c732-81aa-43f2-901e-27b7756b3420' dev='eth0' mode='bridge'/>
      <bandwidth>
        <outbound average='300' peak='200' burst='256'/>
      </bandwidth>
      <target dev='macvtap1'/>
      <model type='virtio'/>
      <alias name='net2'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </interface>

#virsh start avocado-vt-vm1
Domain avocado-vt-vm1 started

5. # virsh domiflist avocado-vt-vm1
 Interface   Type      Source          Model    MAC
-------------------------------------------------------------------
 macvtap0    direct    eth0            virtio   52:54:00:d9:00:6b
 macvtap1    direct    direct-bridge   virtio   52:54:00:d9:00:6a

6.# virsh domiftune avocado-vt-vm1 macvtap0 200,300,128,100 100,200,200
error: Unable to set interface parameters
error: Operation not supported: Invalid use of 'floor' on interface with MAC address 52:54:00:d9:00:6b - 'floor' is only supported for interface type 'network' with forward type 'nat', 'route', 'open' or none

# virsh domiftune avocado-vt-vm1 macvtap1 200,300,128,100 100,200,200
error: Unable to set interface parameters
error: Operation not supported: Invalid use of 'floor' on interface with MAC address 52:54:00:d9:00:6a - 'floor' is only supported for interface type 'network' with forward type 'nat', 'route', 'open' or none

From above test, the direct type interface in any connecting type does not accept the floor setting.

Comment 14 errata-xmlrpc 2020-11-17 17:45:27 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 (virt:8.3 bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2020:5137


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