]> git.proxmox.com Git - pve-common.git/commitdiff
tc: use rate filter with mtu 64k
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 28 Jan 2013 06:00:04 +0000 (07:00 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 28 Jan 2013 06:00:04 +0000 (07:00 +0100)
also see: http://www.redhat.com/archives/libvir-list/2012-June/msg01306.html

Makefile
data/PVE/Network.pm
debian/changelog

index fb329a1bffe6d6762a33a1cd91f38bbe27688dd0..0a34031f4f866b7f4090cdacfec96275dbb8149f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 RELEASE=2.3
 
 VERSION=1.0
 RELEASE=2.3
 
 VERSION=1.0
-PKGREL=41
+PKGREL=42
 
 PACKAGE=libpve-common-perl
 
 
 PACKAGE=libpve-common-perl
 
index 2c356ebe4af455762f7ac7f6c3b178d061bce376..a3551deea49b24d6737947d62f7c7cc7ccaa87c8 100644 (file)
@@ -16,12 +16,12 @@ sub setup_tc_rate_limit {
 
     run_command("/sbin/tc qdisc add dev $iface handle ffff: ingress");
 
 
     run_command("/sbin/tc qdisc add dev $iface handle ffff: ingress");
 
-    # this does not work wit virtio - don't know why
-    #run_command("/sbin/tc filter add dev $iface parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate ${rate}bps burst ${burst}b drop flowid :1");
-    # so we use avrate instead
-    run_command("/sbin/tc filter add dev $iface parent ffff: " .
-               "protocol ip prio 50 estimator 1sec 8sec " .
-               "u32 match ip src 0.0.0.0/0 police avrate ${rate}bps drop flowid :1");
+    # virtio uses large packets 64K, so we need to set mtu to that
+    # value - else filter drops those packets and rate limit does not work.
+    run_command("/sbin/tc filter add dev $iface parent ffff: "
+               "protocol ip prio 50 u32 match ip src 0.0.0.0/0 "
+               "police rate ${rate}bps burst ${burst}b "
+               "mtu 64kb drop flowid :1");
 
     # tbf does not work for unknown reason
     #$TC qdisc add dev $DEV root tbf rate $RATE latency 100ms burst $BURST
 
     # tbf does not work for unknown reason
     #$TC qdisc add dev $DEV root tbf rate $RATE latency 100ms burst $BURST
index 5d1cb69835a90df77a84bfbc5fd7cae1c87b4f01..d439a359c52c09da6bbbc411799eb6680c9a56d5 100644 (file)
@@ -1,3 +1,9 @@
+libpve-common-perl (1.0-42) unstable; urgency=low
+
+  * tc: use rate filter with mtu 64k (instead of avrate)
+
+ -- Proxmox Support Team <support@proxmox.com>  Mon, 28 Jan 2013 06:59:32 +0100
+
 libpve-common-perl (1.0-41) unstable; urgency=low
 
   * correctly count physical sockets
 libpve-common-perl (1.0-41) unstable; urgency=low
 
   * correctly count physical sockets