[Click] Re: small bug--? in SimpleQueue element

Eddie Kohler kohler at cs.ucla.edu
Fri Nov 4 13:31:49 EST 2005


Hi Yuliang,

I don't understand the problem you're referring to, but your fix is certainly 
wrong.  Click's queues store packets in a circular array; comparing next and 
_capacity is correct.

Eddie


Yuliang Li, Electrical & Electronic Engineering wrote:
> Dear Eddie:
> Thank you very much for your Click. It is really interesting and powerful.
> 
> My name is Yuliang Li. I am a third year PhD student from the University 
> of Bristol, UK. I am using Click to do some implementation in the area 
> of Congestion Control.
> 
> I found a small problem when I am using the SimpleQueue element. It 
> never gives me the number of packets which have been dropped at whatever 
> the source rate is. So I changed the 'push' function, to let 'next' 
> comparing with the '_capacity' (originally comparing with '_head'). It 
> seems this is more reasonable.
> 
> 
> void
> SimpleQueue::push(int, Packet *p)
> {
>    // If you change this code, also change NotifierQueue::push().
>    int next = next_i(_tail);
> 
>    // should this stuff be in SimpleQueue::enq?
>    if (next != _capacity) {
>        _q[_tail] = p;
>        _tail = next;
> 
>        int s = size();
>        if (s > _highwater_length)
>            _highwater_length = s;
> 
>    } else {
>        // if (!(_drops % 100))
>        if (_drops == 0)
>            click_chatter("%{element}: overflow", this);
>        _drops++;
>        p->kill();
>    }
> }
> 
> Do you think is this a small bug in the program? Or are their any 
> special meaning for using '_head'.
> 
> Thank you very much
> 
> 
> 
> *****************************************************************
>  Yuliang Li           PhD student
> Wireless and Networks Research Laboratory
> Department of Electrical and Electronic Engineering
> University of Bristol    Bristol     BS8 1UB
> United Kingdom                   Tel: +44 117 3315059
> Email: Yuliang.Li at bristol.ac.uk
> *****************************************************************
> 
> 



More information about the click mailing list