aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_dsmark.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_dsmark.c')
-rw-r--r--net/sched/sch_dsmark.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 3886365cc207..49d6ef338b55 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -47,7 +47,7 @@ struct dsmark_qdisc_data {
47 47
48static inline int dsmark_valid_index(struct dsmark_qdisc_data *p, u16 index) 48static inline int dsmark_valid_index(struct dsmark_qdisc_data *p, u16 index)
49{ 49{
50 return (index <= p->indices && index > 0); 50 return index <= p->indices && index > 0;
51} 51}
52 52
53/* ------------------------- Class/flow operations ------------------------- */ 53/* ------------------------- Class/flow operations ------------------------- */
@@ -57,8 +57,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
57{ 57{
58 struct dsmark_qdisc_data *p = qdisc_priv(sch); 58 struct dsmark_qdisc_data *p = qdisc_priv(sch);
59 59
60 pr_debug("dsmark_graft(sch %p,[qdisc %p],new %p,old %p)\n", 60 pr_debug("%s(sch %p,[qdisc %p],new %p,old %p)\n",
61 sch, p, new, old); 61 __func__, sch, p, new, old);
62 62
63 if (new == NULL) { 63 if (new == NULL) {
64 new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, 64 new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
@@ -85,8 +85,8 @@ static struct Qdisc *dsmark_leaf(struct Qdisc *sch, unsigned long arg)
85 85
86static unsigned long dsmark_get(struct Qdisc *sch, u32 classid) 86static unsigned long dsmark_get(struct Qdisc *sch, u32 classid)
87{ 87{
88 pr_debug("dsmark_get(sch %p,[qdisc %p],classid %x)\n", 88 pr_debug("%s(sch %p,[qdisc %p],classid %x)\n",
89 sch, qdisc_priv(sch), classid); 89 __func__, sch, qdisc_priv(sch), classid);
90 90
91 return TC_H_MIN(classid) + 1; 91 return TC_H_MIN(classid) + 1;
92} 92}
@@ -118,8 +118,8 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent,
118 int err = -EINVAL; 118 int err = -EINVAL;
119 u8 mask = 0; 119 u8 mask = 0;
120 120
121 pr_debug("dsmark_change(sch %p,[qdisc %p],classid %x,parent %x)," 121 pr_debug("%s(sch %p,[qdisc %p],classid %x,parent %x), arg 0x%lx\n",
122 "arg 0x%lx\n", sch, p, classid, parent, *arg); 122 __func__, sch, p, classid, parent, *arg);
123 123
124 if (!dsmark_valid_index(p, *arg)) { 124 if (!dsmark_valid_index(p, *arg)) {
125 err = -ENOENT; 125 err = -ENOENT;
@@ -166,7 +166,8 @@ static void dsmark_walk(struct Qdisc *sch, struct qdisc_walker *walker)
166 struct dsmark_qdisc_data *p = qdisc_priv(sch); 166 struct dsmark_qdisc_data *p = qdisc_priv(sch);
167 int i; 167 int i;
168 168
169 pr_debug("dsmark_walk(sch %p,[qdisc %p],walker %p)\n", sch, p, walker); 169 pr_debug("%s(sch %p,[qdisc %p],walker %p)\n",
170 __func__, sch, p, walker);
170 171
171 if (walker->stop) 172 if (walker->stop)
172 return; 173 return;
@@ -199,7 +200,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
199 struct dsmark_qdisc_data *p = qdisc_priv(sch); 200 struct dsmark_qdisc_data *p = qdisc_priv(sch);
200 int err; 201 int err;
201 202
202 pr_debug("dsmark_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p); 203 pr_debug("%s(skb %p,sch %p,[qdisc %p])\n", __func__, skb, sch, p);
203 204
204 if (p->set_tc_index) { 205 if (p->set_tc_index) {
205 switch (skb->protocol) { 206 switch (skb->protocol) {
@@ -275,7 +276,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
275 struct sk_buff *skb; 276 struct sk_buff *skb;
276 u32 index; 277 u32 index;
277 278
278 pr_debug("dsmark_dequeue(sch %p,[qdisc %p])\n", sch, p); 279 pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
279 280
280 skb = p->q->ops->dequeue(p->q); 281 skb = p->q->ops->dequeue(p->q);
281 if (skb == NULL) 282 if (skb == NULL)
@@ -303,8 +304,8 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
303 * and don't need yet another qdisc as a bypass. 304 * and don't need yet another qdisc as a bypass.
304 */ 305 */
305 if (p->mask[index] != 0xff || p->value[index]) 306 if (p->mask[index] != 0xff || p->value[index])
306 pr_warning("dsmark_dequeue: unsupported protocol %d\n", 307 pr_warn("%s: unsupported protocol %d\n",
307 ntohs(skb->protocol)); 308 __func__, ntohs(skb->protocol));
308 break; 309 break;
309 } 310 }
310 311
@@ -315,7 +316,7 @@ static struct sk_buff *dsmark_peek(struct Qdisc *sch)
315{ 316{
316 struct dsmark_qdisc_data *p = qdisc_priv(sch); 317 struct dsmark_qdisc_data *p = qdisc_priv(sch);
317 318
318 pr_debug("dsmark_peek(sch %p,[qdisc %p])\n", sch, p); 319 pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
319 320
320 return p->q->ops->peek(p->q); 321 return p->q->ops->peek(p->q);
321} 322}
@@ -325,7 +326,7 @@ static unsigned int dsmark_drop(struct Qdisc *sch)
325 struct dsmark_qdisc_data *p = qdisc_priv(sch); 326 struct dsmark_qdisc_data *p = qdisc_priv(sch);
326 unsigned int len; 327 unsigned int len;
327 328
328 pr_debug("dsmark_reset(sch %p,[qdisc %p])\n", sch, p); 329 pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
329 330
330 if (p->q->ops->drop == NULL) 331 if (p->q->ops->drop == NULL)
331 return 0; 332 return 0;
@@ -346,7 +347,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
346 u16 indices; 347 u16 indices;
347 u8 *mask; 348 u8 *mask;
348 349
349 pr_debug("dsmark_init(sch %p,[qdisc %p],opt %p)\n", sch, p, opt); 350 pr_debug("%s(sch %p,[qdisc %p],opt %p)\n", __func__, sch, p, opt);
350 351
351 if (!opt) 352 if (!opt)
352 goto errout; 353 goto errout;
@@ -384,7 +385,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
384 if (p->q == NULL) 385 if (p->q == NULL)
385 p->q = &noop_qdisc; 386 p->q = &noop_qdisc;
386 387
387 pr_debug("dsmark_init: qdisc %p\n", p->q); 388 pr_debug("%s: qdisc %p\n", __func__, p->q);
388 389
389 err = 0; 390 err = 0;
390errout: 391errout:
@@ -395,7 +396,7 @@ static void dsmark_reset(struct Qdisc *sch)
395{ 396{
396 struct dsmark_qdisc_data *p = qdisc_priv(sch); 397 struct dsmark_qdisc_data *p = qdisc_priv(sch);
397 398
398 pr_debug("dsmark_reset(sch %p,[qdisc %p])\n", sch, p); 399 pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
399 qdisc_reset(p->q); 400 qdisc_reset(p->q);
400 sch->q.qlen = 0; 401 sch->q.qlen = 0;
401} 402}
@@ -404,7 +405,7 @@ static void dsmark_destroy(struct Qdisc *sch)
404{ 405{
405 struct dsmark_qdisc_data *p = qdisc_priv(sch); 406 struct dsmark_qdisc_data *p = qdisc_priv(sch);
406 407
407 pr_debug("dsmark_destroy(sch %p,[qdisc %p])\n", sch, p); 408 pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
408 409
409 tcf_destroy_chain(&p->filter_list); 410 tcf_destroy_chain(&p->filter_list);
410 qdisc_destroy(p->q); 411 qdisc_destroy(p->q);
@@ -417,7 +418,7 @@ static int dsmark_dump_class(struct Qdisc *sch, unsigned long cl,
417 struct dsmark_qdisc_data *p = qdisc_priv(sch); 418 struct dsmark_qdisc_data *p = qdisc_priv(sch);
418 struct nlattr *opts = NULL; 419 struct nlattr *opts = NULL;
419 420
420 pr_debug("dsmark_dump_class(sch %p,[qdisc %p],class %ld\n", sch, p, cl); 421 pr_debug("%s(sch %p,[qdisc %p],class %ld\n", __func__, sch, p, cl);
421 422
422 if (!dsmark_valid_index(p, cl)) 423 if (!dsmark_valid_index(p, cl))
423 return -EINVAL; 424 return -EINVAL;