[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpUfJxMxQXia8JOH5xouSFMThrdZWZMUuQ0q=bSmp8oEEQ@mail.gmail.com>
Date: Sun, 8 May 2016 21:14:13 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: David Miller <davem@...emloft.net>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Dave Täht <dave.taht@...il.com>,
netdev <netdev@...r.kernel.org>, moeller0 <moeller0@....de>
Subject: Re: [PATCH net-next] fq_codel: add memory limitation per queue
On Fri, May 6, 2016 at 8:55 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> @@ -193,6 +199,7 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> unsigned int idx, prev_backlog, prev_qlen;
> struct fq_codel_flow *flow;
> int uninitialized_var(ret);
> + bool memory_limited;
>
> idx = fq_codel_classify(skb, sch, &ret);
> if (idx == 0) {
> @@ -215,7 +222,9 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> flow->deficit = q->quantum;
> flow->dropped = 0;
> }
> - if (++sch->q.qlen <= sch->limit)
> + q->memory_usage += skb->truesize;
> + memory_limited = q->memory_usage > q->memory_limit;
> + if (++sch->q.qlen <= sch->limit && !memory_limited)
> return NET_XMIT_SUCCESS;
>
> prev_backlog = sch->qstats.backlog;
> @@ -229,7 +238,8 @@ static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> ret = fq_codel_drop(sch, q->drop_batch_size);
>
> q->drop_overlimit += prev_qlen - sch->q.qlen;
> -
> + if (memory_limited)
> + q->drop_overmemory += prev_qlen - sch->q.qlen;
So when the packet is dropped due to memory over limit, should
we return failure for this case? Or I miss anything?
Powered by blists - more mailing lists