From 689cbb7f0e03bf8695d80247078855759545e53c Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Thu, 29 Jan 2009 20:34:06 +0000 Subject: [PATCH] support turning off all queueing --- python/bwlimit.py | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/python/bwlimit.py b/python/bwlimit.py index 18fdaac..7b3cf05 100644 --- a/python/bwlimit.py +++ b/python/bwlimit.py @@ -154,24 +154,24 @@ default_share = 1 # be off by a small fraction. suffixes = { "": 1, - "bit": 1, - "kibit": 1024, - "kbit": 1000, - "mibit": 1024*1024, - "mbit": 1000000, - "gibit": 1024*1024*1024, - "gbit": 1000000000, - "tibit": 1024*1024*1024*1024, - "tbit": 1000000000000, - "bps": 8, - "kibps": 8*1024, - "kbps": 8000, - "mibps": 8*1024*1024, - "mbps": 8000000, - "gibps": 8*1024*1024*1024, - "gbps": 8000000000, - "tibps": 8*1024*1024*1024*1024, - "tbps": 8000000000000 + "bit": 1, + "kibit": 1024, + "kbit": 1000, + "mibit": 1024*1024, + "mbit": 1000000, + "gibit": 1024*1024*1024, + "gbit": 1000000000, + "tibit": 1024*1024*1024*1024, + "tbit": 1000000000000, + "bps": 8, + "kibps": 8*1024, + "kbps": 8000, + "mibps": 8*1024*1024, + "mbps": 8000000, + "gibps": 8*1024*1024*1024, + "gbps": 8000000000, + "tibps": 8*1024*1024*1024*1024, + "tbps": 8000000000000 } @@ -321,6 +321,13 @@ def tc(cmd): return run(TC + " " + cmd) +def stop(dev = dev): + ''' + Turn off all queing. Stops all slice HTBS and reverts to pfifo_fast (the default). + ''' + tc("qdisc del dev %s root" % dev) + + def init(dev = dev, bwcap = bwmax): """ (Re)initialize the bandwidth limits on this node @@ -617,7 +624,7 @@ Usage: %s [OPTION]... [COMMAND] [ARGUMENT]... Options: - -d device Network interface (default: %s) + -d device Network interface (default: %s) -r rate Node bandwidth cap (default: %s) -q quantum Share multiplier (default: %d bytes) -n Print rates in numeric bits per second -- 2.43.0