From 23624935e0c4b04730ed8d7d21f0cd25b2c2cda1 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Fri, 21 Jan 2011 16:26:09 -0800 Subject: net_sched: TCQ_F_CAN_BYPASS generalization Now qdisc stab is handled before TCQ_F_CAN_BYPASS test in __dev_xmit_skb(), we can generalize TCQ_F_CAN_BYPASS to other qdiscs than pfifo_fast : pfifo, bfifo, pfifo_head_drop and sfq SFQ is special because it can have external classifiers, and in these cases, we cannot bypass queue discipline (packet could be dropped by classifier) without admin asking it, or further changes. Its worth doing this, especially for SFQ, avoiding dirtying memory in case no packets are already waiting in queue. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- net/sched/sch_sfq.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'net/sched/sch_sfq.c') diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 156ad30980b5..fdba52aa053d 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -560,6 +560,10 @@ static int sfq_init(struct Qdisc *sch, struct nlattr *opt) slot_queue_init(&q->slots[i]); sfq_link(q, i); } + if (q->limit >= 1) + sch->flags |= TCQ_F_CAN_BYPASS; + else + sch->flags &= ~TCQ_F_CAN_BYPASS; return 0; } @@ -611,6 +615,8 @@ static unsigned long sfq_get(struct Qdisc *sch, u32 classid) static unsigned long sfq_bind(struct Qdisc *sch, unsigned long parent, u32 classid) { + /* we cannot bypass queue discipline anymore */ + sch->flags &= ~TCQ_F_CAN_BYPASS; return 0; } -- cgit v1.2.3