]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: Clarify 'burst' units for QoS
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 3 Jan 2022 14:56:43 +0000 (15:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 4 Jan 2022 15:40:10 +0000 (16:40 +0100)
The burst attribute for bandwidth specifies how much bytes can be
transmitted in a single burst. Therefore, the unit is in
multiples of 1024 (thus kibibytes) not SI-like 1000. It has
always been like that.

The 'tc' output is still confusing though, for instance:

  # tc class add dev $DEV parent 1: classid 1:1 htb rate 1000kbps burst 2097152
  # tc class show dev vnet2
  class htb 1:1 root rate 8Mbit ceil 8Mbit burst 2Mb cburst 1600b

Please note that 2097152 = 2*1024*1024. Even the man page is
confusing. From tc(8):

  kb or k        Kilobytes
  mb or m        Megabytes

But I guess this is because 'tc' predates IEC standardisation of
binary multiples and thus can't change without breaking scripts
parsing its output.

And while at it, adjust _virNetDevBandwidthRate struct member
description, to make it obvious which members use SI/IEC units.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
docs/formatnetwork.html.in
src/util/virnetdevbandwidth.h

index b1b2391f431ce4e1798daeb4ba95d709b144b064..fad43f77eaf75ccabdcf4b2bd53ebc5e743fefc6 100644 (file)
           </dd>
           <dt><code>burst</code></dt>
           <dd>
-          Optional attribute which specifies the amount of kilobytes that
+          Optional attribute which specifies the amount of kibibytes that
           can be transmitted in a single burst at <code>peak</code> speed.
           </dd>
           <dt><code>floor</code></dt>
index 3d520721f616022b8ddc32d4fdaa0c3039f7b949..c82029fc0f96c633d967cbe9338132da3ee5c734 100644 (file)
 
 typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate;
 struct _virNetDevBandwidthRate {
-    unsigned long long average;  /* kbytes/s */
-    unsigned long long peak;     /* kbytes/s */
-    unsigned long long floor;    /* kbytes/s */
-    unsigned long long burst;    /* kbytes */
+    unsigned long long average;  /* kilobytes/s */
+    unsigned long long peak;     /* kilobytes/s */
+    unsigned long long floor;    /* kilobytes/s */
+    unsigned long long burst;    /* kibibytes */
 };
 
 typedef struct _virNetDevBandwidth virNetDevBandwidth;