net sched: cleanup and rate limit warning
authorstephen hemminger <shemminger@vyatta.com>
Tue, 11 May 2010 14:24:12 +0000 (14:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 May 2010 06:23:13 +0000 (23:23 -0700)
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 <shemminger@vyatta.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_api.c

index 9839b26674f45a54534b08d5e50a1dd5944ce9c7..fe35c1f338c2b25d7c2a4e4ae19123bf4023f6b5 100644 (file)
@@ -1637,9 +1637,12 @@ reclassify:
                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);