Bug 1912210 - errors about boundaries parameter of virsh domiftune
Summary: errors about boundaries parameter of virsh domiftune
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.4
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.4
Assignee: Michal Privoznik
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-04 05:59 UTC by Lili Zhu
Modified: 2021-11-16 08:05 UTC (History)
10 users (show)

Fixed In Version: libvirt-7.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 07:51:11 UTC
Type: Bug
Target Upstream Version: 7.2.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1910745 0 unspecified CLOSED [tc-htb] error when setting burst max value 2023-05-06 09:05:31 UTC
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:51:34 UTC

Description Lili Zhu 2021-01-04 05:59:35 UTC
Description of problem:
errors about boundaries parameter checking of virsh domiftune

Version-Release number of selected component (if applicable):
libvirt-6.10.0-1.module+el8.4.0+8898+a84e86e1.x86_64
kernel-4.18.0-260.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
Scenario A: set the guest interface's inbound bandwidth parameters
# virsh domiftune vm1 vnet8  --inbound 4294967295

# virsh domiftune vm1 vnet8
inbound.average: 4294967295
inbound.peak   : 0
inbound.burst  : 0
inbound.floor  : 0
outbound.average: 0
outbound.peak  : 0
outbound.burst : 0

(The upper boundary of inbound average is 4294967 of libvirt-daemon-6.0.0-10, it is 2^32-1, seems to be no upper limit.)

Scenario B: set the guest interface's outbound bandwidth parameters
1. # virsh domiftune vm1 vnet8 --outbound 4294967295
error: Unable to set interface parameters
error: internal error: Child process (tc filter add dev vnet8 parent ffff: protocol all u32 match u32 0 0 police rate 4294967295kbps burst 4294967295kb mtu 64kb drop flowid :1) unexpected exit status 255: Error: argument "4294967295kb" is wrong: buffer

2. # virsh domiftune vm1 vnet8 --outbound 4294967295,4294967295,4194303

# virsh domiftune vm1 vnet8
inbound.average: 4294967295
inbound.peak   : 0
inbound.burst  : 0
inbound.floor  : 0
outbound.average: 4294967295
outbound.peak  : 4294967295
outbound.burst : 4194303

(For the outbound boundary, it is the same with inbound boundary. However, the logical parameter setting via virsh cmd is not the same with inbound, please refer to Scenario A)

Scenario C: Set the outbound/inbound peak parameter outside of boundary
# virsh domiftune vm1 vnet8 --outbound 4294967295,4294967296,4194303
error: outbound rate larger than maximum 4294967295

(The error is better to be "error: outbound peak larger than maximum 4294967295" )

Actual results:
Check the descriptions in brackets at the end of every Scenario.

Comment 1 Lili Zhu 2021-01-04 06:02:36 UTC
Scenario A: set the guest interface's inbound bandwidth parameters
(The upper boundary of inbound average is 4294967 of libvirt-daemon-6.0.0-10, now it is 2^32-1, seems to be no upper limit.)

Comment 2 Fangge Jin 2021-01-04 06:19:03 UTC
Is it same as Bug 1910745 - [tc-htb] error when setting burst max value? Please check.

Comment 3 Lili Zhu 2021-01-04 09:09:54 UTC
(In reply to Fangge Jin from comment #2)
> Is it same as Bug 1910745 - [tc-htb] error when setting burst max value?
> Please check.

Almost the the same, but one point that I am confused is
# virsh domiftune vm1 vnet8  --inbound 4294967295

# echo $?
0

for outbound
# virsh domiftune vm1 vnet8 --outbound 4294967295
error: Unable to set interface parameters
error: internal error: Child process (tc filter add dev vnet8 parent ffff: protocol all u32 match u32 0 0 police rate 4294967295kbps burst 4294967295kb mtu 64kb drop flowid :1) unexpected exit status 255: Error: argument "4294967295kb" is wrong: buffer

The logic of setting the bandwidth parameter are not the same between inbound and outbound

Comment 4 smitterl 2021-01-27 19:24:24 UTC
(In reply to Lili Zhu from comment #0)
> Description of problem:
> errors about boundaries parameter checking of virsh domiftune
> 
> Version-Release number of selected component (if applicable):
> libvirt-6.10.0-1.module+el8.4.0+8898+a84e86e1.x86_64
> kernel-4.18.0-260.el8.x86_64
> 

...
> 1. # virsh domiftune vm1 vnet8 --outbound 4294967295
> error: Unable to set interface parameters
> error: internal error: Child process (tc filter add dev vnet8 parent ffff:
> protocol all u32 match u32 0 0 police rate 4294967295kbps burst 4294967295kb
> mtu 64kb drop flowid :1) unexpected exit status 255: Error: argument
> "4294967295kb" is wrong: buffer

I've seen almost the same error message when setting max values, issue in iproute: BZ1910745 Additional info 4. There it seems tc command isn't handling the max burst values well.

Comment 5 Michal Privoznik 2021-02-18 15:26:13 UTC
Lili, can you please elaborate why this is a bug? I mean, setting a value that is outside of boundaries should produce an error. Or is it that libvirt could provide better error message?

Comment 6 Lili Zhu 2021-03-03 17:07:28 UTC
(In reply to Michal Privoznik from comment #5)
> Lili, can you please elaborate why this is a bug? I mean, setting a value
> that is outside of boundaries should produce an error. Or is it that libvirt
> could provide better error message?

Hi, Michal

I am just confused about the difference for setting the "average" value.
I can only set the average value of inbound via
# virsh domiftune vm1 vnet8  --inbound 4294967295

# echo $?
0

But I can not do the same for outbound average value
# virsh domiftune vm1 vnet8 --outbound 4294967295
error: Unable to set interface parameters
error: internal error: Child process (tc filter add dev vnet8 parent ffff: protocol all u32 match u32 0 0 police rate 4294967295kbps burst 4294967295kb mtu 64kb drop flowid :1) unexpected exit status 255: Error: argument "4294967295kb" is wrong: buffer

As the testing result shows, the boundaries for outbound and inbound are exactly the same:
# virsh domiftune avocado-vt-vm1 vnet8
inbound.average: 4294967295
inbound.peak   : 4294967295
inbound.burst  : 4194303
inbound.floor  : 0
outbound.average: 4294967295
outbound.peak  : 4294967295
outbound.burst : 4194303

I thought outbound and inbound are equivalent, but the values for them can not be set via the same logic.

Comment 7 Michal Privoznik 2021-03-05 11:12:03 UTC
Patch proposed upstream:

https://listman.redhat.com/archives/libvir-list/2021-March/msg00288.html

Comment 8 Michal Privoznik 2021-03-09 08:58:22 UTC
Merged upstream as:

01e206c3e3 virnetdevbandwidth: Don't generate burst outside of boundaries

v7.1.0-144-g01e206c3e3

Comment 12 Lili Zhu 2021-06-03 06:06:13 UTC
Verify this bug with:
libvirt-7.4.0-1.module+el8.5.0+11218+83343022.x86_64

# virsh domiftune avocado-vt-vm1 vnet4 --outbound 4294967295

# virsh domiftune avocado-vt-vm1 vnet4
inbound.average: 0
inbound.peak   : 0
inbound.burst  : 0
inbound.floor  : 0
outbound.average: 4294967295
outbound.peak  : 0
outbound.burst : 0

Now can set the outbound average value alone to the value larger than
4194303, mark the bug as verified.

Comment 14 errata-xmlrpc 2021-11-16 07:51:11 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:av 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-2021:4684


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