[pve-devel] [PATCH] Bugfix 860: fix the upload from a VM when it is restricted.

Dietmar Maurer dietmar at proxmox.com
Mon Aug 17 09:13:19 CEST 2015


I think we need this cleanup?

diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index e1e22b0..ff4a89c 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -67,7 +67,7 @@ sub setup_tc_rate_limit {
      my ($iface, $rate, $burst, $debug) = @_;

      system("/sbin/tc class del dev $iface parent 1: classid 1:1 
 >/dev/null 2>&1");
-    system("/sbin/tc filter del dev $iface parent ffff: protocol ip 
prio 50 estimator 1sec 8sec >/dev/null 2>&1");
+    system("/sbin/tc filter del dev $iface parent ffff: protocol all 
pref 50 u32 >/dev/null 2>&1");
      system("/sbin/tc qdisc del dev $iface ingress >/dev/null 2>&1");
      system("/sbin/tc qdisc del dev $iface root >/dev/null 2>&1");



On 08/14/2015 11:42 AM, Wolfgang wrote:
> ---
>   src/PVE/Network.pm | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
> index b9d2d37..92162c3 100644
> --- a/src/PVE/Network.pm
> +++ b/src/PVE/Network.pm
> @@ -73,15 +73,6 @@ sub setup_tc_rate_limit {
>   
>       return if !$rate;
>   
> -    run_command("/sbin/tc qdisc add dev $iface handle ffff: ingress");
> -
> -    # this does not work wit virtio - don't know why (setting "mtu 64kb" does not help)
> -    #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");
> -
>       # tbf does not work for unknown reason
>       #$TC qdisc add dev $DEV root tbf rate $RATE latency 100ms burst $BURST
>       # so we use htb instead
> @@ -89,6 +80,12 @@ sub setup_tc_rate_limit {
>       run_command("/sbin/tc class add dev $iface parent 1: classid 1:1 " .
>   		"htb rate ${rate}bps burst ${burst}b");
>   
> +    run_command("/sbin/tc qdisc add dev $iface ingress");
> +    run_command("/sbin/tc filter add dev $iface parent ffff: " .
> +		"protocol all prio 50 u32 match u32 0 0 " .
> +		"police rate ${rate}bps burst ${burst}b mtu 64kb " .
> +		"drop flowid :1");
> +
>       if ($debug) {
>   	print "DEBUG tc settings\n";
>   	system("/sbin/tc qdisc ls dev $iface");





More information about the pve-devel mailing list