netdev: Enforce a floor "linux-htb" min-rate
authorJustin Pettit <jpettit@nicira.com>
Fri, 8 Oct 2010 21:18:28 +0000 (14:18 -0700)
committerJustin Pettit <jpettit@nicira.com>
Fri, 8 Oct 2010 23:46:48 +0000 (16:46 -0700)
lib/netdev-linux.c
vswitchd/vswitch.xml

index 7668eff..c468a03 100644 (file)
@@ -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 */
index 979fd5d..c1f2c98 100644 (file)
         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>