From: Justin Pettit
Date: Fri, 8 Oct 2010 21:18:28 +0000 (-0700)
Subject: netdev: Enforce a floor "linux-htb" min-rate
X-Git-Tag: v1.0.2~1
X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=ff9a6b34ed9fa087df43ca6aabca5e3b3e532146
netdev: Enforce a floor "linux-htb" min-rate
---
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 7668eff9f..c468a0358 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2384,13 +2384,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 979fd5dfe..c1f2c9801 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -825,7 +825,8 @@
column="type"/> of min-rate
are:
min-rate
- - Minimum guaranteed bandwidth, in bit/s. Required.
+ - Minimum guaranteed bandwidth, in bit/s. Required. The
+ floor value is 1500 bytes/s (12,000 bit/s).
The key-value pairs defined for of linux-htb
are: