[ovs-dev] [threads v2 08/13] byteq: Make the queue size variable instead of fixed at BYTEQ_SIZE bytes.

Alex Wang alexw at nicira.com
Wed Jul 17 19:34:59 UTC 2013


Yes, it makes sense, since we use uint here. Thanks for the explanation.


On Wed, Jul 17, 2013 at 11:45 AM, Ben Pfaff <blp at nicira.com> wrote:

> On Wed, Jul 17, 2013 at 11:26:06AM -0700, Alex Wang wrote:
> > Just one question, for the code below in "lib/byteq.c"
> >
> > """
> > /* Returns the number of bytes current queued in 'q'. */
> > int
> > byteq_used(const struct byteq *q)
> > {
> >     return q->head - q->tail;
> > }
> > """
> >
> > Is it possible that the jsonrpc session last so long that the 'q->head'
> > gets overflowed? or the chance is so slim that we do not care,
>
> It can overflow but it doesn't matter, arithmetic modulo 2**N will
> always do the right thing anyway.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130717/a7fd6d9b/attachment-0003.html>


More information about the dev mailing list