[pve-devel] [PATCH common] net: tap_plug() needs to apply rate limiting

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Mar 8 13:54:44 CET 2016


Any action we take in tap_plug() when using OVS will undo
our rate limiting, which means any hotplug change must
restore the previous rate setting.
Since this means tap_plug() would always be followed by a
tap_rate_limit() call anyway we just include the rate
parameter here and let the caller decide whether the full
tap_plug() is required or the simple tap_rate_limit()
suffices.
---
This is preparation to fix bug #909

 src/PVE/Network.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm
index 5d26529..2d6781a 100644
--- a/src/PVE/Network.pm
+++ b/src/PVE/Network.pm
@@ -319,7 +319,7 @@ my $cleanup_firewall_bridge = sub {
 };
 
 sub tap_plug {
-    my ($iface, $bridge, $tag, $firewall, $trunks) = @_;
+    my ($iface, $bridge, $tag, $firewall, $trunks, $rate) = @_;
 
     #cleanup old port config from any openvswitch bridge
     eval {run_command("/usr/bin/ovs-vsctl del-port $iface", outfunc => sub {}, errfunc => sub {}) };
@@ -352,6 +352,8 @@ sub tap_plug {
 	    &$ovs_bridge_add_port($bridge, $iface, $tag, undef, $trunks);
 	}
     }
+
+    tap_rate_limit($iface, $rate);
 }
 
 sub tap_unplug {
-- 
2.1.4





More information about the pve-devel mailing list