aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_ingress.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-21 03:11:21 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:08:18 -0500
commita47812211bb38c6754a5a6a952ab406e711cc6e0 (patch)
tree6e52946408f7a7b07fedca605a9944fd4deaa9d3 /net/sched/sch_ingress.c
parent58f4df423ee3e7ee33022d84bbd69561b03344a9 (diff)
[NET_SCHED]: sch_ingress: remove excessive debugging
Remove excessive debugging statements and some "future use" stuff. Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Jamal Hadi Salim <hadi@cyberus.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_ingress.c')
-rw-r--r--net/sched/sch_ingress.c79
1 files changed, 3 insertions, 76 deletions
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 4880d44ee978..bdda28d9ebf6 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -19,20 +19,6 @@
19#include <net/pkt_sched.h> 19#include <net/pkt_sched.h>
20 20
21 21
22#undef DEBUG_INGRESS
23
24#ifdef DEBUG_INGRESS /* control */
25#define DPRINTK(format, args...) printk(KERN_DEBUG format,##args)
26#else
27#define DPRINTK(format, args...)
28#endif
29
30#if 0 /* data */
31#define D2PRINTK(format, args...) printk(KERN_DEBUG format,##args)
32#else
33#define D2PRINTK(format, args...)
34#endif
35
36#define PRIV(sch) qdisc_priv(sch) 22#define PRIV(sch) qdisc_priv(sch)
37 23
38/* Thanks to Doron Oz for this hack */ 24/* Thanks to Doron Oz for this hack */
@@ -52,13 +38,6 @@ struct ingress_qdisc_data {
52static int ingress_graft(struct Qdisc *sch, unsigned long arg, 38static int ingress_graft(struct Qdisc *sch, unsigned long arg,
53 struct Qdisc *new, struct Qdisc **old) 39 struct Qdisc *new, struct Qdisc **old)
54{ 40{
55#ifdef DEBUG_INGRESS
56 struct ingress_qdisc_data *p = PRIV(sch);
57#endif
58
59 DPRINTK("ingress_graft(sch %p,[qdisc %p],new %p,old %p)\n",
60 sch, p, new, old);
61 DPRINTK("\n ingress_graft: You cannot add qdiscs to classes");
62 return 1; 41 return 1;
63} 42}
64 43
@@ -69,11 +48,6 @@ static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg)
69 48
70static unsigned long ingress_get(struct Qdisc *sch, u32 classid) 49static unsigned long ingress_get(struct Qdisc *sch, u32 classid)
71{ 50{
72#ifdef DEBUG_INGRESS
73 struct ingress_qdisc_data *p = PRIV(sch);
74#endif
75 DPRINTK("ingress_get(sch %p,[qdisc %p],classid %x)\n",
76 sch, p, classid);
77 return TC_H_MIN(classid) + 1; 51 return TC_H_MIN(classid) + 1;
78} 52}
79 53
@@ -90,22 +64,12 @@ static void ingress_put(struct Qdisc *sch, unsigned long cl)
90static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent, 64static int ingress_change(struct Qdisc *sch, u32 classid, u32 parent,
91 struct rtattr **tca, unsigned long *arg) 65 struct rtattr **tca, unsigned long *arg)
92{ 66{
93#ifdef DEBUG_INGRESS
94 struct ingress_qdisc_data *p = PRIV(sch);
95#endif
96 DPRINTK("ingress_change(sch %p,[qdisc %p],classid %x,parent %x),"
97 "arg 0x%lx\n", sch, p, classid, parent, *arg);
98 DPRINTK("No effect. sch_ingress doesn't maintain classes at the moment");
99 return 0; 67 return 0;
100} 68}
101 69
102static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker) 70static void ingress_walk(struct Qdisc *sch, struct qdisc_walker *walker)
103{ 71{
104#ifdef DEBUG_INGRESS 72 return;
105 struct ingress_qdisc_data *p = PRIV(sch);
106#endif
107 DPRINTK("ingress_walk(sch %p,[qdisc %p],walker %p)\n", sch, p, walker);
108 DPRINTK("No effect. sch_ingress doesn't maintain classes at the moment");
109} 73}
110 74
111static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl) 75static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
@@ -123,9 +87,8 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
123 struct tcf_result res; 87 struct tcf_result res;
124 int result; 88 int result;
125 89
126 D2PRINTK("ingress_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p);
127 result = tc_classify(skb, p->filter_list, &res); 90 result = tc_classify(skb, p->filter_list, &res);
128 D2PRINTK("result %d class 0x%04x\n", result, res.classid); 91
129 /* 92 /*
130 * Unlike normal "enqueue" functions, ingress_enqueue returns a 93 * Unlike normal "enqueue" functions, ingress_enqueue returns a
131 * firewall FW_* code. 94 * firewall FW_* code.
@@ -150,7 +113,6 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
150 break; 113 break;
151 } 114 }
152#else 115#else
153 D2PRINTK("Overriding result to ACCEPT\n");
154 result = NF_ACCEPT; 116 result = NF_ACCEPT;
155 sch->bstats.packets++; 117 sch->bstats.packets++;
156 sch->bstats.bytes += skb->len; 118 sch->bstats.bytes += skb->len;
@@ -161,28 +123,16 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
161 123
162static struct sk_buff *ingress_dequeue(struct Qdisc *sch) 124static struct sk_buff *ingress_dequeue(struct Qdisc *sch)
163{ 125{
164/*
165 struct ingress_qdisc_data *p = PRIV(sch);
166 D2PRINTK("ingress_dequeue(sch %p,[qdisc %p])\n",sch,PRIV(p));
167*/
168 return NULL; 126 return NULL;
169} 127}
170 128
171static int ingress_requeue(struct sk_buff *skb, struct Qdisc *sch) 129static int ingress_requeue(struct sk_buff *skb, struct Qdisc *sch)
172{ 130{
173/*
174 struct ingress_qdisc_data *p = PRIV(sch);
175 D2PRINTK("ingress_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,PRIV(p));
176*/
177 return 0; 131 return 0;
178} 132}
179 133
180static unsigned int ingress_drop(struct Qdisc *sch) 134static unsigned int ingress_drop(struct Qdisc *sch)
181{ 135{
182#ifdef DEBUG_INGRESS
183 struct ingress_qdisc_data *p = PRIV(sch);
184#endif
185 DPRINTK("ingress_drop(sch %p,[qdisc %p])\n", sch, p);
186 return 0; 136 return 0;
187} 137}
188 138
@@ -198,11 +148,6 @@ static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
198 struct net_device *dev = skb->dev; 148 struct net_device *dev = skb->dev;
199 int fwres = NF_ACCEPT; 149 int fwres = NF_ACCEPT;
200 150
201 DPRINTK("ing_hook: skb %s dev=%s len=%u\n",
202 skb->sk ? "(owned)" : "(unowned)",
203 skb->dev ? skb->dev->name : "(no dev)",
204 skb->len);
205
206 if (dev->qdisc_ingress) { 151 if (dev->qdisc_ingress) {
207 spin_lock(&dev->ingress_lock); 152 spin_lock(&dev->ingress_lock);
208 if ((q = dev->qdisc_ingress) != NULL) 153 if ((q = dev->qdisc_ingress) != NULL)
@@ -259,26 +204,13 @@ static int ingress_init(struct Qdisc *sch, struct rtattr *opt)
259 } 204 }
260#endif 205#endif
261#endif 206#endif
262
263 DPRINTK("ingress_init(sch %p,[qdisc %p],opt %p)\n", sch, p, opt);
264 p->q = &noop_qdisc; 207 p->q = &noop_qdisc;
265 return 0; 208 return 0;
266} 209}
267 210
268static void ingress_reset(struct Qdisc *sch) 211static void ingress_reset(struct Qdisc *sch)
269{ 212{
270 struct ingress_qdisc_data *p = PRIV(sch); 213 return;
271
272 DPRINTK("ingress_reset(sch %p,[qdisc %p])\n", sch, p);
273
274/*
275#if 0
276*/
277/* for future use */
278 qdisc_reset(p->q);
279/*
280#endif
281*/
282} 214}
283 215
284/* ------------------------------------------------------------- */ 216/* ------------------------------------------------------------- */
@@ -287,12 +219,7 @@ static void ingress_destroy(struct Qdisc *sch)
287{ 219{
288 struct ingress_qdisc_data *p = PRIV(sch); 220 struct ingress_qdisc_data *p = PRIV(sch);
289 221
290 DPRINTK("ingress_destroy(sch %p,[qdisc %p])\n", sch, p);
291 tcf_destroy_chain(p->filter_list); 222 tcf_destroy_chain(p->filter_list);
292#if 0
293/* for future use */
294 qdisc_destroy(p->q);
295#endif
296} 223}
297 224
298static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb) 225static int ingress_dump(struct Qdisc *sch, struct sk_buff *skb)