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>
This commit is contained in:
Joe Perches
2012-05-13 21:56:26 +00:00
committed by David S. Miller
parent 3a3bfb61e6
commit e87cc4728f
76 changed files with 307 additions and 491 deletions

View File

@@ -1,5 +1,5 @@
/*
* net/sched/ipt.c iptables target interface
* net/sched/ipt.c iptables target interface
*
*TODO: Add other tables. For now we only support the ipv4 table targets
*
@@ -235,9 +235,8 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
result = TC_ACT_PIPE;
break;
default:
if (net_ratelimit())
pr_notice("tc filter: Bogus netfilter code"
" %d assume ACCEPT\n", ret);
net_notice_ratelimited("tc filter: Bogus netfilter code %d assume ACCEPT\n",
ret);
result = TC_POLICE_OK;
break;
}

View File

@@ -174,9 +174,8 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a,
}
if (!(dev->flags & IFF_UP)) {
if (net_ratelimit())
pr_notice("tc mirred to Houston: device %s is down\n",
dev->name);
net_notice_ratelimited("tc mirred to Houston: device %s is down\n",
dev->name);
goto out;
}

View File

@@ -234,8 +234,7 @@ out:
return -1;
deadloop:
if (net_ratelimit())
pr_warning("cls_u32: dead loop\n");
net_warn_ratelimited("cls_u32: dead loop\n");
return -1;
}

View File

@@ -537,9 +537,7 @@ pop_stack:
return res;
stack_overflow:
if (net_ratelimit())
pr_warning("tc ematch: local stack overflow,"
" increase NET_EMATCH_STACK\n");
net_warn_ratelimited("tc ematch: local stack overflow, increase NET_EMATCH_STACK\n");
return -1;
}
EXPORT_SYMBOL(__tcf_em_tree_match);

View File

@@ -1691,12 +1691,10 @@ reclassify:
tp = otp;
if (verd++ >= MAX_REC_LOOP) {
if (net_ratelimit())
pr_notice("%s: packet reclassify loop"
" rule prio %u protocol %02x\n",
tp->q->ops->id,
tp->prio & 0xffff,
ntohs(tp->protocol));
net_notice_ratelimited("%s: packet reclassify loop rule prio %u protocol %02x\n",
tp->q->ops->id,
tp->prio & 0xffff,
ntohs(tp->protocol));
return TC_ACT_SHOT;
}
skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);

View File

@@ -86,9 +86,8 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb,
* deadloop is detected. Return OK to try the next skb.
*/
kfree_skb(skb);
if (net_ratelimit())
pr_warning("Dead loop on netdevice %s, fix it urgently!\n",
dev_queue->dev->name);
net_warn_ratelimited("Dead loop on netdevice %s, fix it urgently!\n",
dev_queue->dev->name);
ret = qdisc_qlen(q);
} else {
/*
@@ -136,9 +135,9 @@ int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
ret = handle_dev_cpu_collision(skb, txq, q);
} else {
/* Driver returned NETDEV_TX_BUSY - requeue skb */
if (unlikely (ret != NETDEV_TX_BUSY && net_ratelimit()))
pr_warning("BUG %s code %d qlen %d\n",
dev->name, ret, q->q.qlen);
if (unlikely(ret != NETDEV_TX_BUSY))
net_warn_ratelimited("BUG %s code %d qlen %d\n",
dev->name, ret, q->q.qlen);
ret = dev_requeue_skb(skb, q);
}

View File

@@ -255,10 +255,8 @@ static struct sk_buff *gred_dequeue(struct Qdisc *sch)
u16 dp = tc_index_to_dp(skb);
if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
if (net_ratelimit())
pr_warning("GRED: Unable to relocate VQ 0x%x "
"after dequeue, screwing up "
"backlog.\n", tc_index_to_dp(skb));
net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x after dequeue, screwing up backlog\n",
tc_index_to_dp(skb));
} else {
q->backlog -= qdisc_pkt_len(skb);
@@ -287,10 +285,8 @@ static unsigned int gred_drop(struct Qdisc *sch)
u16 dp = tc_index_to_dp(skb);
if (dp >= t->DPs || (q = t->tab[dp]) == NULL) {
if (net_ratelimit())
pr_warning("GRED: Unable to relocate VQ 0x%x "
"while dropping, screwing up "
"backlog.\n", tc_index_to_dp(skb));
net_warn_ratelimited("GRED: Unable to relocate VQ 0x%x while dropping, screwing up backlog\n",
tc_index_to_dp(skb));
} else {
q->backlog -= len;
q->stats.other++;