Commit be443899 authored by Amerigo Wang's avatar Amerigo Wang Committed by David S. Miller

virtio_net: use net_*_ratelimited() helpers

These can be converted to net_*_ratelimited().

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: default avatarCong Wang <amwang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c068e777
...@@ -212,8 +212,7 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi, ...@@ -212,8 +212,7 @@ static struct sk_buff *page_to_skb(struct virtnet_info *vi,
* the case of a broken device. * the case of a broken device.
*/ */
if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) { if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) {
if (net_ratelimit()) net_dbg_ratelimited("%s: too much data\n", skb->dev->name);
pr_debug("%s: too much data\n", skb->dev->name);
dev_kfree_skb(skb); dev_kfree_skb(skb);
return NULL; return NULL;
} }
...@@ -333,9 +332,8 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) ...@@ -333,9 +332,8 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len)
skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6;
break; break;
default: default:
if (net_ratelimit()) net_warn_ratelimited("%s: bad gso type %u.\n",
printk(KERN_WARNING "%s: bad gso type %u.\n", dev->name, hdr->hdr.gso_type);
dev->name, hdr->hdr.gso_type);
goto frame_err; goto frame_err;
} }
...@@ -344,9 +342,7 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len) ...@@ -344,9 +342,7 @@ static void receive_buf(struct net_device *dev, void *buf, unsigned int len)
skb_shinfo(skb)->gso_size = hdr->hdr.gso_size; skb_shinfo(skb)->gso_size = hdr->hdr.gso_size;
if (skb_shinfo(skb)->gso_size == 0) { if (skb_shinfo(skb)->gso_size == 0) {
if (net_ratelimit()) net_warn_ratelimited("%s: zero gso size.\n", dev->name);
printk(KERN_WARNING "%s: zero gso size.\n",
dev->name);
goto frame_err; goto frame_err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment