diff options
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r-- | net/sched/sch_prio.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index 966158d49dd1..3bea31e101b5 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -22,8 +22,7 @@ | |||
22 | #include <net/pkt_sched.h> | 22 | #include <net/pkt_sched.h> |
23 | 23 | ||
24 | 24 | ||
25 | struct prio_sched_data | 25 | struct prio_sched_data { |
26 | { | ||
27 | int bands; | 26 | int bands; |
28 | struct tcf_proto *filter_list; | 27 | struct tcf_proto *filter_list; |
29 | u8 prio2band[TC_PRIO_MAX+1]; | 28 | u8 prio2band[TC_PRIO_MAX+1]; |
@@ -54,7 +53,7 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) | |||
54 | if (!q->filter_list || err < 0) { | 53 | if (!q->filter_list || err < 0) { |
55 | if (TC_H_MAJ(band)) | 54 | if (TC_H_MAJ(band)) |
56 | band = 0; | 55 | band = 0; |
57 | return q->queues[q->prio2band[band&TC_PRIO_MAX]]; | 56 | return q->queues[q->prio2band[band & TC_PRIO_MAX]]; |
58 | } | 57 | } |
59 | band = res.classid; | 58 | band = res.classid; |
60 | } | 59 | } |
@@ -107,7 +106,7 @@ static struct sk_buff *prio_peek(struct Qdisc *sch) | |||
107 | return NULL; | 106 | return NULL; |
108 | } | 107 | } |
109 | 108 | ||
110 | static struct sk_buff *prio_dequeue(struct Qdisc* sch) | 109 | static struct sk_buff *prio_dequeue(struct Qdisc *sch) |
111 | { | 110 | { |
112 | struct prio_sched_data *q = qdisc_priv(sch); | 111 | struct prio_sched_data *q = qdisc_priv(sch); |
113 | int prio; | 112 | int prio; |
@@ -124,7 +123,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc* sch) | |||
124 | 123 | ||
125 | } | 124 | } |
126 | 125 | ||
127 | static unsigned int prio_drop(struct Qdisc* sch) | 126 | static unsigned int prio_drop(struct Qdisc *sch) |
128 | { | 127 | { |
129 | struct prio_sched_data *q = qdisc_priv(sch); | 128 | struct prio_sched_data *q = qdisc_priv(sch); |
130 | int prio; | 129 | int prio; |
@@ -143,24 +142,24 @@ static unsigned int prio_drop(struct Qdisc* sch) | |||
143 | 142 | ||
144 | 143 | ||
145 | static void | 144 | static void |
146 | prio_reset(struct Qdisc* sch) | 145 | prio_reset(struct Qdisc *sch) |
147 | { | 146 | { |
148 | int prio; | 147 | int prio; |
149 | struct prio_sched_data *q = qdisc_priv(sch); | 148 | struct prio_sched_data *q = qdisc_priv(sch); |
150 | 149 | ||
151 | for (prio=0; prio<q->bands; prio++) | 150 | for (prio = 0; prio < q->bands; prio++) |
152 | qdisc_reset(q->queues[prio]); | 151 | qdisc_reset(q->queues[prio]); |
153 | sch->q.qlen = 0; | 152 | sch->q.qlen = 0; |
154 | } | 153 | } |
155 | 154 | ||
156 | static void | 155 | static void |
157 | prio_destroy(struct Qdisc* sch) | 156 | prio_destroy(struct Qdisc *sch) |
158 | { | 157 | { |
159 | int prio; | 158 | int prio; |
160 | struct prio_sched_data *q = qdisc_priv(sch); | 159 | struct prio_sched_data *q = qdisc_priv(sch); |
161 | 160 | ||
162 | tcf_destroy_chain(&q->filter_list); | 161 | tcf_destroy_chain(&q->filter_list); |
163 | for (prio=0; prio<q->bands; prio++) | 162 | for (prio = 0; prio < q->bands; prio++) |
164 | qdisc_destroy(q->queues[prio]); | 163 | qdisc_destroy(q->queues[prio]); |
165 | } | 164 | } |
166 | 165 | ||
@@ -177,7 +176,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt) | |||
177 | if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < 2) | 176 | if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < 2) |
178 | return -EINVAL; | 177 | return -EINVAL; |
179 | 178 | ||
180 | for (i=0; i<=TC_PRIO_MAX; i++) { | 179 | for (i = 0; i <= TC_PRIO_MAX; i++) { |
181 | if (qopt->priomap[i] >= qopt->bands) | 180 | if (qopt->priomap[i] >= qopt->bands) |
182 | return -EINVAL; | 181 | return -EINVAL; |
183 | } | 182 | } |
@@ -186,7 +185,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt) | |||
186 | q->bands = qopt->bands; | 185 | q->bands = qopt->bands; |
187 | memcpy(q->prio2band, qopt->priomap, TC_PRIO_MAX+1); | 186 | memcpy(q->prio2band, qopt->priomap, TC_PRIO_MAX+1); |
188 | 187 | ||
189 | for (i=q->bands; i<TCQ_PRIO_BANDS; i++) { | 188 | for (i = q->bands; i < TCQ_PRIO_BANDS; i++) { |
190 | struct Qdisc *child = q->queues[i]; | 189 | struct Qdisc *child = q->queues[i]; |
191 | q->queues[i] = &noop_qdisc; | 190 | q->queues[i] = &noop_qdisc; |
192 | if (child != &noop_qdisc) { | 191 | if (child != &noop_qdisc) { |
@@ -196,9 +195,10 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt) | |||
196 | } | 195 | } |
197 | sch_tree_unlock(sch); | 196 | sch_tree_unlock(sch); |
198 | 197 | ||
199 | for (i=0; i<q->bands; i++) { | 198 | for (i = 0; i < q->bands; i++) { |
200 | if (q->queues[i] == &noop_qdisc) { | 199 | if (q->queues[i] == &noop_qdisc) { |
201 | struct Qdisc *child, *old; | 200 | struct Qdisc *child, *old; |
201 | |||
202 | child = qdisc_create_dflt(sch->dev_queue, | 202 | child = qdisc_create_dflt(sch->dev_queue, |
203 | &pfifo_qdisc_ops, | 203 | &pfifo_qdisc_ops, |
204 | TC_H_MAKE(sch->handle, i + 1)); | 204 | TC_H_MAKE(sch->handle, i + 1)); |
@@ -224,7 +224,7 @@ static int prio_init(struct Qdisc *sch, struct nlattr *opt) | |||
224 | struct prio_sched_data *q = qdisc_priv(sch); | 224 | struct prio_sched_data *q = qdisc_priv(sch); |
225 | int i; | 225 | int i; |
226 | 226 | ||
227 | for (i=0; i<TCQ_PRIO_BANDS; i++) | 227 | for (i = 0; i < TCQ_PRIO_BANDS; i++) |
228 | q->queues[i] = &noop_qdisc; | 228 | q->queues[i] = &noop_qdisc; |
229 | 229 | ||
230 | if (opt == NULL) { | 230 | if (opt == NULL) { |
@@ -232,7 +232,7 @@ static int prio_init(struct Qdisc *sch, struct nlattr *opt) | |||
232 | } else { | 232 | } else { |
233 | int err; | 233 | int err; |
234 | 234 | ||
235 | if ((err= prio_tune(sch, opt)) != 0) | 235 | if ((err = prio_tune(sch, opt)) != 0) |
236 | return err; | 236 | return err; |
237 | } | 237 | } |
238 | return 0; | 238 | return 0; |
@@ -245,7 +245,7 @@ static int prio_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
245 | struct tc_prio_qopt opt; | 245 | struct tc_prio_qopt opt; |
246 | 246 | ||
247 | opt.bands = q->bands; | 247 | opt.bands = q->bands; |
248 | memcpy(&opt.priomap, q->prio2band, TC_PRIO_MAX+1); | 248 | memcpy(&opt.priomap, q->prio2band, TC_PRIO_MAX + 1); |
249 | 249 | ||
250 | NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt); | 250 | NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt); |
251 | 251 | ||
@@ -342,7 +342,7 @@ static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg) | |||
342 | arg->count++; | 342 | arg->count++; |
343 | continue; | 343 | continue; |
344 | } | 344 | } |
345 | if (arg->fn(sch, prio+1, arg) < 0) { | 345 | if (arg->fn(sch, prio + 1, arg) < 0) { |
346 | arg->stop = 1; | 346 | arg->stop = 1; |
347 | break; | 347 | break; |
348 | } | 348 | } |
@@ -350,7 +350,7 @@ static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg) | |||
350 | } | 350 | } |
351 | } | 351 | } |
352 | 352 | ||
353 | static struct tcf_proto ** prio_find_tcf(struct Qdisc *sch, unsigned long cl) | 353 | static struct tcf_proto **prio_find_tcf(struct Qdisc *sch, unsigned long cl) |
354 | { | 354 | { |
355 | struct prio_sched_data *q = qdisc_priv(sch); | 355 | struct prio_sched_data *q = qdisc_priv(sch); |
356 | 356 | ||