]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virnetdevopenvswitch: unify calculation of ovs and tc
authorzhangjl02 <zhangjl02@inspur.com>
Mon, 1 Nov 2021 07:39:55 +0000 (15:39 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Nov 2021 14:56:47 +0000 (15:56 +0100)
For other interface type, values in tc rules are calculated by
multiply by 8*1000 instead of 8*1024.

Signed-off-by: zhangjl02 <zhangjl02@inspur.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdevopenvswitch.c
tests/virnetdevopenvswitchtest.c

index 8955f0fa6680a53211fee950126857d68362cc9e..250726a633c685a307c2511fa6bf582f78bc1cdf 100644 (file)
@@ -642,7 +642,7 @@ virNetDevOpenvswitchFindUUID(const char *table,
  * However other_config in ovs qos is in bit.
  * ingress_policing_rate in ovs interface is in kbit.
  */
-#define VIR_NETDEV_TX_TO_OVS 8192
+#define VIR_NETDEV_TX_TO_OVS 8000
 #define VIR_NETDEV_RX_TO_OVS 8
 
 /**
index 2a20ba82d09e41ddc80e4e31b6e7a61eac1d3cf7..57860f4bc422b8fed9f1428aebf2c5cc698c936e 100644 (file)
@@ -274,10 +274,10 @@ mymain(void)
                  OVS_VSCTL " --timeout=5 set port tap-fake qos=@qos1"
                            " 'external-ids:vm-id=\"66616b65-7575-6964-0000-000000000000\"'"
                            " 'external-ids:ifname=\"tap-fake\"'"
-                           " -- --id=@qos1 create qos type=linux-htb other_config:min-rate=163840000"
+                           " -- --id=@qos1 create qos type=linux-htb other_config:min-rate=160000000"
                            " queues:0=@queue0 'external-ids:vm-id=\"66616b65-7575-6964-0000-000000000000\"'"
                            " 'external-ids:ifname=\"tap-fake\"'"
-                           " -- --id=@queue0 create queue other_config:min-rate=163840000 "
+                           " -- --id=@queue0 create queue other_config:min-rate=160000000 "
                            "'external-ids:vm-id=\"66616b65-7575-6964-0000-000000000000\"'"
                            " 'external-ids:ifname=\"tap-fake\"'\n"
                  OVS_VSCTL " --timeout=5 set Interface tap-fake ingress_policing_rate=0 ingress_policing_burst=0\n"));