@@ -178,12 +178,10 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
}
if (opt.limit == 0) {
- double lim = opt.rate.rate*(double)latency/TIME_UNITS_PER_SEC + buffer;
- if (opt.peakrate.rate) {
- double lim2 = opt.peakrate.rate*(double)latency/TIME_UNITS_PER_SEC + mtu;
- if (lim2 < lim)
- lim = lim2;
- }
+ double lim = opt.rate.rate*(double)latency/TIME_UNITS_PER_SEC;
+ if (opt.peakrate.rate && (lim < mtu))
+ lim = mtu;
+
opt.limit = lim;
}
@@ -263,12 +261,7 @@ static int tbf_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
if (show_raw)
fprintf(f, "limit %s ", sprint_size(qopt->limit, b1));
- latency = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->rate.rate) - tc_core_tick2time(qopt->buffer);
- if (qopt->peakrate.rate) {
- double lat2 = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->peakrate.rate) - tc_core_tick2time(qopt->mtu);
- if (lat2 > latency)
- latency = lat2;
- }
+ latency = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->rate.rate);
fprintf(f, "lat %s ", sprint_time(latency, b1));
if (qopt->rate.overhead) {