Hello, some time ago, I've reported what I thought to be libvirt regression:
https://gitlab.com/libvirt/libvirt/-/issues/284 In newer versions of libvirt (we've tried 7.6.0, 7.10.0, 8.1.0) VLAN bandwidth setting seems to misbehave. It is OK for us in libvirt 7.0.0 Steps to reproduce 1) create VM with ID ie xxx 2) domiftune xxx vnet0 --inbound 12800,0,0 --outbound 12800,0,0 3) check the values: tc class show dev vnet0 class htb 1:1 parent 1:fffe prio 0 rate 10Mbit ceil 10Mbit burst 1563b cburst 1563b class htb 1:fffe root rate 10Mbit ceil 10Mbit burst 1500b cburst 1500b 4) with libvirt 7.0.0, the result is as follows: class htb 1:1 root leaf 2: prio 0 rate 102400Kbit ceil 102400Kbit burst 1587b cburst 1587b XML snippet of network configuration after setting speed: VM config: <interface type='bridge'> <mac address='00:16:3e:00:00:df'/> <source bridge='brovs'/> <vlan> <tag id='0'/> </vlan> <virtualport type='openvswitch'> <parameters interfaceid='2a57d642-d9e1-45a6-b6ac-5df41f0a55a1'/> </virtualport> <bandwidth> <inbound average='128000'/> <outbound average='128000'/> </bandwidth> <target dev='vnet0'/> <model type='virtio'/> <driver name='vhost'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> discussing with one of libvirt authors, he get into conclusion: """ Unfortunately, these logs don't cover much really (in libvirt7.0.0.txt.gz there's no invocation of ovs-vsctl nor tc), but anyway, from libvirt8.1.0.txt.gz: ovs-vsctl --timeout=5 set port vnet2 qos=@qos1 "external-ids:vm-id=\"21857346-9936-11ec-abb2-ac1f6b7fa88b\"" "external-ids:ifname=\"vnet2\"" -- \ --id=@qos1 create qos type=linux-htb other_config:min-rate=102400000 queues:0=@queue0 "external-ids:vm-id=\"21857346-9936-11ec-abb2-ac1f6b7fa88b\"" "external-ids:ifname=\"vnet2\"" -- \ --id=@queue0 create queue other_config:min-rate=102400000 "external-ids:vm-id=\"21857346-9936-11ec-abb2-ac1f6b7fa88b\"" "external-ids:ifname=\"vnet2\"" ovs-vsctl --timeout=5 set Interface vnet2 ingress_policing_rate=102400 Now, looking into OpenVSwitch documentation, while not exactly specified anywhere I can deduct that min-rate units are in bits per second (must resist pointing out how badly the docs are written and how bad the choice of units is). Anyway, libvirt documents that average is in kilobytes per second. Therefore, 12800 KB/s = 12800 * 1000 * 8 bits per second = 102400000 which is exactly the value libvirt passes to OVS. Then, again because of lack of proper documentation for ingress_policing_rate I can only deduct from given examples that units for ingress_policing_rate are kilobits per second (yep, previous attribute used different units, so much for consistency). Again, libvirt documents 'average` is in kilobytes per second, hence 12800 KB/s = 128000 * 8 kilobits per second = 102400 which again is exactly the value that libvirt passes to OVS. Long story short, I believe you just helped me prove the bug is in OVS (I wouldn't be surprised is they cared only about Centos-8 or newer). Therefore, I'm inclined to close this. Please feel free to object. """ So we think there might be bug in openvswitch.. Would you have a look at it? If I could provide any further information, please let me know. with best regards nikola ciprich -- ------------------------------------- Ing. Nikola CIPRICH LinuxBox.cz, s.r.o. 28.rijna 168, 709 00 Ostrava tel.: +420 591 166 214 fax: +420 596 621 273 mobil: +420 777 093 799 www.linuxbox.cz mobil servis: +420 737 238 656 email servis: ser...@linuxbox.cz ------------------------------------- _______________________________________________ discuss mailing list disc...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-discuss