All of lore.kernel.org
 help / color / mirror / Atom feed
* Re:  [LARTC] was tcng error; now found bug in tcc]
@ 2003-11-27 18:16 lartc
  2003-11-28  7:45 ` [LARTC] was tcng error; now found bug in tcc lartc
  0 siblings, 1 reply; 2+ messages in thread
From: lartc @ 2003-11-27 18:16 UTC (permalink / raw)
  To: lartc

hi all,

after slicing and dicing, i found that i had cut and pasted bad syntax,
so i have solved the problem posted in my first message.

that said, i have found an issue in 9h and 9i of tcng running on a
bi-processor with redhat-8 up2date with 2.4.20 kernel.

here's a small tcng cfg:


#define DEVICE eth0
#define UPLINK 512 

dev DEVICE {
    egress {
        htb () {
            class (rate UPLINK kbps) {
            }
        }
    }
}

[root]# cat tc.bug | tcc
tc qdisc add dev eth0 handle 1:0 root dsmark indices 1 default_index 0
tc qdisc add dev eth0 handle 2:0 parent 1:0 htb
tc class add dev eth0 parent 2:0 classid 2:1 htb rate 64000bps
------------------------------------------------------^^^^^^^^

notice that the UPLINK of 512 kbps (arguably 524288 bps) has been
incorrectly calculated as 64000 bps

similarly, the following:

#define DEVICE eth0
#define UPLINK 64 

dev DEVICE {
    egress {
        htb () {
            class (rate UPLINK kBps) {
            }
        }
    }
}

[root]# cat tc.bug | tcc
tc qdisc add dev eth0 handle 1:0 root dsmark indices 1 default_index 0
tc qdisc add dev eth0 handle 2:0 parent 1:0 htb
tc class add dev eth0 parent 2:0 classid 2:1 htb rate 64000bps
------------------------------------------------------^^^^^^^^

if i express the UPLINK in kilobytes/s, then the rate has been
incorrectly multiplied by 1000 instead equaling 64 * 8 * 1024 = 524288


have i missed something, or indeed there is a problem??

many thanks

charles

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [LARTC] was tcng error; now found bug in tcc
  2003-11-27 18:16 [LARTC] was tcng error; now found bug in tcc] lartc
@ 2003-11-28  7:45 ` lartc
  0 siblings, 0 replies; 2+ messages in thread
From: lartc @ 2003-11-28  7:45 UTC (permalink / raw)
  To: lartc

hi werner,

thanks very much -- i've got it now!

btw, tcng is just great -- simply marvelous!

cheers

charles


On Thu, 2003-11-27 at 20:06, Werner Almesberger wrote:
> lartc@manchotnetworks.net wrote:
> > have i missed something, or indeed there is a problem??
> 
> No, all this should be correct - in "tc", "bps" means Bytes per
> second. And in tcng, rates and packets use the multiplier 1000,
> while bit and byte sizes use the multiplier 1024. This just
> follows what is the most common use for the respective unit.
> 
> If you don't like the 1000 multiplier, you can just
> 
> #define bps b/1s
> #define kbps kb/1s
> #define Mbps Mb/1s
> #define Gbps Gb/1s
> #define Bps B/1s
> #define kBps kB/1s
> #define MBps MB/1s
> #define GBps GB/1s
> 
> - Werner

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-28  7:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-27 18:16 [LARTC] was tcng error; now found bug in tcc] lartc
2003-11-28  7:45 ` [LARTC] was tcng error; now found bug in tcc lartc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.