From: Ben Greear Date: Fri, 19 Apr 2013 10:45:52 +0000 (+0000) Subject: net: rate-limit warn-bad-offload splats. X-Git-Tag: v3.8.11~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=24fce1108c501a4558f3f62efa956062937febf5;p=users%2Fjedix%2Flinux-maple.git net: rate-limit warn-bad-offload splats. [ Upstream commit c846ad9b880ece01bb4d8d07ba917734edf0324f ] If one does do something unfortunate and allow a bad offload bug into the kernel, this the skb_warn_bad_offload can effectively live-lock the system, filling the logs with the same error over and over. Add rate limitation to this so that box remains otherwise functional in this case. Signed-off-by: Ben Greear Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/dev.c b/net/core/dev.c index 28b6f97c340d..d592214b1393 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2018,6 +2018,9 @@ static void skb_warn_bad_offload(const struct sk_buff *skb) struct net_device *dev = skb->dev; const char *driver = ""; + if (!net_ratelimit()) + return; + if (dev && dev->dev.parent) driver = dev_driver_string(dev->dev.parent);