aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-13 17:56:26 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-15 13:45:03 -0400
commite87cc4728f0e2fb663e592a1141742b1d6c63256 (patch)
treeb8219696d37f0c8d0521d5853560b97fc96dc667 /net/sched
parent3a3bfb61e64476ff1e4ac3122cb6dec9c79b795c (diff)
net: Convert net_ratelimit uses to net_<level>_ratelimited
Standardize the net core ratelimited logging functions. Coalesce formats, align arguments. Change a printk then vprintk sequence to use printf extension %pV. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/act_ipt.c7
-rw-r--r--net/sched/act_mirred.c5
-rw-r--r--net/sched/cls_u32.c3
-rw-r--r--net/sched/ematch.c4
-rw-r--r--net/sched/sch_api.c10
-rw-r--r--net/sched/sch_generic.c11
-rw-r--r--net/sched/sch_gred.c12
7 files changed, 20 insertions, 32 deletions
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 0beba0e5312e..60e281ad0f07 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * net/sched/ipt.c iptables target interface 2 * net/sched/ipt.c iptables target interface
3 * 3 *
4 *TODO: Add other tables. For now we only support the ipv4 table targets 4 *TODO: Add other tables. For now we only support the ipv4 table targets
5 * 5 *
@@ -235,9 +235,8 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
235 result = TC_ACT_PIPE; 235 result = TC_ACT_PIPE;
236 break; 236 break;
237 default: 237 default:
238 if (net_ratelimit()) 238 net_notice_ratelimited("tc filter: Bogus netfilter code %d assume ACCEPT\n",
239 pr_notice("tc filter: Bogus netfilter code" 239 ret);
240 " %d assume ACCEPT\n", ret);
241 result = TC_POLICE_OK; 240 result = TC_POLICE_OK;
242 break; 241 break;
243 } 242 }
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index d583aea3b3df..fe81cc18e9e0 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -174,9 +174,8 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
174 } 174 }
175 175
176 if (!(dev->flags & IFF_UP)) { 176 if (!(dev->flags & IFF_UP)) {
177 if (net_ratelimit()) 177 net_notice_ratelimited("tc mirred to Houston: device %s is down\n",
178 pr_notice("tc mirred to Houston: device %s is down\n", 178 dev->name);
179 dev->name);
180 goto out; 179 goto out;
181 } 180 }
182 181
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 591b006a8c5a..d45373fb00b9 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -234,8 +234,7 @@ out:
234 return -1; 234 return -1;
235 235
236deadloop: 236deadloop:
237 if (net_ratelimit()) 237 net_warn_ratelimited("cls_u32: dead loop\n");
238 pr_warning("cls_u32: dead loop\n");
239 return -1; 238 return -1;
240} 239}
241 240
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index aca233c2b848..3a633debb6df 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -537,9 +537,7 @@ pop_stack:
537 return res; 537 return res;
538 538
539stack_overflow: 539stack_overflow:
540 if (net_ratelimit()) 540 net_warn_ratelimited("tc ematch: local stack overflow, increase NET_EMATCH_STACK\n");
541 pr_warning("tc ematch: local stack overflow,"
542 " increase NET_EMATCH_STACK\n");
543 return -1; 541 return -1;
544} 542}
545EXPORT_SYMBOL(__tcf_em_tree_match); 543EXPORT_SYMBOL(__tcf_em_tree_match);
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index d2daefcc205f..085ce53d570a 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1691,12 +1691,10 @@ reclassify:
1691 tp = otp; 1691 tp = otp;
1692 1692
1693 if (verd++ >= MAX_REC_LOOP) { 1693 if (verd++ >= MAX_REC_LOOP) {
1694 if (net_ratelimit()) 1694 net_notice_ratelimited("%s: packet reclassify loop rule prio %u protocol %02x\n",
1695 pr_notice("%s: packet reclassify loop" 1695 tp->q->ops->id,
1696 " rule prio %u protocol %02x\n", 1696 tp->prio & 0xffff,
1697 tp->q->ops->id, 1697 ntohs(tp->protocol));
1698 tp->prio & 0xffff,
1699 ntohs(tp->protocol));
1700 return TC_ACT_SHOT; 1698 return TC_ACT_SHOT;
1701 } 1699 }
1702 skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd); 1700 skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 0eb1202c22a6..511323e89cec 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -86,9 +86,8 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
86 * deadloop is detected. Return OK to try the next skb. 86 * deadloop is detected. Return OK to try the next skb.
87 */ 87 */
88 kfree_skb(skb); 88 kfree_skb(skb);
89 if (net_ratelimit()) 89 net_warn_ratelimited("Dead loop on netdevice %s, fix it urgently!\n",
90 pr_warning("Dead loop on netdevice %s, fix it urgently!\n", 90 dev_queue->dev->name);
91 dev_queue->dev->name);
92 ret = qdisc_qlen(q); 91 ret = qdisc_qlen(q);
93 } else { 92 } else {
94 /* 93 /*
@@ -136,9 +135,9 @@ int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
136 ret = handle_dev_cpu_collision(skb, txq, q); 135 ret = handle_dev_cpu_collision(skb, txq, q);
137 } else { 136 } else {
138 /* Driver returned NETDEV_TX_BUSY - requeue skb */ 137 /* Driver returned NETDEV_TX_BUSY - requeue skb */
139 if (unlikely (ret != NETDEV_TX_BUSY && net_ratelimit())) 138 if (unlikely(ret != NETDEV_TX_BUSY))
140 pr_warning("BUG %s code %d qlen %d\n", 139 net_warn_ratelimited("BUG %s code %d qlen %d\n",
141 dev->name, ret, q->q.qlen); 140 dev->name, ret, q->q.qlen);
142 141
143 ret = dev_requeue_skb(skb, q); 142 ret = dev_requeue_skb(skb, q);
144 } 143 }
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index ab620bf90785..e901583e4ea5 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -255,10 +255,8 @@ static struct sk_buff *gred_dequeue(struct Qdisc *sch)
255 u16 dp = tc_index_to_dp(skb); 255 u16 dp = tc_index_to_dp(skb);
256 256
257 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { 257 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
258 if (net_ratelimit()) 258 net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x after dequeue, screwing up backlog\n",
259 pr_warning("GRED: Unable to relocate VQ 0x%x " 259 tc_index_to_dp(skb));
260 "after dequeue, screwing up "
261 "backlog.\n", tc_index_to_dp(skb));
262 } else { 260 } else {
263 q->backlog -= qdisc_pkt_len(skb); 261 q->backlog -= qdisc_pkt_len(skb);
264 262
@@ -287,10 +285,8 @@ static unsigned int gred_drop(struct Qdisc *sch)
287 u16 dp = tc_index_to_dp(skb); 285 u16 dp = tc_index_to_dp(skb);
288 286
289 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) { 287 if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
290 if (net_ratelimit()) 288 net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x while dropping, screwing up backlog\n",
291 pr_warning("GRED: Unable to relocate VQ 0x%x " 289 tc_index_to_dp(skb));
292 "while dropping, screwing up "
293 "backlog.\n", tc_index_to_dp(skb));
294 } else { 290 } else {
295 q->backlog -= len; 291 q->backlog -= len;
296 q->stats.other++; 292 q->stats.other++;