commit 1e89442468dca983e0e3d24b89093370896f2d6a Author: Jesper Dangaard Brouer Date: Mon Sep 3 15:49:41 2007 +0200 [IPROUTE2]: Overhead calculation is now done in the kernel. The only current user is HTB. HTB overhead argument is now passed on the kernel (in the struct tc_ratespec). Signed-off-by: Jesper Dangaard Brouer diff --git a/tc/q_htb.c b/tc/q_htb.c index 53e3f78..b579ebe 100644 --- a/tc/q_htb.c +++ b/tc/q_htb.c @@ -206,9 +206,11 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str if (!buffer) buffer = opt.rate.rate / get_hz() + mtu; if (!cbuffer) cbuffer = opt.ceil.rate / get_hz() + mtu; -/* encode overhead and mpu, 8 bits each, into lower 16 bits */ - mpu = (unsigned)mpu8 | (unsigned)overhead << 8; - opt.ceil.mpu = mpu; opt.rate.mpu = mpu; + opt.ceil.overhead = overhead; + opt.rate.overhead = overhead; + + opt.ceil.mpu = mpu; + opt.rate.mpu = mpu; if ((cell_log = tc_calc_rtable(opt.rate.rate, rtab, cell_log, mtu, mpu)) < 0) { fprintf(stderr, "htb: failed to calculate rate table.\n"); diff --git a/tc/tc_core.c b/tc/tc_core.c index 58155fb..1ab0ba0 100644 --- a/tc/tc_core.c +++ b/tc/tc_core.c @@ -73,8 +73,6 @@ int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu, unsigned mpu) { int i; - unsigned overhead = (mpu >> 8) & 0xFF; - mpu = mpu & 0xFF; if (mtu == 0) mtu = 2047; @@ -86,8 +84,6 @@ int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu, } for (i=0; i<256; i++) { unsigned sz = (i<