netdev
[Top] [All Lists]

[PATCH 2.6.11.7] sch_htb: Drop packet when direct queue is full

To: netdev@xxxxxxxxxxx
Subject: [PATCH 2.6.11.7] sch_htb: Drop packet when direct queue is full
From: Asim Shankar <asimshankar@xxxxxxxxx>
Date: Thu, 21 Apr 2005 18:02:55 -0500
Cc: devik@xxxxxx, Thomas Graf <tgraf@xxxxxxx>
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:content-transfer-encoding:content-disposition:references; b=EtlYhY3+LCih2JjkCg4GJ25wModGlo37Ojh/r04+22vohkRgtf2hzH2WLC4usmFg5+ZO09RZ+mgDrlewgxoyRmSEi7ZtgxD8Oy6RuPx2lGcQcDJvEzOb83XVtd4JIMRf+AJeZpwMuvs9XJ88XmBwC6Mv3jJWIpdGaBTULWeLkiI=
In-reply-to: <20050421215440.GL577@xxxxxxxxxxxxxx>
References: <7bca1cb50504211221655fd54c@xxxxxxxxxxxxxx> <20050421195605.GJ577@xxxxxxxxxxxxxx> <7bca1cb505042113417a5d9f59@xxxxxxxxxxxxxx> <20050421215440.GL577@xxxxxxxxxxxxxx>
Reply-to: Asim Shankar <asimshankar@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
htb_enqueue(): Free skb and return NET_XMIT_DROP if a packet is
destined for the direct_queue but the direct_queue is full. (Before
this: erroneously returned NET_XMIT_SUCCESS even though the packet was
not enqueued)

Signed-off-by: Asim Shankar <asimshankar@xxxxxxxxx>

--- linux-2.6.11.7/net/sched/sch_htb.c.orig 2005-04-21 17:40:05.305709014 -0500
+++ linux-2.6.11.7/net/sched/sch_htb.c 2005-04-21 17:35:27.872624173 -0500
@@ -717,6 +717,10 @@ static int htb_enqueue(struct sk_buff *s
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>