[pve-devel] [PATCH 1/3] Network : add tap_rate_limit

Alexandre Derumier aderumier at odiso.com
Mon Mar 4 16:24:48 CET 2013


Moved from pve-bridge

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 data/PVE/Network.pm |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm
index c20951e..7d3707d 100644
--- a/data/PVE/Network.pm
+++ b/data/PVE/Network.pm
@@ -38,6 +38,15 @@ sub setup_tc_rate_limit {
     }
 }
 
+sub tap_rate_limit {
+    my ($iface, $rate) = @_;
+
+    my $debug = 0;
+    $rate = int($rate*1024*1024);
+    my $burst = 1024*1024;
+
+    setup_tc_rate_limit($iface, $rate, $burst, $debug);
+}
 
 sub copy_bridge_config {
     my ($br0, $br1) = @_;
-- 
1.7.10.4




More information about the pve-devel mailing list