David S. Miller wrote:
I don't know how wise this tx_queue_len fiddling is.
With this, if user modifies tx_queue_len himself, on ifdown this configuration
change is lost if user sets it explicitly to '1'. See? In fact you could
call it corruption :-)
I think Alexey maybe meant something different, achieving the ends by some other
means than directly fiddling with tx_queue_len.
I guess he meant something like this, but I still think it encourages
broken configurations in combination with non-work-conserving
schedulers.
Regards,
Patrick
===== sch_fifo.c 1.7 vs edited =====
--- 1.7/net/sched/sch_fifo.c Wed Nov 19 02:37:34 2003
+++ edited/sch_fifo.c Sun Feb 15 11:06:08 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)))
===== sch_gred.c 1.13 vs edited =====
--- 1.13/net/sched/sch_gred.c Wed Nov 19 02:37:34 2003
+++ edited/sch_gred.c Sun Feb 15 11:09:42 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;
}
|