Adds mpu support to HTB (ATM) queueing discipline

(Logical change 1.58)
This commit is contained in:
osdl.net!shemminger 2004-07-30 20:26:15 +00:00
parent ad273962a1
commit 934677a23e
1 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,8 @@ 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;
@ -61,6 +63,8 @@ int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu,
}
for (i=0; i<256; i++) {
unsigned sz = (i<<cell_log);
if (overhead)
sz += overhead;
if (sz < mpu)
sz = mpu;
rtab[i] = tc_core_usec2tick(1000000*((double)sz/bps));