提交 9532021d 编写于 作者: S Steve Glendinning 提交者: David S. Miller

usbnet: ratelimit kevent may have been dropped warnings

when something goes wrong, a flood of these messages can be
generated by usbnet (thousands per second).  This doesn't
generally *help* the condition so this patch ratelimits the
rate of their generation.

There's an underlying problem in usbnet's kevent deferral
mechanism which needs fixing, specifically that events *can*
get dropped and not handled.  This patch doesn't address this,
but just mitigates fallout caused by the current implemention.
Signed-off-by: NSteve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 60713a0c
...@@ -359,10 +359,12 @@ static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb, ...@@ -359,10 +359,12 @@ static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb,
void usbnet_defer_kevent (struct usbnet *dev, int work) void usbnet_defer_kevent (struct usbnet *dev, int work)
{ {
set_bit (work, &dev->flags); set_bit (work, &dev->flags);
if (!schedule_work (&dev->kevent)) if (!schedule_work (&dev->kevent)) {
netdev_err(dev->net, "kevent %d may have been dropped\n", work); if (net_ratelimit())
else netdev_err(dev->net, "kevent %d may have been dropped\n", work);
} else {
netdev_dbg(dev->net, "kevent %d scheduled\n", work); netdev_dbg(dev->net, "kevent %d scheduled\n", work);
}
} }
EXPORT_SYMBOL_GPL(usbnet_defer_kevent); EXPORT_SYMBOL_GPL(usbnet_defer_kevent);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册