All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: HTB?
@ 2005-04-21 19:21 Asim Shankar
  2005-04-21 19:56 ` Thomas Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Asim Shankar @ 2005-04-21 19:21 UTC (permalink / raw)
  To: netdev

Hi,

I think there is a bug in htb_enqueue() (net/sched/sch_htb.c)

Specifically, in the lines:
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++;
        }
}

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.

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;
       }
}


Thanks,

-- Asim

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-04-21 23:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-21 19:21 BUG: HTB? Asim Shankar
2005-04-21 19:56 ` Thomas Graf
2005-04-21 20:41   ` [PATCH] - sch_htb: Drop packet when direct queue overflows Asim Shankar
2005-04-21 21:54     ` Thomas Graf
2005-04-21 23:02       ` [PATCH 2.6.11.7] sch_htb: Drop packet when direct queue is full Asim Shankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.