public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bug in sch_generic.c:pfifo_fast_enqueue
@ 2002-04-01 19:43 Patrick McHardy
  2002-04-11  4:41 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2002-04-01 19:43 UTC (permalink / raw)
  To: Alexey Kuznetsov; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 220 bytes --]

Hi Alexey.
I found a small bug in pfifo_fast_enqueue, instead of

if (list->qlen <= skb->dev->tx_queue_len)

it should be

if (list->qlen <= qdisc->dev->tx_queue_len)

i guess. the attached patch fixes it.
Bye,
Patrick


[-- Attachment #2: Type: TEXT/PLAIN, Size: 533 bytes --]

diff -urN linux-2.4.18-clean/net/sched/sch_generic.c linux-2.4.18-sched_fixed/net/sched/sch_generic.c
--- linux-2.4.18-clean/net/sched/sch_generic.c	Fri Aug 18 19:26:25 2000
+++ linux-2.4.18-sched_fixed/net/sched/sch_generic.c	Sat Mar 30 11:45:56 2002
@@ -280,7 +280,7 @@
 	list = ((struct sk_buff_head*)qdisc->data) +
 		prio2band[skb->priority&TC_PRIO_MAX];
 
-	if (list->qlen <= skb->dev->tx_queue_len) {
+	if (list->qlen <= qdisc->dev->tx_queue_len) {
 		__skb_queue_tail(list, skb);
 		qdisc->q.qlen++;
 		return 0;

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

* Re: bug in sch_generic.c:pfifo_fast_enqueue
  2002-04-01 19:43 bug in sch_generic.c:pfifo_fast_enqueue Patrick McHardy
@ 2002-04-11  4:41 ` David S. Miller
  2002-04-11 13:56   ` Patrick McHardy
  0 siblings, 1 reply; 4+ messages in thread
From: David S. Miller @ 2002-04-11  4:41 UTC (permalink / raw)
  To: kaber; +Cc: kuznet2, linux-kernel

   From: Patrick McHardy <kaber@trash.net>
   Date: Mon, 1 Apr 2002 21:43:03 +0200 (CEST)

   I found a small bug in pfifo_fast_enqueue, instead of
   
   if (list->qlen <= skb->dev->tx_queue_len)
   
   it should be
   
   if (list->qlen <= qdisc->dev->tx_queue_len)
   
   i guess.

skb->dev == qdisc->dev should be invariant when this
code runs.  So the code is correct, albeit possibly
confusing.

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

* Re: bug in sch_generic.c:pfifo_fast_enqueue
  2002-04-11  4:41 ` David S. Miller
@ 2002-04-11 13:56   ` Patrick McHardy
  2002-04-24 17:51     ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2002-04-11 13:56 UTC (permalink / raw)
  To: David S. Miller; +Cc: kuznet2, linux-kernel

"David S. Miller" schrieb:
> 
>    From: Patrick McHardy <kaber@trash.net>
>    Date: Mon, 1 Apr 2002 21:43:03 +0200 (CEST)
> 
>    I found a small bug in pfifo_fast_enqueue, instead of
> 
>    if (list->qlen <= skb->dev->tx_queue_len)
> 
>    it should be
> 
>    if (list->qlen <= qdisc->dev->tx_queue_len)
> 
>    i guess.
> 
> skb->dev == qdisc->dev should be invariant when this
> code runs.  So the code is correct, albeit possibly
> confusing.


I (we) are (ab?)using the code to enqueue/dequeue arbitary
packets to a qdisc attached to a software device (imq)
for doing traffic control over multiple interfaces / ingress
traffic control with egress qdiscs, in that case 
skb->dev != qdisc->dev.
Although in normal circumstances the assumption may be right
it fails in this case. It would be nice if you apply my patch
as it doesn't changes anything and enforces correct behaviour
in cases like mine.

Bye,
Patrick

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

* Re: bug in sch_generic.c:pfifo_fast_enqueue
  2002-04-11 13:56   ` Patrick McHardy
@ 2002-04-24 17:51     ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2002-04-24 17:51 UTC (permalink / raw)
  To: kaber; +Cc: kuznet2, linux-kernel

   From: Patrick McHardy <kaber@trash.net>
   Date: Thu, 11 Apr 2002 15:56:35 +0200

   "David S. Miller" schrieb:
   >    From: Patrick McHardy <kaber@trash.net>
   >    Date: Mon, 1 Apr 2002 21:43:03 +0200 (CEST)
   > 
   >    I found a small bug in pfifo_fast_enqueue, instead of
   > 
   >    if (list->qlen <= skb->dev->tx_queue_len)
   >    it should be
   >    if (list->qlen <= qdisc->dev->tx_queue_len)
   > 
   > skb->dev == qdisc->dev should be invariant when this
   > code runs.  So the code is correct, albeit possibly
   > confusing.

   Although in normal circumstances the assumption may be right
   it fails in this case. It would be nice if you apply my patch
   as it doesn't changes anything and enforces correct behaviour
   in cases like mine.

Ok, for the sake of consistency, I've made the change.

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

end of thread, other threads:[~2002-04-24 18:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-01 19:43 bug in sch_generic.c:pfifo_fast_enqueue Patrick McHardy
2002-04-11  4:41 ` David S. Miller
2002-04-11 13:56   ` Patrick McHardy
2002-04-24 17:51     ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox