Skip to content

Commit

Permalink
net sched: cleanup and rate limit warning
Browse files Browse the repository at this point in the history
If the user has a bad classification configuration, and gets a packet
that goes through too many steps. Chances are more packets will arrive,
and the message spew will overrun syslog because it is not rate limited.
And because it is not tagged with appropriate priority it can't not be screened.

Added the qdisc to the message to try and give some more context when
the message does arrive.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
stephen hemminger authored and davem330 committed May 18, 2010
1 parent 207024b commit b60b659
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,9 +1637,12 @@ int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
tp = otp;

if (verd++ >= MAX_REC_LOOP) {
printk("rule prio %u protocol %02x reclassify loop, "
"packet dropped\n",
tp->prio&0xffff, ntohs(tp->protocol));
if (net_ratelimit())
printk(KERN_NOTICE
"%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);
Expand Down

0 comments on commit b60b659

Please sign in to comment.