diff options
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dev.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index ce6ad88c980..7d149550e8d 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1483,8 +1483,9 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) | |||
1483 | skb_orphan(skb); | 1483 | skb_orphan(skb); |
1484 | nf_reset(skb); | 1484 | nf_reset(skb); |
1485 | 1485 | ||
1486 | if (!(dev->flags & IFF_UP) || | 1486 | if (unlikely(!(dev->flags & IFF_UP) || |
1487 | (skb->len > (dev->mtu + dev->hard_header_len))) { | 1487 | (skb->len > (dev->mtu + dev->hard_header_len)))) { |
1488 | atomic_long_inc(&dev->rx_dropped); | ||
1488 | kfree_skb(skb); | 1489 | kfree_skb(skb); |
1489 | return NET_RX_DROP; | 1490 | return NET_RX_DROP; |
1490 | } | 1491 | } |
@@ -2548,6 +2549,7 @@ enqueue: | |||
2548 | 2549 | ||
2549 | local_irq_restore(flags); | 2550 | local_irq_restore(flags); |
2550 | 2551 | ||
2552 | atomic_long_inc(&skb->dev->rx_dropped); | ||
2551 | kfree_skb(skb); | 2553 | kfree_skb(skb); |
2552 | return NET_RX_DROP; | 2554 | return NET_RX_DROP; |
2553 | } | 2555 | } |
@@ -2995,6 +2997,7 @@ ncls: | |||
2995 | if (pt_prev) { | 2997 | if (pt_prev) { |
2996 | ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); | 2998 | ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev); |
2997 | } else { | 2999 | } else { |
3000 | atomic_long_inc(&skb->dev->rx_dropped); | ||
2998 | kfree_skb(skb); | 3001 | kfree_skb(skb); |
2999 | /* Jamal, now you will not able to escape explaining | 3002 | /* Jamal, now you will not able to escape explaining |
3000 | * me how you were going to use this. :-) | 3003 | * me how you were going to use this. :-) |
@@ -5429,14 +5432,14 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, | |||
5429 | 5432 | ||
5430 | if (ops->ndo_get_stats64) { | 5433 | if (ops->ndo_get_stats64) { |
5431 | memset(storage, 0, sizeof(*storage)); | 5434 | memset(storage, 0, sizeof(*storage)); |
5432 | return ops->ndo_get_stats64(dev, storage); | 5435 | ops->ndo_get_stats64(dev, storage); |
5433 | } | 5436 | } else if (ops->ndo_get_stats) { |
5434 | if (ops->ndo_get_stats) { | ||
5435 | netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev)); | 5437 | netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev)); |
5436 | return storage; | 5438 | } else { |
5439 | netdev_stats_to_stats64(storage, &dev->stats); | ||
5440 | dev_txq_stats_fold(dev, storage); | ||
5437 | } | 5441 | } |
5438 | netdev_stats_to_stats64(storage, &dev->stats); | 5442 | storage->rx_dropped += atomic_long_read(&dev->rx_dropped); |
5439 | dev_txq_stats_fold(dev, storage); | ||
5440 | return storage; | 5443 | return storage; |
5441 | } | 5444 | } |
5442 | EXPORT_SYMBOL(dev_get_stats); | 5445 | EXPORT_SYMBOL(dev_get_stats); |