From: Michal Privoznik Date: Mon, 19 Nov 2012 11:16:07 +0000 (+0100) Subject: bandwidth: Attach sfq to leaf node X-Git-Tag: v1.0.1-rc1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e5040bd200b9ca401a5beb250f95d61a0edbf74;p=thirdparty%2Flibvirt.git bandwidth: Attach sfq to leaf node 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. --- diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c index bddb788884..49fc4259a7 100644 --- a/src/util/virnetdevbandwidth.c +++ b/src/util/virnetdevbandwidth.c @@ -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",