From: Justin Pettit
Date: Fri, 8 Oct 2010 21:18:28 +0000 (-0700)
Subject: netdev: Enforce a floor "linux-htb" min-rate
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da3827b5518ed6cd2256ba87eddd1c40bbca75f0;p=openvswitch
netdev: Enforce a floor "linux-htb" min-rate
---
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index dfea605d..06f739cd 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 8b2221b8..bbe4af15 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1042,7 +1042,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: