[ovs-dev] [tests+nxm-ofctl 30/42] queue: Get rid of ovs_queue data structure.

Ben Pfaff blp at nicira.com
Mon Dec 6 18:03:15 UTC 2010


On Sat, Dec 04, 2010 at 04:32:10PM -0800, Justin Pettit wrote:
> On Nov 23, 2010, at 2:44 PM, Ben Pfaff wrote:
> 
> > @@ -1137,7 +1139,7 @@ dp_netdev_output_control(struct dp_netdev *dp, const struct ofpbuf *packet,
> >     header->port = port_no;
> >     header->arg = arg;
> >     ofpbuf_put(msg, packet->data, packet->size);
> > -    queue_push_tail(q, msg);
> > +    list_push_back(&dp->queues[queue_no], &msg->list_node);
> 
> Did you want to increment "dp->queue_len[queue_no]"?

Yes, thanks.

It looks like I got this right elsewhere.

> > static struct ofpbuf *
> > +dequeue_packet(struct pinsched *ps, struct pinqueue *q, unsigned int port_no)
> > {
> > +    struct ofpbuf *packet = ofpbuf_from_list(list_pop_front(&q->packets));
> > +    list_remove(&packet->list_node);
> 
> Isn't this list_remove() unnecessary due to the list_pop_front()?

Yes.  Oops.

(This code needs unit tests, it tends to get broken whenever I touch
it.)

Thanks,

Ben.




More information about the dev mailing list