diff options
Diffstat (limited to 'net/sched/sch_fifo.c')
-rw-r--r-- | net/sched/sch_fifo.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/sched/sch_fifo.c b/net/sched/sch_fifo.c index b3075f8a196b..f7290d2542c2 100644 --- a/net/sched/sch_fifo.c +++ b/net/sched/sch_fifo.c | |||
@@ -64,11 +64,13 @@ static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
64 | static int fifo_init(struct Qdisc *sch, struct nlattr *opt) | 64 | static int fifo_init(struct Qdisc *sch, struct nlattr *opt) |
65 | { | 65 | { |
66 | struct fifo_sched_data *q = qdisc_priv(sch); | 66 | struct fifo_sched_data *q = qdisc_priv(sch); |
67 | bool bypass; | ||
68 | bool is_bfifo = sch->ops == &bfifo_qdisc_ops; | ||
67 | 69 | ||
68 | if (opt == NULL) { | 70 | if (opt == NULL) { |
69 | u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1; | 71 | u32 limit = qdisc_dev(sch)->tx_queue_len ? : 1; |
70 | 72 | ||
71 | if (sch->ops == &bfifo_qdisc_ops) | 73 | if (is_bfifo) |
72 | limit *= psched_mtu(qdisc_dev(sch)); | 74 | limit *= psched_mtu(qdisc_dev(sch)); |
73 | 75 | ||
74 | q->limit = limit; | 76 | q->limit = limit; |
@@ -81,6 +83,15 @@ static int fifo_init(struct Qdisc *sch, struct nlattr *opt) | |||
81 | q->limit = ctl->limit; | 83 | q->limit = ctl->limit; |
82 | } | 84 | } |
83 | 85 | ||
86 | if (is_bfifo) | ||
87 | bypass = q->limit >= psched_mtu(qdisc_dev(sch)); | ||
88 | else | ||
89 | bypass = q->limit >= 1; | ||
90 | |||
91 | if (bypass) | ||
92 | sch->flags |= TCQ_F_CAN_BYPASS; | ||
93 | else | ||
94 | sch->flags &= ~TCQ_F_CAN_BYPASS; | ||
84 | return 0; | 95 | return 0; |
85 | } | 96 | } |
86 | 97 | ||