ChangeSet 1.1561.2.5, 2004/02/18 13:18:53-08:00, kaber@trash.net [PKTSCHED]: Use queue limit of 1 when tx_queue_len is zero. # This patch includes the following deltas: # ChangeSet 1.1561.2.4 -> 1.1561.2.5 # net/sched/sch_fifo.c 1.7 -> 1.8 # net/sched/sch_gred.c 1.13 -> 1.14 # sch_fifo.c | 6 ++++-- sch_gred.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff -Nru a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c --- a/net/sched/sch_fifo.c Wed Feb 18 18:09:39 2004 +++ b/net/sched/sch_fifo.c Wed Feb 18 18:09:39 2004 @@ -141,10 +141,12 @@ struct fifo_sched_data *q = (void*)sch->data; if (opt == NULL) { + unsigned int limit = sch->dev->tx_queue_len ? : 1; + if (sch->ops == &bfifo_qdisc_ops) - q->limit = sch->dev->tx_queue_len*sch->dev->mtu; + q->limit = limit*sch->dev->mtu; else - q->limit = sch->dev->tx_queue_len; + q->limit = limit; } else { struct tc_fifo_qopt *ctl = RTA_DATA(opt); if (opt->rta_len < RTA_LENGTH(sizeof(*ctl))) diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c --- a/net/sched/sch_gred.c Wed Feb 18 18:09:39 2004 +++ b/net/sched/sch_gred.c Wed Feb 18 18:09:39 2004 @@ -110,7 +110,7 @@ unsigned long qave=0; int i=0; - if (!t->initd && skb_queue_len(&sch->q) < sch->dev->tx_queue_len) { + if (!t->initd && skb_queue_len(&sch->q) < (sch->dev->tx_queue_len ? : 1)) { D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n"); goto do_enqueue; }