| To: | Thomas Graf <tgraf@xxxxxxx> |
|---|---|
| Subject: | [PATCH] - sch_htb: Drop packet when direct queue overflows |
| From: | Asim Shankar <asimshankar@xxxxxxxxx> |
| Date: | Thu, 21 Apr 2005 15:41:24 -0500 |
| Cc: | netdev@xxxxxxxxxxx |
| Domainkey-signature: | a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=fN7mEtDU1VXd2rEySHrpLL4a94yHBhyHXVrTEyyAGEYJw69VGl10bgNaG5VB6ykfl3N5uPTyoM8FqBEVSIy8yLrsoHIQyaTcDB1yjcMTChfjDWDK+jvAKQ9/oJOyjNgqYcckSe7pWZGG+KKyE1+LzzUtaz52a9+Byj+tGh10lj4= |
| In-reply-to: | <20050421195605.GJ577@xxxxxxxxxxxxxx> |
| References: | <7bca1cb50504211221655fd54c@xxxxxxxxxxxxxx> <20050421195605.GJ577@xxxxxxxxxxxxxx> |
| Reply-to: | Asim Shankar <asimshankar@xxxxxxxxx> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
> > If a packet is classified as HTB_DIRECT but the direct_queue is
> > already full, then the packet doesn't get enqueued but sch->q.qlen++
> > will happen a few lines later. Overflowing of the direct_queue
> > probably rarely happens in practice, but I was playing around and
> > noticed it happen in some corner cases of my testing.
>
> Yes, that's a bug.
>
> > Should the packet be dropped instead? Like:
> >
> > if (cl == HTB_DIRECT) {
> > /* enqueue to helper queue */
> > if (q->direct_queue.qlen < q->direct_qlen) {
> > __skb_queue_tail(&q->direct_queue, skb);
> > q->direct_pkts++;
> > } else {
> > sch->qstats.drops++;
> > kfree_skb(skb);
> > return NET_XMIT_DROP;
> > }
> > }
>
> Can you send a patch?
>
Patched pasted and attached:
--- linux-2.6.11.7/net/sched/sch_htb.c 2005-04-07 13:57:45.000000000 -0500
+++ linux-2.6.11.7-new/net/sched/sch_htb.c 2005-04-21 14:17:36.272065816
-0500
@@ -717,6 +717,10 @@
if (q->direct_queue.qlen < q->direct_qlen) {
__skb_queue_tail(&q->direct_queue, skb);
q->direct_pkts++;
+ } else {
+ kfree_skb (skb);
+ sch->qstats.drops++;
+ return NET_XMIT_DROP;
}
#ifdef CONFIG_NET_CLS_ACT
} else if (!cl) {
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: BUG: HTB?, Thomas Graf |
|---|---|
| Next by Date: | Re: Problem with IPSEC tunnel mode, Herbert Xu |
| Previous by Thread: | Re: BUG: HTB?, Thomas Graf |
| Next by Thread: | Re: [PATCH] - sch_htb: Drop packet when direct queue overflows, Thomas Graf |
| Indexes: | [Date] [Thread] [Top] [All Lists] |