diff options
| author | Patrick McHardy <kaber@trash.net> | 2004-02-17 21:18:53 -0800 |
|---|---|---|
| committer | Patrick McHardy <kaber@trash.net> | 2004-02-17 21:18:53 -0800 |
| commit | f7c908debde3db79bea2e92305745b3dcf16c971 (patch) | |
| tree | da4e0fdeb3b537bfaab7b871150ef6cde6446aba | |
| parent | fff336d5c63d1acbaa3096a80cf85aa9a2d8f3e7 (diff) | |
[PKTSCHED]: Use queue limit of 1 when tx_queue_len is zero.
| -rw-r--r-- | net/sched/sch_fifo.c | 6 | ||||
| -rw-r--r-- | net/sched/sch_gred.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index c53b06b9eb31..132a5bc94294 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c @@ -141,10 +141,12 @@ static int fifo_init(struct Qdisc *sch, struct rtattr *opt) 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 --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 6f5e6c7031fc..080ca2e54438 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -110,7 +110,7 @@ gred_enqueue(struct sk_buff *skb, struct Qdisc* sch) 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; } |
