2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

qos: Remove min-rate requirement for linux-htb and linux-hfsc.

One could quite reasonably desire to create a queue with no
min-rate.  For example, a default queue could be reasonably
configured without a min-rate or a max-rate.  This commit removes
the requirement that min-rate be configured on all queues.  If not
configured, defaults to something very small.
This commit is contained in:
Ethan Jackson
2011-03-15 11:50:53 -07:00
parent 34d84bb951
commit c45ab5e9b7
2 changed files with 4 additions and 13 deletions

View File

@@ -2497,12 +2497,7 @@ htb_parse_class_details__(struct netdev *netdev,
return EINVAL;
}
/* 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 = min_rate_s ? strtoull(min_rate_s, NULL, 10) / 8 : 0;
hc->min_rate = MAX(hc->min_rate, 1500);
hc->min_rate = MIN(hc->min_rate, htb->max_rate);
@@ -2977,11 +2972,7 @@ hfsc_parse_class_details__(struct netdev *netdev,
min_rate_s = shash_find_data(details, "min-rate");
max_rate_s = shash_find_data(details, "max-rate");
if (!min_rate_s) {
return EINVAL;
}
min_rate = strtoull(min_rate_s, NULL, 10) / 8;
min_rate = min_rate_s ? strtoull(min_rate_s, NULL, 10) / 8 : 0;
min_rate = MAX(min_rate, 1500);
min_rate = MIN(min_rate, hfsc->max_rate);