[ovs-dev] [PATCH 2/2] netdev: Enforce a floor "linux-htb" min-rate
Justin Pettit
jpettit at nicira.com
Fri Oct 8 21:31:22 UTC 2010
---
lib/netdev-linux.c | 4 ++--
vswitchd/vswitch.xml | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index dfea605..06f739c 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2415,13 +2415,13 @@ htb_parse_class_details__(struct netdev *netdev,
const char *priority_s = shash_find_data(details, "priority");
int mtu;
- /* min-rate */
+ /* min-rate. Don't allow a min-rate below 1500 bytes/s. */
if (!min_rate_s) {
/* min-rate is required. */
return EINVAL;
}
hc->min_rate = strtoull(min_rate_s, NULL, 10) / 8;
- hc->min_rate = MAX(hc->min_rate, 0);
+ hc->min_rate = MAX(hc->min_rate, 1500);
hc->min_rate = MIN(hc->min_rate, htb->max_rate);
/* max-rate */
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 8b2221b..bbe4af1 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1042,7 +1042,8 @@
column="type"/> of <code>min-rate</code> are:</p>
<dl>
<dt><code>min-rate</code></dt>
- <dd>Minimum guaranteed bandwidth, in bit/s. Required.</dd>
+ <dd>Minimum guaranteed bandwidth, in bit/s. Required. The
+ floor value is 1500 bytes/s (12,000 bit/s).</dd>
</dl>
<p>The key-value pairs defined for <ref table="QoS"/> <ref table="QoS"
column="type"/> of <code>linux-htb</code> are:</p>
--
1.7.1
More information about the dev
mailing list