X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ofproto%2Fpinsched.c;h=c7118a6cfe823834c4eb00077bd82b34ac1de8a3;hb=a14b8947fd13d4c587addbffd24eedc7bb48ee2b;hp=1300e004fec6e6aee3050b6cc43c764453713b43;hpb=ca6ba70092b1528e12d3140d70232175a13c335d;p=cascardo%2Fovs.git diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c index 1300e004f..c7118a6cf 100644 --- a/ofproto/pinsched.c +++ b/ofproto/pinsched.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ #include "sat-math.h" #include "timeval.h" #include "openvswitch/token-bucket.h" -#include "vconn.h" +#include "openvswitch/vconn.h" struct pinqueue { struct hmap_node node; /* In struct pinsched's 'queues' hmap. */ @@ -195,18 +195,11 @@ pinsched_send(struct pinsched *ps, ofp_port_t port_no, list_push_back(txq, &packet->list_node); } else { /* Otherwise queue it up for the periodic callback to drain out. */ - struct pinqueue *q; - - /* We might be called with a buffer obtained from dpif_recv() that has - * much more allocated space than actual content most of the time. - * Since we're going to store the packet for some time, free up that - * otherwise wasted space. */ - ofpbuf_trim(packet); - if (ps->n_queued * 1000 >= ps->token_bucket.burst) { drop_packet(ps); } - q = pinqueue_get(ps, port_no); + + struct pinqueue *q = pinqueue_get(ps, port_no); list_push_back(&q->packets, &packet->list_node); q->n++; ps->n_queued++;