]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bandwidth: Attach sfq to leaf node
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 19 Nov 2012 11:16:07 +0000 (12:16 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 11 Dec 2012 17:16:52 +0000 (18:16 +0100)
Stochastic Fairness Queuing (SFQ) is queuing discipline
(qdisc) which doesn't really shape any traffic but 'just'
re-arrange packets in sending buffer so no stream starve.
The goal is to ensure fairness. There is basically only one
configuration parameter (perturb) which is set to advised
value of 10.

src/util/virnetdevbandwidth.c

index bddb7888846008cf37c2108ba847c7a62df3096e..49fc4259a77a6ca47100caac8838f91550425115 100644 (file)
@@ -101,6 +101,15 @@ virNetDevBandwidthSet(const char *ifname,
         if (virCommandRun(cmd, NULL) < 0)
             goto cleanup;
 
+        virCommandFree(cmd);
+        cmd = virCommandNew(TC);
+        virCommandAddArgList(cmd, "qdisc", "add", "dev", ifname, "parent",
+                             "1:1", "handle", "2:", "sfq", "perturb",
+                             "10", NULL);
+
+        if (virCommandRun(cmd, NULL) < 0)
+            goto cleanup;
+
         virCommandFree(cmd);
         cmd = virCommandNew(TC);
         virCommandAddArgList(cmd,"filter", "add", "dev", ifname, "parent",