From: Dietmar Maurer Date: Mon, 28 Jan 2013 06:00:04 +0000 (+0100) Subject: tc: use rate filter with mtu 64k X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=fb572a93953215a4db15513353f1af517a17eb50 tc: use rate filter with mtu 64k also see: http://www.redhat.com/archives/libvir-list/2012-June/msg01306.html --- diff --git a/Makefile b/Makefile index fb329a1..0a34031 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ RELEASE=2.3 VERSION=1.0 -PKGREL=41 +PKGREL=42 PACKAGE=libpve-common-perl diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm index 2c356eb..a3551de 100644 --- a/data/PVE/Network.pm +++ b/data/PVE/Network.pm @@ -16,12 +16,12 @@ sub setup_tc_rate_limit { 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 diff --git a/debian/changelog b/debian/changelog index 5d1cb69..d439a35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 28 Jan 2013 06:59:32 +0100 + libpve-common-perl (1.0-41) unstable; urgency=low * correctly count physical sockets