diff options
-rw-r--r-- | include/linux/pkt_sched.h | 2 | ||||
-rw-r--r-- | net/sched/sch_gred.c | 8 | ||||
-rw-r--r-- | net/sched/sch_red.c | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index 0ebe320223e2..e87b233615b3 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -93,6 +93,7 @@ struct tc_fifo_qopt | |||
93 | /* PRIO section */ | 93 | /* PRIO section */ |
94 | 94 | ||
95 | #define TCQ_PRIO_BANDS 16 | 95 | #define TCQ_PRIO_BANDS 16 |
96 | #define TCQ_MIN_PRIO_BANDS 2 | ||
96 | 97 | ||
97 | struct tc_prio_qopt | 98 | struct tc_prio_qopt |
98 | { | 99 | { |
@@ -169,6 +170,7 @@ struct tc_red_qopt | |||
169 | unsigned char Scell_log; /* cell size for idle damping */ | 170 | unsigned char Scell_log; /* cell size for idle damping */ |
170 | unsigned char flags; | 171 | unsigned char flags; |
171 | #define TC_RED_ECN 1 | 172 | #define TC_RED_ECN 1 |
173 | #define TC_RED_HARDDROP 2 | ||
172 | }; | 174 | }; |
173 | 175 | ||
174 | struct tc_red_xstats | 176 | struct tc_red_xstats |
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 079b0a4ea1c2..29a2dd9f3029 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c | |||
@@ -146,6 +146,11 @@ static inline int gred_use_ecn(struct gred_sched *t) | |||
146 | return t->red_flags & TC_RED_ECN; | 146 | return t->red_flags & TC_RED_ECN; |
147 | } | 147 | } |
148 | 148 | ||
149 | static inline int gred_use_harddrop(struct gred_sched *t) | ||
150 | { | ||
151 | return t->red_flags & TC_RED_HARDDROP; | ||
152 | } | ||
153 | |||
149 | static int gred_enqueue(struct sk_buff *skb, struct Qdisc* sch) | 154 | static int gred_enqueue(struct sk_buff *skb, struct Qdisc* sch) |
150 | { | 155 | { |
151 | struct gred_sched_data *q=NULL; | 156 | struct gred_sched_data *q=NULL; |
@@ -214,7 +219,8 @@ static int gred_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
214 | 219 | ||
215 | case RED_HARD_MARK: | 220 | case RED_HARD_MARK: |
216 | sch->qstats.overlimits++; | 221 | sch->qstats.overlimits++; |
217 | if (!gred_use_ecn(t) || !INET_ECN_set_ce(skb)) { | 222 | if (gred_use_harddrop(t) || !gred_use_ecn(t) || |
223 | !INET_ECN_set_ce(skb)) { | ||
218 | q->stats.forced_drop++; | 224 | q->stats.forced_drop++; |
219 | goto congestion_drop; | 225 | goto congestion_drop; |
220 | } | 226 | } |
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c index 0d89dee751a9..dccfa44c2d71 100644 --- a/net/sched/sch_red.c +++ b/net/sched/sch_red.c | |||
@@ -51,6 +51,11 @@ static inline int red_use_ecn(struct red_sched_data *q) | |||
51 | return q->flags & TC_RED_ECN; | 51 | return q->flags & TC_RED_ECN; |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline int red_use_harddrop(struct red_sched_data *q) | ||
55 | { | ||
56 | return q->flags & TC_RED_HARDDROP; | ||
57 | } | ||
58 | |||
54 | static int red_enqueue(struct sk_buff *skb, struct Qdisc* sch) | 59 | static int red_enqueue(struct sk_buff *skb, struct Qdisc* sch) |
55 | { | 60 | { |
56 | struct red_sched_data *q = qdisc_priv(sch); | 61 | struct red_sched_data *q = qdisc_priv(sch); |
@@ -76,7 +81,8 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
76 | 81 | ||
77 | case RED_HARD_MARK: | 82 | case RED_HARD_MARK: |
78 | sch->qstats.overlimits++; | 83 | sch->qstats.overlimits++; |
79 | if (!red_use_ecn(q) || !INET_ECN_set_ce(skb)) { | 84 | if (red_use_harddrop(q) || !red_use_ecn(q) || |
85 | !INET_ECN_set_ce(skb)) { | ||
80 | q->stats.forced_drop++; | 86 | q->stats.forced_drop++; |
81 | goto congestion_drop; | 87 | goto congestion_drop; |
82 | } | 88 | } |